Trait geo::algorithm::haversine_destination::HaversineDestination[][src]

pub trait HaversineDestination<T: CoordFloat> {
    fn haversine_destination(&self, bearing: T, distance: T) -> Point<T>;
}

Returns a new Point using the distance to the existing Point and a bearing for the direction

Note: this implementation uses a mean earth radius of 6371.088 km, based on the recommendation of the IUGG

Required methods

fn haversine_destination(&self, bearing: T, distance: T) -> Point<T>[src]

Returns a new Point using distance to the existing Point and a bearing for the direction

Units

  • bearing: degrees
  • distance: meters

Examples

use geo::algorithm::haversine_destination::HaversineDestination;
use geo::Point;

let p_1 = Point::<f64>::new(9.177789688110352, 48.776781529534965);
let p_2 = p_1.haversine_destination(45., 10000.);
assert_eq!(p_2, Point::<f64>::new(9.274409949623548, 48.84033274015048))
Loading content...

Implementors

impl<T> HaversineDestination<T> for Point<T> where
    T: CoordFloat + FromPrimitive
[src]

Loading content...