Function piston_window::math::area_centroid

source ยท
pub fn area_centroid<T>(polygon: &[[T; 2]]) -> (T, [T; 2])
where T: Float,
Expand description

Computes the area and centroid of a simple polygon.

A simple polygon is one that does not intersect itself. Source: http://en.wikipedia.org/wiki/Polygon_area#Simple_polygons