The acos() method returns the arccosine of a number as a numeric value value between 0 and PI radians.
Note: If the parameter x is outside the range -1 to 1, the browser will return NaN.
Note: -1 will return the value of PI
In this example we will get the arccosine of different numbers:
Demo
Math.acos(x)Parameter is required and must be a numeric value in the range -1 to 1
Note: If the parameter x is outside the range -1 to 1, the browser will return NaN.
Note: -1 will return the value of PI
In this example we will get the arccosine of different numbers:
<script type="text/javascript">Sample code and demo is here
document.write(Math.acos(0.64) + "<br />")
document.write(Math.acos(0) + "<br />")
document.write(Math.acos(-1) + "<br />")
document.write(Math.acos(1) + "<br />")
document.write(Math.acos(2))</script>
Demo
No comments:
Post a Comment