Javascript examples for Math:asin
The asin() method returns the arcsine of a number as a value between -PI/2 and PI/2 radians.
Parameter | Description |
---|---|
x | Required. A number |
A Number, from -PI/2 to PI/2, or NaN if the value is outside the range of -1 to 1
The following code shows how to return the arcsine of a number:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from www . j av a2 s . c o m document.getElementById("demo").innerHTML = Math.asin(0.5); } </script> </body> </html>