三角函数
a = np.array([0,30,45,60,90,120,135,150,180])
转化为弧度
b = a*np.pi/180
print(b)
[0. 0.52359878 0.78539816 1.04719755 1.57079633 2.0943951
2.35619449 2.61799388 3.14159265]
print(np.sin(b))
[0.00000000e+00 5.00000000e-01 7.07106781e-01 8.66025404e-01
1.00000000e+00 8.66025404e-01 7.07106781e-01 5.00000000e-01
1.22464680e-16]
print(np.cos(b))
[ 1.00000000e+00 8.66025404e-01 7.07106781e-01 5.00000000e-01
6.12323400e-17 -5.00000000e-01 -7.07106781e-01 -8.66025404e-01
-1.00000000e+00]
print(np.tan(b))
[ 0.00000000e+00 5.77350269e-01 1.00000000e+00 1.73205081e+00
1.63312394e+16 -1.73205081e+00 -1.00000000e+00 -5.77350269e-01
-1.22464680e-16]