triangle-centroid1.0.0 • Public • Published
Computes the centroid or "center of gravity" of a triangle. The vectors can be 2D, 3D or n-dimensional.
var centroid =var tri =10 0 -420 2 2430 1 4// -> [20, 1, 8]
centroid = triangleCentroid(triangle)
For the given
triangle, an array of 3 vectors, computes the centroid or "center of gravity".
Returns a new vector with the same dimension as the first point in
MIT, see LICENSE.md for details.