pub trait Distance {
    // Required method
    fn distance(&self, other: &Self) -> Length;
}
Expand description

A trait that defines a method for calculating the distance between two points of the same type. Implementations are provided for Coord<f64> and Point<f64>.

Required Methods§

source

fn distance(&self, other: &Self) -> Length

Calculate the distance between self and other and return the result as a Length in meters.

Implementations on Foreign Types§

source§

impl Distance for Point<f64>

Implementation of Distance for Point<f64>. The distance is calculated using the Euclidean formula.

source§

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

source§

impl Distance for Coord<f64>

Implementation of Distance for Coord<f64>. The distance is calculated using the Haversine formula.

source§

fn distance(&self, other: &Coord<f64>) -> Length

Implementors§