angle_sc::trig

Function 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

  • a the sine of the angle.

ยง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)));