To find out the inverse of sine or arcsine in Python we use math.asin()
function or Standard math Library. The inverse of sine is also called arcsine.
asin()
Function in Python
math.asin()
function exists in Standard math Library of Python Programming Language. The purpose of this function is to calculate arcsine or the inverse of the sine of any given number within the range of -1 and 1.
Python asin()
Function Syntax
The syntax of
asin()
function in Python ismath.asin( x )
Python asin()
Function Parameters
X
Any valid Python number (positive or negative within the range of -1 and 1). This parameter is required.Note: if the
x
parameter is not a number or greater than 1, asin()
function will return an error
.
Python asin()
Function Compatibility
Python 2.x – Yes
Python 3.x – Yes
Python 3.x – Yes
Python asin()
Function Return Value
asin()
function will return a floating point number (a value of the inverse of sine in radians).
Python asin()
Function Example
# import math library import math print (math.asin(-0.2)) print (math.asin(0.0)) print (math.asin(0.2)) print (math.asin(1))
Output of Python asin()
function:
-0.2013579207903308
0.0
0.2013579207903308
1.5707963267948966
Note that the unit of output is radian.