JavaScript acos() method
- Previous Page abs()
- Next Page acosh()
- Go Up One Level JavaScript Math Reference Manual
Definition and usage
acos()
The method returns the inverse cosine of a number, with a value between 0 and PI radians.
Note:If the parameter x If the value is outside the range of -1 to 1, this method will return NaN.
Tip:If the parameter x If the value is -1, then PI will be returned.
Syntax
Math.acos(x)
Parameter value
Parameter | Description |
---|---|
x | Required. It must be a number between -1.0 and 1.0. |
Technical details
Return value: | Numbers, from 0 to PI, if the value is outside the range of -1 to 1, it returns NaN. |
---|---|
JavaScript version: | ECMAScript 1 |
Browser Support
Math.acos()
Is an ES1 feature (JavaScript 1999). All browsers fully support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Support | Support | Support | Support | Support | Support |
Related Pages
Tutorial:JavaScript Math
- Previous Page abs()
- Next Page acosh()
- Go Up One Level JavaScript Math Reference Manual