How the Centroid Calculator works
The centroid of a triangle is its geometric center — the point where the three medians (the lines from each vertex to the midpoint of the opposite side) intersect. It is also the triangle's balance point: if the triangle were cut from a sheet of uniform material, it would balance perfectly on a pin placed at the centroid.
Formula and method
Given three vertices (x1, y1), (x2, y2), and (x3, y3), the centroid coordinates are simply the average of the vertex coordinates:
- x-bar = (x1 + x2 + x3) / 3
- y-bar = (y1 + y2 + y3) / 3
The calculator also reports the triangle's area using the shoelace formula, Area = |x1(y2 − y3) + x2(y3 − y1) + x3(y1 − y2)| / 2, and the average straight-line distance from the centroid to each of the three vertices, computed with the standard distance formula √((x − x1)² + (y − y1)²) for each vertex and then averaged.
Common sources of error
- Mixed-up coordinates: double-check that each x pairs with the correct y for that vertex — swapping a coordinate between two vertices changes the shape entirely.
- Collinear points: if the three points lie on a straight line, the "triangle" has zero area; the centroid formula still returns a valid average point, but it no longer represents a triangle's balance point.
- Rounding early: enter full-precision coordinates rather than rounded ones, especially if you plan to feed the centroid into a further calculation.
Checking your result
The centroid should always land between the minimum and maximum x-value of the vertices, and likewise between the minimum and maximum y-value — it can never fall outside that bounding box. For a valid (non-degenerate) triangle, the centroid also always lies strictly inside the triangle itself, roughly two-thirds of the way along each median from its vertex.
Applications
Centroids are used in engineering and physics to find the center of mass of uniform flat shapes, in computer graphics to position labels or pivot points on polygons, and in geometry to prove properties about medians and triangle balance. For shapes with more than three vertices, the same averaging idea extends to an area-weighted centroid formula for general polygons.