# Ruby | Math asin() function

The asin() is an inbuilt function in Ruby returns the arc sine of a number means give a sin value to this function it will return the angle in radian corresponding to that value. The value passed is in between -1 and +1.

Syntax: Math.sin(value)

Parameters: The function accepts one mandatory parameter value whose corresponding angle we have to find.

Return Value: It returns the angle in radians which in range -pi/2 to +pi/2.

Example 1:

 `#Ruby program for asin() function ` ` `  `#Assigning values ` `val1 = 1 val2 = 0.5 val3 = -1 val4 = -0.9 ` ` `  `#Prints the asin() value ` `                                      ``puts` `Math.``asin``(val1) ` `                                          ``puts` `Math.``asin``(val2) ` `                                              ``puts` `Math.``asin``(val3) ` `                                                  ``puts` `Math.``asin``(val4) `

Output:

```1.5707963267948966
0.5235987755982989
-1.5707963267948966
-1.1197695149986342
```

Example 2:

 `#Ruby program for asin() function ` ` `  `#Assigning values ` `val1 = 0.87 val2 = 0.67 val3 = -0.679 val4 = -0.564 ` ` `  `#Prints the asin() value ` `                                              ``puts` `Math.``asin``(val1) ` `                                                  ``puts` `Math.``asin``(val2) ` `                                                      ``puts` `Math.``asin``(val3) ` `                                                          ``puts` `Math.``asin``(val4) `

Output:

```1.0552023205488061
0.7342087874533589
-0.746399633896421
-0.59922176813665
```

My Personal Notes arrow_drop_up The function of education is to teach one to think intensively and to think critically

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.