Math asin() Method - Javascript Math

Javascript examples for Math:asin

Description

The asin() method returns the arcsine of a number as a value between -PI/2 and PI/2 radians.

Parameter Values

Parameter Description
x Required. A number

Return Value:

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:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials