- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sine is the ratio of the opposite side and hypotenuse of the right triangle they define.
The inverse of sine is called Arc sine. An angle's trigonometric Arc sine value can be calculated using asin() method. This returns a value between -π/2 and π/2.
Using the Math.asin() Method
Google Chrome 1 and above, internet explorer 3 and above, Firefox 1 and above, Opera 3 and above and Safari 1, and above are the supported browsers.
Here, the number value must be between 1 and -1.
number − This is the number for which the arcsine value in radians has to be found.
In this example, two <p> tags are created to display the output. Values between 1 and -1 are assigned to the first set of variables for getting the arcsine value correctly. Values such as a string and values from the range between 1 and -1 are assigned to the second set of variables. Math.asin() method executes all the inputs, and the output is displayed.
In this example, a p tag is created to display the output. Here, the input is given to Math.asin() like 2+1, 1-1, 0.2+0.2. This is the same as a mathematical operation. Based on the range of the result, the arcsine value is returned. That is 2+1=3 out of 1 and -1, which returns NaN. 1-1=0, which is within the range ,and the output is returned.
<html> <body> <h4> Finding the arcsine value of a number using <i> Math.asin() </i> Math operation example</h4> <p id = "asinNumOut"> </p> <script> var asinNumOutEl = document.getElementById("asinNumOut"); asinNumOutEl.innerHTML = "Math.asin(2+2) = " + Math.asin(2+2) + "<br>" +"Math.asin(02+0.2) = " + Math.asin(02+0.2) + "<br>" + "Math.asin(1-1) = " + Math.asin(1-1); </script> </body> </html>
Kickstart Your Career
Get certified by completing the courseGet Started