Computer >> Computer tutorials >  >> Programming >> Javascript

Math.asin() function in JavaScript


The asin() function of the Math object accepts a number and returns its arc sin value in radians. To convert the resultant value into degrees, multiply it with 180 and divide the result by 3.14159 (pi value).

Syntax

Its Syntax is as follows

Math.asin(0.5)

Example

<html>
<head>
   <title>JavaScript Example</title>
</head>
<body>
   <script type="text/javascript">
      var result = Math.asin(0.5);
      document.write("arcsine value: "+result);
      document.write("<br>");
      document.write("arcsine value in degrees: "+result*180/Math.PI);
   </script>
</body>
</html>

Output

arcsine value: 0.5235987755982989
arcsine value in degrees: 30.000000000000004