Tan v0.1.0

Source
Returns the tangent of an angle in radians.

Package: Math

Signature

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

Parameters

NameTypeDescription
xfloat64 / float32An angle, in radians.

Returns

The tangent of x. Tan(±0.0) is ±0.0, preserving the sign. The tangent has no limit at infinity, so Tan(±Inf) is a NaN; a NaN argument also propagates. Near an odd multiple of Pi/2 the result grows without bound, as expected of a pole.

Example

import Math::{ QuarterPi, Tan };

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

See also

  • Math — the package overview
  • Sin / Cos — sine and cosine
  • Cotan — the reciprocal function, computed directly rather than as 1 / Tan(x)
  • ArcTan — the inverse of Tan