Cos
Returns the cosine of an angle in radians.
Module: Math
Signature
rux
func Cos(x: float64) -> float64;
func Cos(x: float32) -> float32;Parameters
| Name | Type | Description |
|---|---|---|
x | float64 / float32 | An angle, in radians. |
Returns
The cosine of x, in the range [-1, 1]. Cosine has no limit at infinity, so Cos(±Inf) is a NaN; a NaN argument also propagates.
Example
rux
import Math::{ Cos, Pi };
let a = Cos(0.0); // 1.0
let b = Cos(Pi); // -1.0