pub fn atan2<T: CordicNumber>(y: T, x: T) -> T {
    if x == T::zero() {
        if y < T::zero() {
            return -T::frac_pi_2();
        } else {
            return T::frac_pi_2();
        }
    }

    if y == T::zero() {
        if x >= T::zero() {
            return T::zero();
        } else {
            return T::pi();
        }
    }

    match (x < T::zero(), y < T::zero()) {
        (false, false) => atan(y / x),
        (false, true) => -atan(-y / x),
        (true, false) => T::pi() - atan(y / -x),
        (true, true) => atan(y / x) - T::pi(),
    }
}
/// Compute the arc-tangent of `y/x` with quadrant correction.
Compute the arc-tangent of `y/x` with quadrant correction.
Compute the arc - tangent of ` y / x ` with quadrant correction .
pub fn atan2<T: CordicNumber>(y: T, x: T) -> T {
    if x == T::zero() {
        if y < T::zero() {
            return -T::frac_pi_2();
        } else {
            return T::frac_pi_2();
        }
    }
    if y == T::zero() {
        if x >= T::zero() {
            return T::zero();
        } else {
            return T::pi();
        }
    }
    match (x < T::zero(), y < T::zero()) {
        (false, false) => atan(y / x),
        (false, true) => -atan(-y / x),
        (true, false) => T::pi() - atan(y / -x),
        (true, true) => atan(y / x) - T::pi(),
    }
}
pub fn atan2 < T : CordicNumber > ( y : T , x : T ) -> T { if x == T :: zero ( ) { if y < T :: zero ( ) { return - T :: frac_pi_2 ( ) ; } else { return T :: frac_pi_2 ( ) ; } } if y == T :: zero ( ) { if x >= T :: zero ( ) { return T :: zero ( ) ; } else { return T :: pi ( ) ; } } match ( x < T :: zero ( ) , y < T :: zero ( ) ) { ( false , false ) => atan ( y / x ) , ( false , true ) => - atan ( - y / x ) , ( true , false ) => T :: pi ( ) - atan ( y / - x ) , ( true , true ) => atan ( y / x ) - T :: pi ( ) , } }
Compute the arc-tangent of `y/x` with quadrant correction.
Compute the arc - tangent of ` y / x ` with quadrant correction .
y
T
x
T