acos(x)

Introduction

The acos(x) function returns the arccosine of x, in radians.

Form

The following is the syntax for the acos(x) function.

Math.acos(x);

Use

Example

The following is the code for the acos(x) function.

document.write(Math.acos(0.5));

On running the above code, the following output is obtained.

Example

The following is the code for the acos(x) function.

document.write(Math.acos(-0.5));

On running the above code, the following output is obtained.