1 | This method returns all vertices of a polygon: public Point[] getPoints() { Point[] points = new Point[ npoints ]; for ( int i = 0; i < npoints; i++ ) { points[i] = new Point( xpoints[i], ypoints[i] ); } return points; } |
2 | It uses certain variables of the Polygon class: xpoints[], ypoints[], and npoints |