pub fn dist_to(&self, other: &Node) -> f64 {
        let earth_radius = 6371.0;
        let lat1_rad = self.lat.to_radians();
        let lon1_rad = self.lon.to_radians();
        let lat2_rad = other.lat.to_radians();
        let lon2_rad = other.lon.to_radians();

        let tmp = ((lat2_rad - lat1_rad) / 2.00).sin().powf(2.0) +
            lat1_rad.cos() * lat2_rad.cos() * ((lon2_rad - lon1_rad) / 2.0).sin().powf(2.0);
        let tmp = 2.0 * ((tmp).sqrt().atan2((1.0 - tmp).sqrt()));
        earth_radius * tmp
    }
/// Computes the Haversine distance to another node.
Computes the Haversine distance to another node.
Computes the Haversine distance to another node .
pub fn dist_to(&self, other: &Node) -> f64 {
        let earth_radius = 6371.0;
        let lat1_rad = self.lat.to_radians();
        let lon1_rad = self.lon.to_radians();
        let lat2_rad = other.lat.to_radians();
        let lon2_rad = other.lon.to_radians();
        let tmp = ((lat2_rad - lat1_rad) / 2.00).sin().powf(2.0) +
            lat1_rad.cos() * lat2_rad.cos() * ((lon2_rad - lon1_rad) / 2.0).sin().powf(2.0);
        let tmp = 2.0 * ((tmp).sqrt().atan2((1.0 - tmp).sqrt()));
        earth_radius * tmp
    }
pub fn dist_to ( & self , other : & Node ) -> f64 { let earth_radius = 6371.0 ; let lat1_rad = self . lat . to_radians ( ) ; let lon1_rad = self . lon . to_radians ( ) ; let lat2_rad = other . lat . to_radians ( ) ; let lon2_rad = other . lon . to_radians ( ) ; let tmp = ( ( lat2_rad - lat1_rad ) / 2.00 ) . sin ( ) . powf ( 2.0 ) + lat1_rad . cos ( ) * lat2_rad . cos ( ) * ( ( lon2_rad - lon1_rad ) / 2.0 ) . sin ( ) . powf ( 2.0 ) ; let tmp = 2.0 * ( ( tmp ) . sqrt ( ) . atan2 ( ( 1.0 - tmp ) . sqrt ( ) ) ) ; earth_radius * tmp }
Computes the Haversine distance to another node.
Computes the Haversine distance to another node .
&self
other
&Node
&self
other
&Node