Skip to main content

wrap_angle_positive

Function wrap_angle_positive 

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

Wrap angle in radians to [0, 2pi).

ยงExamples

use mathverse_core::ops::wrap_angle_positive;

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