Calculates the position of a Triangle's centroid, which is also its center of mass (center of gravity).
The centroid is the point in a Triangle at which its three medians (the lines drawn from the vertices to the bisectors of the opposite sides) meet. It divides each one in a 2:1 ratio.
name | type | arguments | description |
---|---|---|---|
triangle | Phaser.Geom.Triangle |
The Triangle to use. |
|
out | object | Phaser.Geom.Point | <optional> |
An object to store the coordinates in. |
The out
object with modified x
and y
properties, or a new Point if none was provided.