热线电话:13121318867

登录
2019-06-13 阅读量: 940
NumPy 三角函数

NumPy 提供了大量好用的通用函数,其中对于数据科学家最有用的就是三角函数。首先定

义一个角度数组:

In[15]: theta = np.linspace(0, np.pi, 3)

现在可以对这些值进行一些三角函数计算:

In[16]: print("theta = ", theta)
print("sin(theta) = ", np.sin(theta))
print("cos(theta) = ", np.cos(theta))
print("tan(theta) = ", np.tan(theta))
theta = [ 0. 1.57079633 3.14159265]
sin(theta) = [ 0.00000000e+00 1.00000000e+00 1.22464680e-16]
0.0000
1
关注作者
收藏
评论(0)

发表评论

暂无数据