How to use asin in JavaScript

In this article, I will explain use of asin() method in JavaScript.
  • 1502

JavaScript asin() Method

  • asin() method of math object returns the arcsine in radians of a number.

  • asin() method returns a numeric value between -pi/2 and pi/2 radians for x between -1 and 1.

  • In asin() method, if x value of number is outside this range, it returns NaN.

Syntax

Math.asin(x)

  • x is a Required number

Example

In the following example show to asin() method returns the arcsine of numbers.

<!DOCTYPE html>

<html>

<body>

<h3 style="background-color:Silver">asin() Method Example</h3>

<p id="demo">Click the button to display the arcsine of 0.8</p>

<button onclick="myFunction()">Click On</button>

<script type="text/javascript">

    function myFunction() {

        document.getElementById("demo").innerHTML = Math.asin(0.8);

    }

</script>

</body>

</html>

Output1

asin 1.jpg

Output2

asin 2.jpg

You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2013 dotNetheaven. All rights reserved.