Skip to main content
Version: 3.28.0

Math.acos()

The Math.acos() function returns the inverse cosine (in radians) of a number.

Syntax

Math.acos(x)

Parameters

  • x
    • : A number between -1 and 1, inclusive, representing the angle's cosine value.

Return value

The inverse cosine (angle in radians between 0 and π, inclusive) of x. If x is less than -1 or greater than 1, returns NaN.

Description

Because acos() is a static method of Math, you always use it as Math.acos(), rather than as a method of a Math object you created (Math is not a constructor).