Trait nannou::prelude::geom::vertex::Average [−][src]
pub trait Average: Vertex {
fn average<I>(vertices: I) -> Option<Self>
where
I: IntoIterator<Item = Self>;
}
Expand description
Vertices whose average can be determined.
Useful for determining the centroid of triangles, quads and arbitrary polygons.
Required methods
fn average<I>(vertices: I) -> Option<Self> where
I: IntoIterator<Item = Self>,
fn average<I>(vertices: I) -> Option<Self> where
I: IntoIterator<Item = Self>,
Produce the average of the given sequence of vertices.
Returns None
if the given iterator is empty.