设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)
代入前述坐标,解出x3,y3即可.
(x3-6)/(y3-4)=-(2-2)/(-10-5)=0,x3=6
(4-2)/(6+10)=-(x3-5)/(y3-2),即1/8=-(6-5)/(y3-2),(y3-2)=-8
解得x3=6,y3=-6