JavaScript Math Object : acos()

The acos() method returns the arccosine of a number, in radians. It returns a numeric value between 0 and pi radians for x between -1 and 1. If the value of number is outside this range, it returns NaN. Syntax :
  Math.acos( number );
Example :
<script>
  var x = -1;
  var y = Math.acos(x);
  document.write("acos(-1) : " + y + "<br/>");
  var x = 5;
  var y = Math.acos(x);
  document.write("acos(5) : " + y + "<br/>");
</script>
Output :



Next Topic :