Sin v0.1.0

Source
Returns the sine of an angle in radians.

Package: Math

Signature

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

Parameters

NameTypeDescription
xfloat64 / float32An angle, in radians.

Returns

The sine of x, in the range [-1, 1]. Sin(±0.0) is ±0.0, preserving the sign. Sine has no limit at infinity, so Sin(±Inf) is a NaN; a NaN argument also propagates.

Example

import Math::{ HalfPi, Sin };

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

See also

  • Math — the package overview
  • Cos — cosine
  • Tan — tangent
  • ArcSin — the inverse of Sin
  • DegToRad — convert a degree value to radians first