垂心:
A(x1,y1)B(x2,y2)C(x3,y3),垂心H(x0,y0)
用斜率是负倒数关系Kbc=y3-y2/x3-x2 Kah=y1-y0/x1-x0 Kah=-1/Kbc
得到方程(y3-y2)/(x3-x2)=-(x1-x0)/(y1-y0)
同理可得方程(y2-y1)/(x2-x1)=-(x3-x0)/(y3-y0)
解出x0,y0即可,
垂心:
A(x1,y1)B(x2,y2)C(x3,y3),垂心H(x0,y0)
用斜率是负倒数关系Kbc=y3-y2/x3-x2 Kah=y1-y0/x1-x0 Kah=-1/Kbc
得到方程(y3-y2)/(x3-x2)=-(x1-x0)/(y1-y0)
同理可得方程(y2-y1)/(x2-x1)=-(x3-x0)/(y3-y0)
解出x0,y0即可,