CPolygon:PathLen


The PathLen method calculates the path length along the vertices of the CPolygon. The polygon does not need to be convex.

Syntax

nLen = CPolygon:PathLen()

where

    nLen is the path length from index 1 to Count through the polygon indices.

Example

The following script creates a CPolygon from 2 data arrays, x, and y, and then calculates its path length:

A = NewPolygon( {4,5,6,7}, {1,2,-3,5} )

-- create CPolygon A

Printf("PathLen = %lg", A:PathLen() )

-- result: PathLen = 19.5755

Related Topics

Distance

Perimeter

CPolygon class