PointDistance

Trait PointDistance 

Source
pub trait PointDistance<T: CoordNum> {
    // Required methods
    fn distance(&self, other: &Point<T>) -> T;
    fn length(&self) -> T;
}
Expand description

Trait that implements a distance function between two geo_types::Point structs. Also includes a length function which returns the length of a geo_types::Point as if it were a Vector.

Required Methods§

Source

fn distance(&self, other: &Point<T>) -> T

Return the scalar distance between two geo_types::Points.

Source

fn length(&self) -> T

Treat a geo_types::Point as a Vector and return its scalar length.

Implementations on Foreign Types§

Source§

impl<T> PointDistance<T> for Point<T>
where T: CoordNum + Real,

Source§

fn distance(&self, other: &Point<T>) -> T

Source§

fn length(&self) -> T

Implementors§