pub fn distance(&self, from: &Coord) -> f64{
        let p = std::f64::consts::PI / 180.0;
        let a = 0.5 - ((from.lat - self.lat) * p).cos()/2.0 +
            (self.lat * p).cos() * (from.lat * p).cos() *
            (1.0 - ((from.lon - self.lon) * p).cos())/2.0;
        12742.0 * a.sqrt().asin()
    }
/// Get the distance between two points in km
Get the distance between two points in km
Get the distance between two points in km
pub fn distance(&self, from: &Coord) -> f64{
        let p = std::f64::consts::PI / 180.0;
        let a = 0.5 - ((from.lat - self.lat) * p).cos()/2.0 +
            (self.lat * p).cos() * (from.lat * p).cos() *
            (1.0 - ((from.lon - self.lon) * p).cos())/2.0;
        12742.0 * a.sqrt().asin()
    }
pub fn distance ( & self , from : & Coord ) -> f64 { let p = std :: f64 :: consts :: PI / 180.0 ; let a = 0.5 - ( ( from . lat - self . lat ) * p ) . cos ( ) / 2.0 + ( self . lat * p ) . cos ( ) * ( from . lat * p ) . cos ( ) * ( 1.0 - ( ( from . lon - self . lon ) * p ) . cos ( ) ) / 2.0 ; 12742.0 * a . sqrt ( ) . asin ( ) }
Get the distance between two points in km
Get the distance between two points in km
&self
from
&Coord
&self
from
&Coord