Function s2::point::true_centroid[][src]

pub fn true_centroid(a: &Point, b: &Point, c: &Point) -> Point

true_centroid returns the true centroid of the spherical triangle ABC multiplied by the signed area of spherical triangle ABC. The result is not normalized. The reasons for multiplying by the signed area are (1) this is the quantity that needs to be summed to compute the centroid of a union or difference of triangles, and (2) it's actually easier to calculate this way. All points must have unit length.

The true centroid (mass centroid) is defined as the surface integral over the spherical triangle of (x,y,z) divided by the triangle area. This is the point that the triangle would rotate around if it was spinning in empty space.

The best centroid for most purposes is the true centroid. Unlike the planar and surface centroids, the true centroid behaves linearly as regions are added or subtracted. That is, if you split a triangle into pieces and compute the average of their centroids (weighted by triangle area), the result equals the centroid of the original triangle. This is not true of the other centroids.