Class: Polygon

Polygon(points)

The class Polygon

Constructor

new Polygon(points)

Parameters:
Name Type Description
points Array.<Point> the array of points which form the polygon
Source:

Members

area

the area of the polygon
Source:

edges :Array.<LineSegment>

containing the edges of the polygon
Type:
Source:

maximumCorner

the corner of the bounding box with the maximum x- and y- coordinates
Source:

minimumCorner

the corner of the bounding box with the minimum x- and y- coordinates
Source:

n

the degree or order of the polygon, i.e. the number of vertices or edges
Source:

vertices :Array.<Point>

containing the vertices of the polygon
Type:
Source:

Methods

translate(x, y) → {Polygon}

translate the polygon by the given displacement in both x- and y-directions; this is not a clone and the original polygon is affected
Parameters:
Name Type Description
x Number the translation in the x-direction
y Number the translation in the y-direction
Source:
Returns:
the translated polygon
Type
Polygon