我不知道我做错了什么。你知道吗
from math import *
# triangle Law of Sines test:
a = float(3)
b = float(3)
c = 4.24264
A = float(45)
B = float(45)
C = float(90)
# it should be equal to the diameter of the triangle's
# ...circumcircle when convert radians to degrees (2.12132) :
print a /sin(A)
print c /sin(C)
# and just test angles :
print degrees( sin( float(45) ) ) # 'SHOULD BE 2.8284'
print degrees( sin( float(90) ) ) # 'SHOULD BE 1'
…以及打印输出:
>> 3.52566408941
>> 4.74570003753
>> 48.7531807286
>> 51.2222357231
您应该执行以下操作:
^{} 将给定的角度从度转换为弧度,并且由于
sin
期望radians
,现在它应该像您期望的那样打印1。你知道吗相关问题 更多 >
编程相关推荐