1 Star 0 Fork 0

余超/20189220余超 java

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Exercise3_18.py 790 Bytes
一键复制 编辑 原始数据 按行查看 历史
余超 提交于 2019-05-16 14:39 +08:00 . python的代码
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()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/yuchao20189220/over_20189220java.git
git@gitee.com:yuchao20189220/over_20189220java.git
yuchao20189220
over_20189220java
20189220余超 java
master

搜索帮助