Namespace: Centroid

PhSim. Centroid

Namespace for functions that get the centroid (the center) of a PhSimObject.

Source:

Methods


<static> polygon(a)

Find Centroid of a polygon

Parameters:
Name Type Description
a Polygon

Path

Source:
Returns:
Type
Vector

<static> rectangle(rectangle)

Get centroid of a rectangle

Parameters:
Name Type Description
rectangle PhSim.Static.Rectangle
Source:
Returns:
Type
Vector

<static> shape(o)

Get centroid of any shape. If it is a circle or a regPolygon, then o is returned because the properties x and y already define the centroid of the object.

Parameters:
Name Type Description
o PhSimObject
Source:
Returns:
Type
Vector