Triangle Center Calculator
Understanding Triangle Centers
Every non-degenerate triangle has several special points that come from different geometric constructions. This calculator finds four of the most important ones: the centroid, incenter, circumcenter, and orthocenter. You enter the coordinates of the three vertices, and the calculator returns the coordinates of each center. That makes it useful for coordinate geometry homework, drafting, computer graphics, and checking hand calculations.
Although these four points all belong to the same triangle, they do not represent the same idea. The centroid is the triangle's balance point. The incenter is the center of the inscribed circle that touches all three sides. The circumcenter is the center of the circle passing through all three vertices. The orthocenter is the point where the three altitudes meet. Looking at all four together helps you see how a triangle's shape affects its geometry.
This page works directly from Cartesian coordinates, so the inputs can be in any consistent unit system. You might use centimeters, meters, feet, or no physical unit at all if you are working in pure coordinate geometry. The important rule is consistency: all three vertices should be expressed in the same coordinate system and scale.
Introduction
A triangle is determined by three points, often labeled A, B, and C. Once those points are known, many other geometric features can be derived from them. The four classical centers are among the most studied because each one captures a different structural property of the triangle. In an equilateral triangle, all four centers coincide at the same point. In most other triangles, they are distinct, and their relative positions tell you something meaningful about the triangle's symmetry and angle structure.
Coordinate formulas make these centers easy to compute numerically. Instead of drawing medians, angle bisectors, perpendicular bisectors, and altitudes by hand, you can enter the vertex coordinates and let the calculator evaluate the formulas. The result is especially helpful when the coordinates are not simple integers or when you want a quick numerical check before graphing the triangle.
How to Use
Enter the coordinates of the three vertices in the six input boxes. The fields x₁ and y₁ represent the first vertex, x₂ and y₂ represent the second, and x₃ and y₃ represent the third. After entering the values, click Calculate. The result area will display the coordinates of the centroid, incenter, circumcenter, and orthocenter.
For the output to make geometric sense, the three points must form a real triangle. That means they cannot all lie on the same straight line. If the points are collinear, the triangle has zero area, the circumcenter formula breaks down, and some of the reported values become undefined. In ordinary use, you should think of the calculator as intended for non-collinear points.
If you are checking a graph, remember that the order of the vertices does not change the triangle itself. You can label the same three points in a different order and still get the same geometric centers, aside from tiny rounding differences caused by decimal arithmetic. Results are shown to three decimal places for readability.
Formula
The calculator uses coordinate geometry formulas. Let the triangle vertices be A(x₁, y₁), B(x₂, y₂), and C(x₃, y₃). The centroid is the average of the three vertex coordinates, so it is usually the simplest center to compute.
The incenter is a weighted average of the vertices, where the weights are the side lengths opposite those vertices. If a, b, and c are the side lengths opposite A, B, and C, then:
Here the side lengths are computed from the distance formula:
and similarly for b and c. The circumcenter is found from the coordinate formula for the intersection of perpendicular bisectors. The script computes an intermediate denominator
If D = 0, the points are collinear and there is no ordinary circumcenter for a proper triangle. Otherwise, the circumcenter coordinates are computed from the standard determinant-based expressions used in the script. Once the circumcenter O is known, the orthocenter H is obtained from the relation:
This identity is a compact coordinate way to express the orthocenter once the circumcenter has already been found.
Worked Example
Suppose the triangle has vertices A(0, 0), B(5, 0), and C(0, 4), which are also the default values in the form. The centroid is the average of the coordinates, so:
G = ((0 + 5 + 0) / 3, (0 + 0 + 4) / 3) = (1.667, 1.333) after rounding.
Next, compute the side lengths opposite each vertex. The side opposite A is the segment from B to C, which has length √41. The side opposite B has length 4, and the side opposite C has length 5. Using those values in the incenter formula gives an incenter near (1.298, 1.298).
For this right triangle, the circumcenter lies at the midpoint of the hypotenuse, so it is (2.5, 2). Using the orthocenter relation then gives H = (0, 0), which matches the fact that the orthocenter of a right triangle is the right-angle vertex. This example is a good quick check because each center has a clear geometric interpretation.
Interpreting the Results
Each reported point answers a different question about the triangle. If you want the balancing point of a thin triangular plate of uniform density, look at the centroid. If you want the center of the largest circle that fits inside the triangle and touches all three sides, look at the incenter. If you want the center of the circle through all three vertices, use the circumcenter. If you are studying altitudes or acute, right, and obtuse triangle behavior, the orthocenter is often the most informative point.
The location of these centers also changes with triangle type. In an acute triangle, the circumcenter and orthocenter both lie inside the triangle. In a right triangle, the circumcenter lies on the midpoint of the hypotenuse and the orthocenter sits at the right-angle vertex. In an obtuse triangle, the circumcenter and orthocenter fall outside the triangle. The centroid, however, always remains inside.
Limitations and Assumptions
This calculator assumes ordinary Euclidean plane geometry. It does not handle spherical or hyperbolic geometry, and it does not attempt symbolic simplification. Results are numerical and rounded for display. Because JavaScript uses floating-point arithmetic, very large values or nearly collinear points can produce small rounding effects.
The most important limitation is that the three input points must form a non-degenerate triangle. If the points are collinear or almost collinear, the circumcenter calculation becomes unstable because the denominator in the formula approaches zero. In that case, the script may display NaN values for the circumcenter and orthocenter. That is not a random error; it reflects the fact that the geometric construction is undefined for a collapsed triangle.
Another practical assumption is that all coordinates are entered in the same unit system. If one point is entered in meters and another in centimeters, the output will not represent a meaningful geometric figure. As long as the coordinates are consistent, the centers will be reported in the same coordinate units as the inputs.
