wrap_phase

Function wrap_phase 

Source
pub fn wrap_phase<T>(phi: T) -> T
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 };