X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

JavaScript acos() Method

Math Object Reference JavaScript Math Object

Example

Return the arccosine of a number:

Math.acos(0.5);

The result will be:


Try it yourself »


Definition and Usage

The acos() method returns the arccosine of a number as a value value between 0 and PI radians.

Note: If the parameter x is outside the range -1 to 1, the method will return NaN.

Tip: -1 will return the value of PI.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The acos() method is supported in all major browsers.


Syntax

Math.acos(x)

Parameter Values

Parameter Description
x Required. A number

Return Value

Type Description
Number A Number, from 0 to PI, or NaN if the value is outside the range of -1 to 1

Technical Details

JavaScript Version: 1.0


Math Object Reference JavaScript Math Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook