# Python math.asin() Method

Python math.asin() function calculates a given number’s arcsine (inverse sine). The input value should be from -1 to 1, as the sine function’s output is in this range. The returned result is in radians and will be in the range of -π/2 to π/2.

### Syntax

``````math.asin(num)
``````

### Parameters

It takes one parameter, var, which takes values from the range -1 to 1 and throws and value error if we exceed or precede the given range.

### Return Value

It returns the arcsine value of the number in the float datatype.

If the num argument is a positive or negative number, the asin function returns the Arc Sine value.

If it is not a num, the asin function returns TypeError. If it is outside the range of -1 and 1, the asin() function returns ValueError.

### Example 1

``````import math

a1 = 0.36
b1 = 1
c1 = -1
d1 = -0.36

print("Value for parameter ", a1, " is ", math.asin(a1))
print("Value for parameter ", b1, " is ", math.asin(b1))
print("Value for parameter ", c1, " is ", math.asin(c1))
print("Value for parameter ", d1, " is ", math.asin(d1))``````

Output

``````Value for parameter 0.36 is 0.36826789343663996
Value for parameter 1 is 1.5707963267948966
Value for parameter -1 is -1.5707963267948966
Value for parameter -0.36 is -0.36826789343663996``````

In this example, we have seen that by passing a valid parameter which is different for different examples, we get the desired asin() method solution.

### Example 2

``````import math
a1 = 2

print("Value for parameter ", a1, " is ", math.asin(a1))
``````

Output

``````ValueError: math domain error
``````

In this example, we have seen that passing a parameter with value 2 gives us a math domain error as the function only accepts a value from -1 to 1.

That’s it.

This site uses Akismet to reduce spam. Learn how your comment data is processed.