Understanding the orthocenter calculator — concept and principle
This calculator finds the orthocentre H of a triangle, the point where its three altitudes meet, from the coordinates of the vertices. It also reports the triangle type, where H lies, the centroid G, the circumcentre O and the distance OH along the Euler line. Use it for coordinate geometry homework and for checking constructions.
How it is calculated
An altitude from a vertex is perpendicular to the opposite side. H satisfies two altitude conditions, written as dot products:
(H − A) · (C − B) = 0 and (H − B) · (C − A) = 0
These are two linear equations in Hx and Hy, solved directly. The centroid is G = ((Ax + Bx + Cx)/3, (Ay + By + Cy)/3), and the circumcentre follows from the Euler-line relation O = (3G − H)/2. If the three points are collinear there is no triangle and no answer.
The principle
The dot product of two vectors is 0 exactly when they are perpendicular, so each equation says "the line from that vertex to H is perpendicular to the opposite side". Two altitudes already fix a point; the third passes through it automatically, which is a classic theorem. Euler showed that H, G and O always lie on one line with G between them and HG = 2·GO, so knowing H and G gives O. The position of H depends on the angles: inside for an acute triangle, at the right-angle vertex for a right triangle, and outside for an obtuse triangle.
Worked example
Default inputs: A(0, 0), B(6, 0), C(2, 4).
- C − B = (−4, 4): −4·Hx + 4·Hy = 0, so Hy = Hx.
- C − A = (2, 4), H − B = (Hx − 6, Hy): 2(Hx − 6) + 4Hy = 0.
- Substitute Hy = Hx: 6Hx = 12, so Hx = 2 and Hy = 2. H = (2, 2).
- All angles are acute, so H lies inside the triangle.
- G = (8/3, 4/3) ≈ (2.66667, 1.33333); O = (3G − H)/2 = (3, 1); OH = √(1² + 1²) ≈ 1.41421.
How to read the result
Check the triangle type first: if H falls outside your drawing, the triangle is obtuse, not wrong. When OH is 0, H, G and O coincide, which happens only in an equilateral triangle. The coordinates are exact up to rounding to six significant figures.
Common mistakes
- Using a perpendicular bisector (which gives the circumcentre) instead of an altitude.
- Drawing an altitude to the wrong side; it must go to the side opposite the vertex.
- Assuming the orthocentre is always inside the triangle.
- Entering three collinear points.
Frequently asked questions
Is the orthocentre the same as the centroid?
Only in an equilateral triangle. In general they are different points on the Euler line.
Where is the orthocentre of a right triangle?
At the right-angle vertex, because the two legs are themselves altitudes.
What is the Euler line?
The line through the orthocentre, centroid and circumcentre of any non-equilateral triangle.
Can I find H with slopes instead?
Yes. Write the equations of two altitudes using negative reciprocal slopes and solve them; vertical sides need special care, which the dot-product form avoids.
Sources: Weisstein, E. W., "Orthocenter", Wolfram MathWorld