JavaScript ACOS

The JavaScript ACOS function a Math function that calculates the trigonometric Arc Cosine for the specified expression. Arc Cosine also called the inverse of a COSINE Value. The syntax of the JavaScript Acos Function is


If the number argument is not a number or outside the range -1 and 1, JavaScript ACOS function will return NaN.

JavaScript ACOS Function Example

In this JS ACOS Math function example, We are going to find the Arc Cosine values of different data types and display the output

<!DOCTYPE html>
    <title> JavaScript ACOS Function </title>
  <h1> JavaScript ACOS Function </h1>
  <p id = "Pos"></p>
  <p id = "Neg"></p>
  <p id = "Dec"></p>
  <p id = "Neg_Dec"></p>
  <p id = "Str"></p>
  <p id = "Exp"></p>
  <p id = "Null"></p>
  <p id = "Multi"></p>
  <p id = "Out"></p>
    document.getElementById("Pos").innerHTML = Math.acos(1);
    document.getElementById("Neg").innerHTML = Math.acos(-1);
    document.getElementById("Dec").innerHTML = Math.acos(0.45);
    document.getElementById("Neg_Dec").innerHTML = Math.acos(-0.75);
    document.getElementById("Str").innerHTML = Math.acos("JavaScript");
    document.getElementById("Null").innerHTML = Math.acos(null);
    document.getElementById("Multi").innerHTML = Math.acos(0.25 + 0.55 - 0.77);
    document.getElementById("Out").innerHTML = Math.acos(25);
JavaScript ACOS Function