代码拉取完成,页面将自动刷新
import turtle
import math
x1, y1, x2, y2, x3, y3 = eval(input("Enter three points for a triangle: "))
a = math.sqrt((x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3))
b = math.sqrt((x1 - x3) * (x1 - x3) + (y1 - y3) * (y1 - y3))
c = math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))
A = math.degrees(math.acos((a * a - b * b - c * c) / (-2 * b * c)))
B = math.degrees(math.acos((b * b - a * a - c * c) / (-2 * a * c)))
C = math.degrees(math.acos((c * c - b * b - a * a) / (-2 * a * b)))
turtle.penup()
turtle.goto(x1, y1)
turtle.pendown()
turtle.write("p1 (" + "{0:0.2f}".format(A) + ")")
turtle.goto(x2, y2)
turtle.write("p2 (" + "{0:0.2f}".format(B) + ")")
turtle.goto(x3, y3)
turtle.write("p3 (" + "{0:0.2f}".format(C) + ")")
turtle.goto(x1, y1)
turtle.hideturtle()
turtle.done()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。