Function angle_sc::trig::swap_sin_cos

source ·
pub fn swap_sin_cos(a: UnitNegRange) -> UnitNegRange
Expand description

Swap the sine into the cosine of an Angle and vice versa.
Uses the identity sin2 + cos2 = 1.
See: Pythagorean identities

§Examples

use angle_sc::trig::{UnitNegRange, swap_sin_cos};

assert_eq!(UnitNegRange(0.0), swap_sin_cos(UnitNegRange(-1.0)));
assert_eq!(UnitNegRange(1.0), swap_sin_cos(UnitNegRange(0.0)));