Bil*_*lis 2 python equation trigonometry angle
我正在通过取0到1之间的数字来模拟积分,所以我可以得到一个力分量.但是我总是得到错误的余弦值,例如,当我取a = 1(因此它使得45°角,因此"L"应该等于"k")时,我得到比"L"大的"k"如果有人可以请你看看我错了,我真的很赞.
from math import pi, sin,cos, atan
for n in s:
f=atan(n/a)
L=ko*(Q/N*)*cos(f)
k=ko*(Q/N)*sin(f)
y.append(k)
x.append(L)
yy=sum(y)
xx=sum(x)
print (xx,yy)
Run Code Online (Sandbox Code Playgroud)
你知道它是弧度的,对吧?
In [4]: math.cos(45)
Out[4]: 0.5253219888177297
In [5]: math.cos(45 / 180. * math.pi)
Out[5]: 1.0
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
510 次 |
| 最近记录: |