Easy Tutorial
❮ Prop Canvas Imagedata Data Prop Embed Type ❯

JavaScript acos() Method

JavaScript Math Object

Example

Returns the arccosine of a number:

Output result:


Definition and Usage

The acos() method returns the arccosine of a number. The returned value is an angle in radians between 0 and PI.

Note: If the parameter x is outside the range of -1.0 to 1.0, the browser will return NaN.

Tip: If the parameter x is -1, it will return PI.


Browser Support

All major browsers support the acos() method.


Syntax

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 an angle in radians between 0 and PI.

Technical Details

| JavaScript Version: | 1.0 | | --- | --- |


JavaScript Math Object

❮ Prop Canvas Imagedata Data Prop Embed Type ❯