Line | Count | Source |
1 | use crate::consts::{D2PI, DPI}; | |
2 | use std::ops::Rem; | |
3 | ||
4 | /// Normalize angle into the range -pi <= a < +pi. | |
5 | #[inline] | |
6 | 0 | pub fn anpm(a: f64) -> f64 { |
7 | 0 | let mut w = a.rem(D2PI); |
8 | 0 | if w.abs() >= DPI { |
9 | 0 | w -= D2PI; |
10 | 0 | } |
11 | 0 | w |
12 | 0 | } |