我正在尝试使用 python 找到三角形的外心,并且没有用于我正在制作的几何计算器的外部库。问题是我不能使用 y=mx+b 这样的方程,因为计算机认为我正在尝试定义一个变量而不是做代数。
我尝试了很多不同的方法,例如使用 sympy 和 shapely,但没有一个起作用。到目前为止我可以找到中点和斜率。我不太确定该怎么办。请帮忙。谢谢你!
def circumcenter():
c1 = float(input('What is x of point 1?'))
c2 = float(input('What is y of point 1?'))
c3 = float(input('What is x of point 2?'))
c4 = float(input('What is y of point 2?'))
c5 = float(input('What is x of point 3?'))
c6 = float(input('What is y of point 3?'))
m1 = c1 + c3
m2 = c2 + c4
m3 = m1 / 2
m4 = m2 / 2
s1a …Run Code Online (Sandbox Code Playgroud)