好的,我所说的切线不是正切倒转,而是能够解决直角三角形中缺失角度长度的切线。到目前为止,我已经能够将相反的腿分开一段相邻的长度。切线问题
#this is for a 6,8, 10 triangle!
#y is 8, x is 6
#if you look on the table, 1.3333 is near 53 degrees
if(a==b):
print("This is a right triagle b/c the legs are equal to the hypotnuse!")
tan = input("Would you like to find the tangent of angle A? : ")
if(tan=="Yes"):
print("Lets do this!")
#works with 6,8,10 triangle for now!
print(y,"/",x)
tan = (str(float(y)/float(x)))
round(float(tan),3)
print(round(float(tan),3))
print("Looking for rounded tan in table!")
#remember that 1.333 is near 53 degrees (see on trig table)
if(tan == 1.333):
print("<A == ", 53)
print("<B == 90")
c = str(int(53)+int(90))
c2 = str(int(180)-int(c))
print("<C == ",c2)
else:
print("Nope")
elif(tan=="No"):
print("See you!")
exit(0);
由于某些原因,程序将只使用else语句,并说nope。请帮忙!提前感谢。