Trait Destination

Source
pub trait Destination<F: CoordFloat> {
    // Required method
    fn destination(&self, origin: Point<F>, bearing: F, distance: F) -> Point<F>;
}
Expand description

Calculate the destination point from an origin point, given a bearing and a distance.

Required Methods§

Source

fn destination(&self, origin: Point<F>, bearing: F, distance: F) -> Point<F>

Returns a new point having travelled the distance along a line from the origin point with the given bearing.

See specific implementations for details.

§Units
§Examples
use geo::{Haversine, Rhumb, Geodesic, Destination, Point};

let point = Point::new(0.0, 0.0);

assert_relative_eq!(Haversine.destination(point, 45.0, 111_111.0), Point::new(0.706607921147679, 0.7065541919063233));
assert_relative_eq!(Geodesic.destination(point, 45.0, 111_111.0), Point::new(0.7058183774535367, 0.7105205988658333));
assert_relative_eq!(Rhumb.destination(point, 45.0, 111_111.0), Point::new(0.706590011673029, 0.7065721019258285));

Implementors§