CPolygon:Scale


The Scale method scales the CPolygon relative to its center. A scale factor of 1.0 applies no scaling.

Syntax

CPolygon:Scale( nScale )

CPolygon:Scale( nScaleX, nScaleY )

where

    nScale is the multiplication factor to be applied in both directions.

    nScaleX, nScaleY are the multiplication factors for the x and y directions.

Example

The following script creates a CPolygon from 2 arrays and applies a scale factor of 1.5:

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:Scale( 1.5 )

-- scale the polygon

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

-- result: x,y = 6.25, -4.0625

Related Topics

Rotate

Shift

Skew

CPolygon class