JavaScript Math asin( ) Method
Below is the example of the Math asin( ) Method.
Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it's lowest price ever!
- Example:
<scripttype="text/javascript">document.write("When 1 is passed as a parameter: "+ Math.asin(1));</script> - Output:
When 1 is passed as a parameter: 1.5707963267948966
The Math.asin( ) method is used to return the arcsine of a number in radians. The Math.asin() method returns a numeric value between -pi/2 and pi/2 radians. The 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.
Math.asin(x)=arcsin(x)=unique y
where y belongs to [-pi/2;pi/2]
such that sin(y)=x
Syntax:
Math.asin(value)
Parameters: This method accepts a single parameter as mentioned above and described below:
- value: This parameter holds a number in radians who arcsine you want to find.
Returns: The Math.asin() method returns the arcsine of the given number in radians.
Below examples illustrate the Math asin() method in JavaScript:
- Example 1:
Input : Math.asin(1) Output : 1.5707963267948966
- Example 2:
Input : Math.asin(-1) Output : -1.5707963267948966
- Example 3:
Input : Math.asin(2) Output : NaN
- Example 4:
Input : Math.asin(0.5) Output : 0.5235987755982989
More example codes for the above method are as follows:
Program 1:
<script type="text/javascript"> document.write("When -1 is passed as a parameter: " + Math.asin(-1));</script> |
Output:
When -1 is passed as a parameter: -1.5707963267948966
Program 2:
<script type="text/javascript"> document.write("When 2 is passed as a parameter: " + Math.asin(2));</script> |
Output:
When 2 is passed as a parameter: NaN
Program 3:
<script type="text/javascript"> document.write("When 0.5 is passed as a parameter: " + Math.asin(0.5));</script> |
Output:
When 0.5 is passed as a parameter: 0.5235987755982989
Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari

