JavaScript Math acos() Method

The Math.acos() method returns the arccosine (in radians) of a number

Definition and Usage

The Math.acos() method returns the arccosine (in radians) of a number.

The Math.acos() method returns a value value between 0 and PI.

The Math.acos() method expects a parameter in the range -1 to 1.

Math.acos(-1) returns PI.
Math.acos(0) returns PI/2.
Math.acos(1) returns 0.

Syntax

Math.acos(x)
Parameter Description
x Required.
A number.

Return Value

Type Description
Number0 to PI.
NaN if the parameter is outside the range of -1 to 1 or not numeric.

Browser Support

Math.acos() is an ECMAScript1 (ES1) feature.

ES1 (JavaScript 1997) is fully supported in all browsers:

Chrome IE Edge Firefox Safari Opera
Yes Yes Yes Yes Yes Yes