pub fn sin_cos<T: CordicNumber>(mut angle: T) -> (T, T) {
    let mut negative = false;

    while angle > T::frac_pi_2() {
        angle -= T::pi();
        negative = !negative;
    }

    while angle < -T::frac_pi_2() {
        angle += T::pi();
        negative = !negative;
    }

    let inv_gain = T::one() / gain_cordic(); // FIXME: precompute this.
    let res = cordic_circular(inv_gain, T::zero(), angle, -T::one());

    if negative {
        (-res.1, -res.0)
    } else {
        (res.1, res.0)
    }
}
/// Compute simultaneously the sinus and cosine of the given fixed-point number.
Compute simultaneously the sinus and cosine of the given fixed-point number.
Compute simultaneously the sinus and cosine of the given fixed - point number .
pub fn sin_cos<T: CordicNumber>(mut angle: T) -> (T, T) {
    let mut negative = false;
    while angle > T::frac_pi_2() {
        angle -= T::pi();
        negative = !negative;
    }
    while angle < -T::frac_pi_2() {
        angle += T::pi();
        negative = !negative;
    }
    let inv_gain = T::one() / gain_cordic(); // FIXME: precompute this.
    let res = cordic_circular(inv_gain, T::zero(), angle, -T::one());
    if negative {
        (-res.1, -res.0)
    } else {
        (res.1, res.0)
    }
}
pub fn sin_cos < T : CordicNumber > ( mut angle : T ) -> ( T , T ) { let mut negative = false ; while angle > T :: frac_pi_2 ( ) { angle -= T :: pi ( ) ; negative = ! negative ; } while angle < - T :: frac_pi_2 ( ) { angle += T :: pi ( ) ; negative = ! negative ; } let inv_gain = T :: one ( ) / gain_cordic ( ) ; // FIXME: precompute this. let res = cordic_circular ( inv_gain , T :: zero ( ) , angle , - T :: one ( ) ) ; if negative { ( - res . 1 , - res . 0 ) } else { ( res . 1 , res . 0 ) } }
Compute simultaneously the sinus and cosine of the given fixed-point number.
Compute simultaneously the sinus and cosine of the given fixed - point number .
angle
T