CPolygon:CalcRect


The CalcCenter method calculates the bounding rectangle containing the vertices of the CPolygon.

Syntax

R = CPolygon:CalcRect()

where

    R is a CRect object containing the bounding rectangle of the polygon.

Example

The following script creates a CPolygon from 2 arrays and calculates its bounding rectangle:

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

-- create CPolygon A

Printf("R = [%lg:%lg,%lg:%lg]", A:CalcRect() )

-- result: R = [4:7,-3:5]

Related Topics

GetRect

CalcCenter

CPolygon class