angle_sc::trig

Function cosine_from_sine

Source
pub fn cosine_from_sine(a: UnitNegRange, sign: f64) -> UnitNegRange
Expand description

Calculate the cosine of an angle from it’s sine and the sign of the cosine.

See: swap_sin_cos.

  • a the sine of the angle.
  • sign the sign of the cosine of the angle.

return the cosine of the Angle.

§Examples

use angle_sc::trig::{UnitNegRange, cosine_from_sine, COS_30_DEGREES};

assert_eq!(COS_30_DEGREES, cosine_from_sine(UnitNegRange(0.5), 1.0).0);