CPolygon:Class Description
The CPolygon class provides a general polygon object consisting of a collection of (x,y) point pairs along with several common properties. Several plotting functions use this class to describe plot markers. You also can use this class for other purposes.
| Construction | Object = NewPolygon() (global function with several overloads) Object = CPolygon:new() (class method with several overloads) | 
| Destruction | Object:delete() | 
These properties specify the Polygon properties of the CPolygon object. You can set them directly or by using several methods.
| Global function that creates a new CPolygon object. | |
| Creates a new CPolygon object. Same as NewPolygon. | |
| Deletes the instance of the CPolygon object. | |
| Copies an existing CPolygon object into the current one. | 
The CPolygon class contains numerous math operators so you can use CPolygon objects in expressions, like P=(P1+P2)/2. These are described on the CPolygon Operators page.
The methods below are used for creating and modifying the CPolygon.
| Add point data to the polygon. | |
| Copies only the points from an another CPolygon object. | |
| Return the vertex count for the polygon. | |
| Delete a vertex point from the polygon. | |
| Delete all vertex points from the polygon. | |
| Return the properties of a specified point. | |
| Return a CRect containing the enclosing rectangle. | |
| Insert a point between other points of the polygon. | |
| Set new x,y values for an existing polygon vertex. | 
| Scale the polygon relative to 1.0. | |
| Rotate the polygon. | |
| Shift the polygon in x and y. | |
| Skew the polygon by applying different rotation in each axis. | 
| Calculate the area of the polygon. | |
| Return the center of mass of the polygon. | |
| Return a CRect object enclosing all vertex points. | |
| Returns the distance between two vertices. | |
| Calculate the path length along the polygon. | |
| Calculate the perimeter of the polygon. | |
| Return true if a point is inside the polygon. | 
These methods configure default polygons.
| Creates a circle with the specified number of vertices. | |
| Creates a rotated ellipse with the specified number of vertices. | |
| Creates a rectangle or square. |