Function nannou::geom::centroid[][src]

pub fn centroid<I>(vertices: I) -> Option<<I as IntoIterator>::Item> where
    I: IntoIterator,
    <I as IntoIterator>::Item: Average
Expand description

The centroid (average position) of all vertices in the given iterator.

Returns None if the given iterator contains no vertices.