itacart.boundary.ring_centroid

itacart.boundary.ring_centroid(ring)[source]

Area centroid of a plane ring, in metres.

The shoelace-weighted centroid, not the mean of the vertices. The two agree for a triangle and for a parallelogram and part company for a trapezoid, where the mean is pulled toward whichever base carries more vertices rather than more area.

Shifted onto the first vertex for the same reason ring_area() is: the moments would otherwise difference twenty-million-metre coordinates at the very end.

Parameters:

ring (list[tuple[float, float]])

Return type:

tuple[float, float]