/** * Creates a new instance of Polygon2D with vertices with the same values as the {@code p} * parameter. * * @param polygon The polygon to copy */ public Polygon2D(Polygon2D polygon) { for (Enumeration e = polygon.vertices(); e.hasMoreElements(); ) { addVertex(new Vector2D((Vector2D) e.nextElement())); } }