[][src]Struct myelin_geometry::ConvexHull

pub struct ConvexHull<'a> { /* fields omitted */ }

Finds the Convex Hull for a given set of Points in counter clockwise order.

Examples

use myelin_geometry::{ConvexHull, Point};

let convex_hull = ConvexHull::try_new(&[
    Point { x: 0.0, y: 0.0 },
    Point { x: 20.0, y: 0.0 },
    Point { x: 10.0, y: 5.0 },
    Point { x: 10.0, y: 10.0 },
])
.unwrap();

let expected_convex_hull_points = &[
    Point { x: 0.0, y: 0.0 },
    Point { x: 20.0, y: 0.0 },
    Point { x: 10.0, y: 10.0 },
];

let convex_hull_points: Vec<_> = convex_hull.collect();
assert_eq!(expected_convex_hull_points, convex_hull_points.as_slice());

Implementations

impl<'a> ConvexHull<'a>[src]

pub fn try_new(points: &'a [Point]) -> Result<Self, ()>[src]

Constructs a new ConvexHull from a given set of points.

Errors

Returns an error when zero points are given.

Trait Implementations

impl<'a> Debug for ConvexHull<'a>[src]

impl<'a> Iterator for ConvexHull<'a>[src]

type Item = Point

The type of the elements being iterated over.

Auto Trait Implementations

impl<'a> RefUnwindSafe for ConvexHull<'a>[src]

impl<'a> Send for ConvexHull<'a>[src]

impl<'a> Sync for ConvexHull<'a>[src]

impl<'a> Unpin for ConvexHull<'a>[src]

impl<'a> UnwindSafe for ConvexHull<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Itertools for T where
    T: Iterator + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.