The Fauna service will be ending on May 30, 2025.

For more information on the service wind down, see our announcement and the Fauna Service End-of-Life FAQ.

Math.cos()

Get the cosine of a Number in radians.

Signature

Math.cos(x: Number) => Number

Description

Gets the cosine of a Number in radians.

Parameters

Parameter Type Required Description

x

Number

true

Number representing an angle in radians.

Return value

Type Description

Number

Cosine of the provided number between -1 and 1, inclusive.

Examples

Math.cos(2 * Math.PI)
1.0
\