Trait geo::algorithm::bearing::Bearing [] [src]

pub trait Bearing<T: Float> {
    fn bearing(&self, point: Point<T>) -> T;
}

Returns the bearing to another Point in degrees.

Bullock, R.: Great Circle Distances and Bearings Between Two Locations, 2007. (https://dtcenter.org/met/users/docs/write_ups/gc_simple.pdf)

Required Methods

Returns the bearing to another Point in degrees, where North is 0° and East is 45°.

use geo::Point;
use geo::algorithm::bearing::Bearing;

let p_1 = Point::<f64>::new(9.177789688110352, 48.776781529534965);
let p_2 = Point::<f64>::new(9.274410083250379, 48.84033282787534);
let bearing = p_1.bearing(p_2);
assert_relative_eq!(bearing, 45., epsilon = 1.0e-6);

Implementors