[][src]Trait geo::algorithm::extremes::ExtremePoints

pub trait ExtremePoints<T: Float> {
    fn extreme_points(&self) -> ExtremePoint<T>;
}

Required methods

fn extreme_points(&self) -> ExtremePoint<T>

Find the extreme x and y Points of a Geometry

This trait is available to any struct implementing both ConvexHull amd ExtremeIndices

Examples

use geo::extremes::ExtremePoints;
use geo::{point, polygon};

// a diamond shape
let polygon = polygon![
    (x: 1.0, y: 0.0),
    (x: 2.0, y: 1.0),
    (x: 1.0, y: 2.0),
    (x: 0.0, y: 1.0),
    (x: 1.0, y: 0.0),
];

let extremes = polygon.extreme_points();

assert_eq!(extremes.xmin, point!(x: 0., y: 1.));
Loading content...

Implementors

impl<T, G> ExtremePoints<T> for G where
    T: Float + Signed,
    G: ConvexHull<T> + ExtremeIndices<T>, 
[src]

Loading content...