Centroid of Triangle Calculator – Instant Geometric Center
The centroid of a triangle is the point where all three medians intersect. A median is the line segment connecting a vertex to the midpoint of the opposite side. The centroid is commonly denoted G and is one of the most important triangle centers in geometry, physics, and engineering.
The Centroid Formula
Given a triangle with vertices A(x₁, y₁), B(x₂, y₂), and C(x₃, y₃), the centroid G is simply the arithmetic mean of the three vertex coordinates:
Gx = (x₁ + x₂ + x₃) / 3
Gy = (y₁ + y₂ + y₃) / 3
This elegant formula comes directly from the property that the centroid divides each median in the ratio 2 : 1 from vertex to midpoint. Adding the three vertex coordinates and dividing by three is algebraically equivalent to finding that 2/3 point along every median simultaneously.
Step-by-Step Example
Consider triangle A(0, 0), B(6, 0), C(3, 6):
- Gx = (0 + 6 + 3) / 3 = 9 / 3 = 3
- Gy = (0 + 0 + 6) / 3 = 6 / 3 = 2
- Centroid G = (3, 2)
You can verify this by finding the midpoint of each side and confirming that the line from each vertex to the opposite midpoint passes through (3, 2).
Median Lengths
Each median connects a vertex to the midpoint of the opposite side. To compute the midpoints:
- Midpoint of BC =
((x₂ + x₃) / 2, (y₂ + y₃) / 2) - Midpoint of AC =
((x₁ + x₃) / 2, (y₁ + y₃) / 2) - Midpoint of AB =
((x₁ + x₂) / 2, (y₁ + y₂) / 2)
The length of each median is then the straight-line (Euclidean) distance from a vertex to its corresponding midpoint, using d = √(Δx² + Δy²). This calculator displays all three median lengths alongside the centroid result.
Triangle Area via Shoelace Formula
The calculator also reports the triangle's area using the shoelace (surveyor's) formula:
Area = |x₁(y₂ − y₃) + x₂(y₃ − y₁) + x₃(y₁ − y₂)| / 2
The area is used internally to detect collinear points: when the area is effectively zero (less than 10⁻¹⁰), the three vertices lie on a line and no valid triangle exists. The tool displays a clear warning in this case.
Practical Applications
- Physics and engineering — the centroid equals the center of mass of a uniform triangular plate, making it the balance point for load analysis
- Structural engineering — triangular cross-sections and trusses require centroid coordinates to apply bending formulas correctly
- Computer graphics and CAD — collision detection, sprite centering, and mesh analysis often rely on polygon centroids
- Coordinate geometry education — the centroid is a foundational topic in analytic geometry, appearing in textbooks worldwide
- GIS and surveying — the centroid of a triangulated irregular network (TIN) tile is used for interpolation and data aggregation
The Centroid Always Lies Inside the Triangle
Unlike the circumcenter and orthocenter, which can lie outside an obtuse triangle, the centroid is always strictly inside the triangle. This is because it is a weighted average of all interior points, so it can never fall outside the convex hull of the three vertices.
Collinear Points and Degenerate Cases
If you enter three vertices that lie on a straight line — for example A(0, 0), B(1, 1), C(2, 2) — the triangle has zero area and no valid centroid exists. The calculator detects this automatically and displays a warning instead of a meaningless result. Two identical vertices also produce zero area and trigger the same validation message.
Adjustable Decimal Precision
You can control the number of decimal places displayed (0 to 10) using the Decimal Precision field. This is especially helpful when working with large-scale engineering coordinates where four or more decimal places are needed, or when a whole-number result is sufficient for a quick check. All computations use JavaScript's 64-bit double-precision arithmetic, delivering approximately 15 significant figures internally.