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

pub trait ExtremePoints {
    type Scalar: CoordinateType;
    pub fn extreme_points(&self) -> ExtremePoint<Self::Scalar>;
}

Associated Types

Loading content...

Required methods

pub fn extreme_points(&self) -> ExtremePoint<Self::Scalar>[src]

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 for G where
    T: Signed + HasKernel,
    G: ConvexHull<Scalar = T> + ExtremeIndices
[src]

type Scalar = T

Loading content...