JavaScript Math.acos()
Examples
let x = Math.acos(-1);
Try it Yourself »
let x = Math.acos(0);
Try it Yourself »
let x = Math.acos(1);
Try it Yourself »
Description
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.
JavaScript Sine and Cosine Methods:
The Math.sin() MethodThe Math.sinh() Method
The Math.asin() Method
The Math.asinh() Method
The Math.cos() Method
The Math.cosh() Method
The Math.acos() Method
The Math.acosh() Method
Syntax
Math.acos(x)
Parameter | Description |
x | Required. A number. |
Return Value
Type | Description |
Number | 0 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 | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |