CPolygon:Rotate


The Rotate method rotates the CPolygon about its center.

Syntax

CPolygon:Rotate( nTheta )

where

    nTheta is the rotation angle, measured in degrees.

Example

The following script creates a CPolygon from 2 arrays and applies a shift of (3.5, -2.1):

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

-- create CPolygon A

Printf("x,y = %lg, %lg", A:GetPt(3) )

-- result: x,y = 6, -3

A:Rotate( 45 )

-- scale the polygon

Printf("x,y = %lg, %lg", A:GetPt(3) )

-- result: x,y = 8.8587, -1.4106

Related Topics

Scale

Shift

Skew

CPolygon class