我目前正在编写一个程序,用于计算二维空间中三角形的外心。三角形的外心是三角形各边的三个垂直平分线相交的点。
求三角形外心的步骤如下: 1)计算所有边的中点 2)细化四面坡度 3)计算垂直平分线的斜率 4) 将方程“y - y1 = m(x-x1)”替换为每一边 5)解方程组求外心x,y
我的程序需要找到通过求解先验方程组求解的外心,我不知道如何编写这段代码,这就是我需要帮助的地方。我如何编写一个函数或 2,它将获取所有必需的值并求解其中的 2 个方程?
Note:
In the circumcenter equation y - y1 = m(x-x1)
y1=Midpoint of that side(y component)
m=slope of the same side
x1=Midpoint of that side(x component)
Once the vakues are substituted in you simplify them, then you must solve for x,y.
我当前的代码完成了所有其他需要的事情,这意味着我已经求解了方程组之前的所有变量。 来源 http://www.mathopenref.com/circumcenter.html
http://math.tutorcircle.com/geometry/how-to-find-the-circumcenter-of-a-triangle-algebraically.html
最佳答案
关于c++ - 求解方程组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33797569/