CPolygon:Perimeter
The Perimeter method calculates the path length along the vertices of the CPolygon, then back to index 1. If the polygon is convex, this equals the true perimeter of the polygon. The polygon does not need to be convex.
nPerimeter = CPolygon:Perimeter() where |
nPerimeter is the path length from index 1 to Count and back to index 1.
The following script creates a CPolygon from 2 data arrays, x, and y, and then calculates its perimeter:
|
-- create CPolygon A |
|
-- result: Perimeter = 19.5755 |