import math
print(math.asin(1)) # 1.5707963267948966
print(math.asin(0.56)) # 0.5943858000010622
print(math.asin(-0.56)) # -0.5943858000010622
print(math.asin(-1)) # -1.5707963267948966
print(math.asin(0)) # 0.0
Note that all the inputs are in radian. print(math.asin(1.01))
print(math.asin(-1.01))
Above code will generate error. import math
in_degree = 57
in_redian = math.radians(in_degree)
print(math.asin(in_redian))
Output
1.4691422654884898
import matplotlib.pyplot as plt
x=[]
y=[]
i=-1
while (i<=1):
x.append(i)
y.append(math.asin(i))
i=i+0.01
plt.plot(x,y)
plt.show()
acos()
cos() sin() tan()
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.