Skip to main content

wrap_angle

Function wrap_angle 

Source
pub fn wrap_angle<T: Real + Rem<Output = T>>(x: T) -> T
Expand description

Normalize an angle in radians to [-pi, pi].

ยงExamples

use mathverse_core::ops::wrap_angle;

let a = wrap_angle(core::f64::consts::PI + 0.1);
assert!((a - (-core::f64::consts::PI + 0.1)).abs() < 1e-15);