JavaScript acos()Method
Definition and Usage
The acos() method returns the arccosine of a number. The returned value is in radians between 0 and PI.
Note:If parameter x is outside the range -1.0 to 1.0, the browser will return NaN.
Tip:If parameter x is -1, then PI will be returned.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the acos() method
Syntax
Math.acos(x)
Parameter Values
| Parameter | Description |
|---|---|
| x | Required. Must be a number between -1.0 and 1.0. |
Return Value
| Type | Description |
|---|---|
| Number | The arccosine of x. The returned value is in radians between 0 and PI. |
Technical Details
| JavaScript Version: | 1.0 |
|---|
Other Extensions
JavaScript Math Object