尝试求解 SAS 三角形 - 使用 math.cos 得到错误的输出
Attempting to solve a SAS triangle- getting wrong output using math.cos
import math
a = 5
b = 7
C = 49
c = (a**2)+(b**2)-(2*a*b*(math.cos(C)))
gc = math.sqrt(c)
print(gc)
输出7.27726060671
什么时候应该输出类似 5.3 的内容。任何帮助将不胜感激。
-凸轮
您需要先convert to radians:
尝试:
c = (a**2)+(b**2)-(2*a*b*(math.cos(math.radians(C))))
print(math.sqrt(c))
#5.29866662196
import math
a = 5
b = 7
C = 49
c = (a**2)+(b**2)-(2*a*b*(math.cos(C)))
gc = math.sqrt(c)
print(gc)
输出7.27726060671 什么时候应该输出类似 5.3 的内容。任何帮助将不胜感激。
-凸轮
您需要先convert to radians:
尝试:
c = (a**2)+(b**2)-(2*a*b*(math.cos(math.radians(C))))
print(math.sqrt(c))
#5.29866662196