CPolygon:Area
The Area method calculates the area enclosed by the CPolygon. The polygon does not need to be convex.
nArea = CPolygon:Area() where |
nArea is the area enclosed by the polygon.
The following script creates a CPolygon from 2 data arrays, x, and y, and then calculates its area:
|
-- create CPolygon A |
|
-- result: Area = 2 |