Skip to main content

Module angle

Module angle 

Source
Expand description

Angle normalisation.

A common source of bearing bugs. Every function that produces a bearing normalises before returning, so callers never have to check whether they are holding 350 or -10.

Functions§

diff
Signed difference from - to, wrapped to -180.0..=180.0.
norm_180
Wraps an angle into -180.0..=180.0, positive to starboard – the range every relative angle in this crate is returned in (wind angles, course differences).
norm_360
Wraps an angle into 0.0..360.0 – the range every bearing, heading and course in this crate is returned in.
reciprocal
The opposite bearing.