pub fn wrap_phase<T>(phi: T) -> T where
    T: MixedNum + MixedNumSigned + MixedNumConversion<i32> + MixedOps + MixedPi
Expand description

Wrapps θ to the -π=<x<π range.

Arguments

  • phi - The unwrapped phase in radians.

Example

use fixed_trigonometry::*;
use fixed::{types::extra::U28, FixedI32};
 
let phi =  FixedI32::<U28>::from_num(6);
let wrapped_phi = wrap_phase(phi);
assert_eq!{ wrapped_phi.to_num::<f32>(), -0.2831853 };