Euler Line Calculator – Centroid, Orthocenter & Circumcenter
The Euler line is one of the most elegant results in classical triangle geometry. In 1765, Leonhard Euler proved that three seemingly unrelated triangle centers — the centroid (G), the orthocenter (H), and the circumcenter (O) — always lie on a single straight line, no matter the shape of the triangle (except when it is equilateral). This calculator computes all three centers from your vertex coordinates and derives the line that connects them.
The Three Classical Centers
Given a triangle with vertices A(x₁, y₁), B(x₂, y₂), and C(x₃, y₃):
- Centroid (G) — the intersection of the three medians, and the average of the vertex coordinates:
Gx = (x₁ + x₂ + x₃) / 3,Gy = (y₁ + y₂ + y₃) / 3. It is always inside the triangle. - Circumcenter (O) — the intersection of the perpendicular bisectors of the sides, and the center of the circle passing through all three vertices (the circumcircle).
- Orthocenter (H) — the intersection of the three altitudes (perpendiculars from each vertex to the opposite side).
Computing the Circumcenter
The circumcenter is solved directly from the intersection of two perpendicular bisectors:
D = 2[x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)]
Ox = [(x₁²+y₁²)(y₂−y₃) + (x₂²+y₂²)(y₃−y₁) + (x₃²+y₃²)(y₁−y₂)] / D
Oy = [(x₁²+y₁²)(x₃−x₂) + (x₂²+y₂²)(x₁−x₃) + (x₃²+y₃²)(x₂−x₁)] / D
The circumradius is simply the distance from O to any vertex, R = √((Ox − x₁)² + (Oy − y₁)²).
The Euler Relation for the Orthocenter
Rather than intersecting altitudes directly, this calculator uses Euler's elegant shortcut. Since G divides the segment HO in a fixed 2:1 ratio, the orthocenter can be recovered algebraically from the centroid and circumcenter:
H = 3G − 2O
This single relation replaces the need to compute two altitude equations and intersect them, while giving an identical result to full floating-point precision.
The Euler Line and the 2:1 Ratio
Once G, H, and O are known, the Euler line is the line passing through all three points. The calculator derives it in slope-intercept form y = mx + b, falling back to x = constant for a vertical line. A key property of this line is that the centroid always splits segment HO so that GH = 2 × GO — a ratio you can verify directly in the results panel.
The Nine-Point Center
The nine-point center (N) is the midpoint of the orthocenter and circumcenter, N = (O + H) / 2. It is the center of the nine-point circle, which passes through the midpoints of the three sides, the feet of the three altitudes, and the midpoints of the segments from each vertex to the orthocenter. N always lies on the Euler line, exactly halfway between O and H.
Triangle Classification
The calculator also classifies your triangle by its sides (scalene, isosceles, or equilateral) and by its largest angle (acute, right, or obtuse) using the law of cosines on the squared side lengths. This classification explains where the orthocenter falls:
- Acute triangle — orthocenter lies strictly inside the triangle
- Right triangle — orthocenter sits exactly at the right-angle vertex
- Obtuse triangle— orthocenter lies outside the triangle's boundary
The Equilateral Special Case
For an equilateral triangle, every median, altitude, and perpendicular bisector coincides, so the centroid, orthocenter, and circumcenter collapse onto the exact same point. With no two distinct points to define a line, the Euler line is undefined. The calculator detects this automatically (when GH and GO both approach zero) and displays a clear notice instead of a meaningless equation.
Practical Applications
- Geometry education — the Euler line is a cornerstone topic in triangle geometry courses and olympiad mathematics
- CAD and computer graphics — triangle centers are used in mesh processing, Delaunay triangulation checks, and shape analysis
- Surveying and engineering — circumcenters and centroids appear in triangulation-based positioning calculations
Adjustable Decimal Precision
Use the Decimal Precision control (0 to 10 places) to match the level of detail you need. All arithmetic runs on JavaScript's 64-bit double-precision floats, giving roughly 15 significant digits of internal accuracy regardless of the display precision you choose.