Trait geo::algorithm::rhumb::RhumbBearing
source · pub trait RhumbBearing<T: CoordFloat + FromPrimitive> {
// Required method
fn rhumb_bearing(&self, point: Point<T>) -> T;
}
Expand description
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§
sourcefn rhumb_bearing(&self, point: Point<T>) -> T
fn rhumb_bearing(&self, point: Point<T>) -> T
Returns the bearing to another Point in degrees along a rhumb line, where North is 0° and East is 90°.
§Examples
use geo::RhumbBearing;
use geo::Point;
let p_1 = Point::new(9.177789688110352, 48.776781529534965);
let p_2 = Point::new(9.274348757829898, 48.84037308229984);
let bearing = p_1.rhumb_bearing(p_2);
assert_relative_eq!(bearing, 45., epsilon = 1.0e-6);