Cotan v0.1.0

Source
Returns the cotangent of an angle in radians.

Package: Math

Signature

func Cotan(x: float64) -> float64;
func Cotan(x: float32) -> float32;

Parameters

NameTypeDescription
xfloat64 / float32An angle, in radians.

Returns

The cotangent of x, computed directly rather than as 1 / Tan(x) so the result near a pole keeps the bits a second rounding would lose. Cotan(0.0) is +Inf and Cotan(-0.0) is -Inf, carrying the pole at zero with the right sign. The cotangent has no limit at infinity, so Cotan(±Inf) is a NaN; a NaN argument also propagates.

Example

import Math::{ Cotan, QuarterPi };

func Main() -> int {
    let a = Cotan(QuarterPi); // 1.0
    return 0;
}

See also

  • Math — the package overview
  • Tan — tangent
  • ArcCot — the inverse of Cotan