Skip to main content

sincos_diff

Function sincos_diff 

Source
pub fn sincos_diff<T>(
    a: Radians<T>,
    b: Radians<T>,
) -> (UnitNegRange<T>, UnitNegRange<T>)
where T: Float + FloatConst, f64: From<T>,
Expand description

Calculate the sine and cosine of an angle from the difference of a pair of values in Radians.

Note: calculates the cosine of the angle from its sine and overrides the sine and cosine for π/4 to their correct values: 1/√2

  • a, b the angles in Radians

returns sine and cosine of a - b as UnitNegRanges.

§Panics

Panics if it cannot convert value to Float.