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

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§

source

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

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

§Units
  • bearing: degrees, zero degrees is north
  • distance: meters
§Examples
use geo::HaversineDestination;
use geo::Point;
use approx::assert_relative_eq;

let p_1 = Point::new(9.177789688110352, 48.776781529534965);
let p_2 = p_1.haversine_destination(45., 10000.);
assert_relative_eq!(p_2, Point::new(9.274409949623548, 48.84033274015048), epsilon = 1e-6)

Implementors§