Class: Rectangle

Rectangle

new Rectangle(position, width, height)

Name Type Description
position Vector
width number
height number
Properties:
Name Type Description
position Vector
x number
y number
width number
height number

Extends

Methods

Get the centroid of the polygon. This is the vector average of all the points that make up the polygon.
Returns:
Type Description
Vector The centroid of the polygon
Get the polygon inset of the current polygon by the input ammount
Name Type Description
ammount
Returns:
Type Description
Polygon The inset of the current polygon by

inherited isConvex(){boolean}

Returns wheither or not this polygon is a convex polygon. If this is not true then the polygon is convace or more complex.
Returns:
Type Description
boolean If the polygon is convex