Math.asin( ) In JavaScript

The Math.asin( ) function in JavaScript is used to return the arcsine of a number in radians.

```Math.asin(x)=arcsin(x)=unique y,where y belongs to [-pi/2;pi/2]
such that sin(y)=x```

The Math.asin() method returns a numeric value between -pi/2 and pi/2 radians.
asin() is a static method of Math, therefore, it is always used as Math.asin(), rather than as a method of a Math object created.

Syntax:

`Math.asin(value)`

Parameters: this function accepts a single parameter which is a number in radians who arcsine you want to find.

Returns: The Math.asin() function returns the arcsine of the given number in radians.

Examples:

```Input  : Math.asin(1)
Output : 1.5707963267948966

Input  : Math.asin(-1)
Output : -1.5707963267948966

Input  : Math.asin(2)
Output : NaN

Input  : Math.asin(0.5)
Output : 0.5235987755982989

```
• Example 1: When 1 is passed as a parameter.

 `<``script` `type``=``"text/javascript"``> ` `   ``document.write("Output : " + Math.asin(1)); ` ` `

Output:

`Output : 1.5707963267948966`
• Example 2: When -1 is passed as a parameter.

 `<``script` `type``=``"text/javascript"``> ` `   ``document.write("Output : " + Math.asin(-1)); ` ` `

Output:

`Output : -1.5707963267948966`
• Example 3: When 2 is passed as a parameter.

 `<``script` `type``=``"text/javascript"``> ` `   ``document.write("Output : " + Math.asin(2)); ` ` `

Output:

`Output : NaN`
• Example 4: When 0.5 is passed as a parameter.

 `<``script` `type``=``"text/javascript"``> ` `   ``document.write("Output : " + Math.asin(0.5)); ` ` `

Output:

`Output : 0.5235987755982989`
• Supported Browsers: The browsers supported by JavaScript Math.asin( ) function are listed below:

• Internet Explorer
• Firefox
• Opera
• Safari

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.