Function S2Loop.getCentroid

Returns the true centroid of the loop multiplied by the area of the loop (see s2centroids.h for details on centroids). The result is not unit length, so you may want to normalize it. Also note that in general, the centroid may not be contained by the loop.

s2.util.math.vector.Vector!(double,3L) getCentroid() const;

We prescale by the loop area for two reasons: (1) it is cheaper to compute this way, and (2) it makes it easier to compute the centroid of more complicated shapes (by splitting them into disjoint regions and adding their centroids).

Note that the return value is not affected by whether this loop is a "hole" or a "shell".