![]() |
VOOZH | about |
The asin() method of java.lang.Math class, computes the arc sine also called as an inverse of a sine of a given value. This method is useful when we have the sine of an angle and we need to find the angle. This method returns the arc sine of an angle in between -pi/2 and pi/2.
public static double asin(double angle)
Important Points:
Example 1: In this example, we will try to handle out of valid range values.
asin(2.0) = NaN
Explanation: Here, 2.0 is not a valid sine value, so asin() indicates the error with NaN.
Example 2: In this example, we will convert the degrees to radians before asin().
asin(sin30°) in radians: 0.5235987755982988
Example 3: In this example, we will take multiple inputs in one array.
asin(1.0): 1.5708 rad asin(0.0): 0.0000 rad asin(-1.0): -1.5708 rad asin(0.5): 0.5236 rad