JavaScript math acos() method

The JavaScript math acos() method is used to get the arccosine of a number in radians.

Syntax:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Math.acos(n)
Math.acos(n)
Math.acos(n)

Parameters
n: It represents the number whose arccosine has to be get.

Returns
Arccosine of a number.

Example:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<!DOCTYPE html>
<html>
<body>
<script>
document.writeln(Math.acos(1));
</script>
</body>
</html>
<!DOCTYPE html> <html> <body> <script> document.writeln(Math.acos(1)); </script> </body> </html>
<!DOCTYPE html>
<html>
<body>
<script>
document.writeln(Math.acos(1));
</script>
</body>
</html>