CPolygon:GetPt


The GetPt method returns the x,y values for a vertex of the CPolygon.

Syntax

x, y = CPolygon:GetPt( nIndex )

where

    nIndex is the index of the target vertex, between 1 and Count.

    x, y are the coordinates of the point at index nIndex.

Example

The following script creates a CPolygon from 2 arrays and returns the coordinates of the specified vertex:

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

-- create CPolygon A

n = 3

-- specify an index

Printf("pt[%d] = %lg,%lg", n, A:GetPt( n ) )

-- result: pt[3] = 6,-3

Related Topics

SetPt

GetRect

CPolygon class