2

I'm trying to find the coordinates of the orthocenter (the intersection point of all altitudes) of a triangle given its vertices' coordinates $A=(x_1, y_1), \ B=(x_2, y_2) , \ C=(x_3, y_3)$.

I searched for a general formula but couldn't find one by googling, while formulas for the incenter and centroid seem readily available. This suggests there might not be a simple formula for the orthocenter and could be quite complex.

I attempted to derive the formula myself, but long calculations lead to errors. I formulated and tested an expression three times, but it yielded incorrect results.

pie
  • 8,483
  • Should be easy to derive, no? Find equations of two sides then find equations of two heights drawn to these sides then find their intersection. Is that what you tried to do? – Vasili Jul 09 '24 at 18:32
  • Try this: $x_O = (a^2x_1 + b^2x_2 + c^2x_3)/ 2A, y_O = (a^2y_1 + b^2y_2 + c^2y_3) / 2A$ – Vasili Jul 09 '24 at 18:36
  • @Vasili What is $a,b,c,A$? – pie Jul 09 '24 at 19:03
  • 1
    side lengths and area – Vasili Jul 09 '24 at 19:11
  • 1
    COMMENT.-Let $A=(a_1,a_2),B=(b_1,b_2),C=(c_1,c_2)$

    Slope of $AB$ and $AC$ are respectively $m_1=\dfrac{b_2-a_2}{b_1-a_1}$ and $m_2=\dfrac{c_2-a_2}{c_1-a_1}$ so the orthocenter is given by the system $$\begin{cases}y-c_2=\frac{-1}{m_1}(x-c_1)\y-b_2=\frac{-1}{m_2}(x-b_1)\end{cases}$$ (it is not necessary to take the height passing by $A$ because you know why).

    – Ataulfo Jul 09 '24 at 22:51

4 Answers4

3

There is a formula that is easier to remember, using complex numbers.

If the complex coordinates of the points are $z_1$, $z_2$, $z_3$ then we have the center of the circumscribed circle $o$ and the center of the nine point circle $e$

$$o= \frac{ \left | \begin{matrix} 1 & z_1 & |z_1|^2 \\ 1 & z_2 & |z_2|^2 \\ 1 & z_3 & |z_3|^2 \end{matrix} \right | } { \left | \begin{matrix} 1 & z_1 & \bar z_1 \\ 1 & z_2 & \bar z_2 \\ 1 & z_3 & \bar z_3 \end{matrix} \right | }$$

and

$$e = \frac{1}{2}\cdot \frac{ \left | \begin{matrix} 1 & z_1^2 & \bar z_1 \\ 1 & z_2^2 & \bar z_2 \\ 1 & z_3^2 & \bar z_3 \end{matrix} \right | } { \left | \begin{matrix} 1 & z_1 & \bar z_1 \\ 1 & z_2 & \bar z_2 \\ 1 & z_3 & \bar z_3 \end{matrix} \right | }$$

Now use

$$h = 2 e - o$$

orangeskid
  • 56,630
3

For info on tens of thousands of triangle centers, consult Clark Kimberling's Encyclopedia of Triangle Centers; in particular, the orthocenter entry $X(4)$ gives the following barycentric coordinates: $$u:v:w =\frac1{-a^2+b^2+c^2}:\frac1{-b^2+c^2+a^2}:\frac1{-c^2+a^2+b^2}$$ (As the components involve squares of side-lengths, it's straightforward to re-write them in terms of $(x_i,y_i)$.) These allow you to express the coordinates of the orthocenter as a weighted average of the coordinates of the vertices: $$\frac{uA+vB+wC}{u+v+w}$$


As a user of GeoGebra, OP should be pleased to know of the app's built-in support for this stuff via the command TriangleCenter(A, B, C, n), where n is the ETC index (incenter, $n=1$; centroid, $n=2$; circumcenter, $n=3$; orthocenter, $n=4$; nine-point center, $n=5$; etc, etc, ETC ...). I believe GeoGebra currently supports up to just-over $n=3000$; I actually used the feature to search for centers that could answer this question, finding $n=1138$ as a result.

(You can also have GeoGebra calculate barycentric $u$-$v$-$w$ coordinates individually, and then define the corresponding point as (u A + v B + w C)/(u + v + w). I have to do that from time to time.)


Mathematica also has a TriangleCenter[tri, type] function, but (a little surprisingly) it supports only a few named types. As Orthocenter is supported, the app can generate an explicit coordinate formula for you:

Factor[TriangleCenter[{{x1, y1}, {x2, y2}, {x3, y3}}, "Orthocenter"]] yields:

{-(x1 x2 y1 - x1 x3 y1 - x1 x2 y2 + x2 x3 y2 + y1^2 y2 - y1 y2^2 + x1 x3 y3 - x2 x3 y3 - y1^2 y3 + y2^2 y3 + y1 y3^2 - y2 y3^2)/(-x2 y1 + x3 y1 + x1 y2 - x3 y2 - x1 y3 + x2 y3), ( x1^2 x2 - x1 x2^2 - x1^2 x3 + x2^2 x3 + x1 x3^2 - x2 x3^2 + x1 y1 y2 - x2 y1 y2 - x1 y1 y3 + x3 y1 y3 + x2 y2 y3 - x3 y2 y3)/(- x2 y1 + x3 y1 + x1 y2 - x3 y2 - x1 y3 + x2 y3)}

which is a bit of a mess. With a bit of effort, cleverness, and luck, you could re-arrange the above into the form

{x1,y1} p/s + {x2,y2} q/s + {x3,y3} r/s

where expressions p, q, r are obtained from each other by cycling elements: x1$\to$x2$\to$x3$\to$x1 and y1$\to$y2$\to$y3$\to$y1, and s is fully-symmetric. As it happens, p/s, q/s, r/s (with s = p+q+r) are equivalent to the $u$-$v$-$w$ expressions above, with lengths expanded using Cartesian-coordinates.

This highlights another benefit of barycentric coordinates (and similar representations): notational tidiness.

Blue
  • 83,939
1

Yet an other answer... Let $(x,y)$ be the vector of coordinates of the orthocenter $H$ of the triangle $A_1A_2A_3$, where $A_j=(x_j,y_j)$ is (seen as a vector) with given components. Then the conditions $A_1H\perp A_2A_3$ and $A_2H\perp A_3A_1$ (and the third is superfluous) lead to a system of equations using the scalar products of the corresponding vectors: $$ \left\{ \begin{aligned} 0 &= (x-x_1)(x_2-x_3)+(y-y_1)(y_2-y_3)\ ,\\ 0 &= (x-x_2)(x_3-x_1)+(y-y_2)(y_3-y_1)\ , \end{aligned} \right. $$ and we can write it as a system in the usual form by isolating the $x,y$ vector: $$ \begin{bmatrix} x_2-x_3 & y_2-y_3\\ x_3-x_1 & y_3-y_1 \end{bmatrix} \begin{bmatrix} x\\y \end{bmatrix} = \begin{bmatrix} x_1(x_2-x_3) + y_1(y_2-y_3)\\ x_2(x_3-x_1) + y_2(y_3-y_1) \end{bmatrix} \ . $$ Now apply Cramer's rule for instance.

dan_fulea
  • 37,952
1

enter image description here

In figure O is circumcenter and K is its reflection over BC.Since we have coordinates of vertices we can calculate length of the sides a, b and c and also R the radius of circum circle.We use the fact that the circle passing two vertices and orthicenter H has the equal radius as circumcircle.The coordinates of O and K is the solution of the following system of equations:

$\begin{cases}(X_B-Y_O)^2+(Y_B-Y_O)^2=R^2\\(X_C-X_O)^2+(Y_C-Y_O)^2=R^2\end{cases}$

Now we use this fact that $AH=OK=R_1$. So the coordinates of H is the solution of the following system of equations:

$\begin{cases}(X_K-X_H)^2+(Y_K-Y_H)^2=R^2\\(X_A-X_H)^2+(Y_A-Y_H)^2=R_1^2\end{cases}$

sirous
  • 12,694