Function piston_window::math::area_centroid[][src]

pub fn area_centroid<T>(polygon: &[[T; 2]]) -> (T, [T; 2]) where
    T: Float

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