Trait geo::algorithm::distance::Distance [] [src]

pub trait Distance<T, Rhs = Self> {
    fn distance(&self, rhs: &Rhs) -> T;
}

Returns the distance between two geometries.

Required Methods

fn distance(&self, rhs: &Rhs) -> T

Returns the distance between two points:

use geo::{COORD_PRECISION, Point};
use geo::algorithm::distance::Distance;

let p = Point::new(-72.1235, 42.3521);
let dist = p.distance(&Point::new(-72.1260, 42.45));
assert!(dist < COORD_PRECISION)

Implementors