Centroid Calculator
Calculate the centroid (geometric center) of a triangle, polygon, 3D points, or standard geometric shapes with step-by-step formulas and 2D visual plot.
What Is a Centroid?
The centroid (also referred to as the geometric center or barycenter) of a geometric figure is the arithmetic mean position of all the points in the shape. Physically, if the shape is cut out from a thin, uniform sheet of material, the centroid is the exact center of mass: the precise balance point upon which the figure will balance horizontally on the tip of a pencil or pin.
Finding centroids is a core requirement across engineering, architecture, physics, computer graphics, and GIS spatial analysis. This calculator supports computing centroids for 2D triangles, 3D triangles, arbitrary $N$-sided polygons, and classic standard structural cross-sections.
Centroid Formulas
1. Centroid of a Triangle
In a triangle with vertices $A(x_1, y_1)$, $B(x_2, y_2)$, and $C(x_3, y_3)$, the centroid is the concurrent intersection point of the three medians (the line segments connecting each vertex to the midpoint of the opposite side). The medians divide each other in a $2:1$ ratio from vertex to base.
$$G_x = \frac{x_1 + x_2 + x_3}{3}, \quad G_y = \frac{y_1 + y_2 + y_3}{3}$$
In three dimensions with coordinates $(x_i, y_i, z_i)$, the $z$-coordinate is similarly $G_z = \frac{z_1 + z_2 + z_3}{3}$.
2. Centroid of a Planar Polygon (Area-Weighted Lamina)
For a non-self-intersecting closed polygon defined by $N$ vertices $(x_0, y_0), (x_1, y_1), \dots, (x_{N-1}, y_{N-1})$ with $(x_N, y_N) = (x_0, y_0)$, the signed area $A$ is given by the Shoelace formula:
$$A = \frac{1}{2} \sum_{i=0}^{N-1} (x_i y_{i+1} - x_{i+1} y_i)$$
The area-weighted lamina centroid coordinates $(C_x, C_y)$ are:
$$C_x = \frac{1}{6A} \sum_{i=0}^{N-1} (x_i + x_{i+1})(x_i y_{i+1} - x_{i+1} y_i)$$
$$C_y = \frac{1}{6A} \sum_{i=0}^{N-1} (y_i + y_{i+1})(x_i y_{i+1} - x_{i+1} y_i)$$
3. Standard Engineering Shapes
- Rectangle (base $b$, height $h$): $G = (\frac{b}{2}, \frac{h}{2})$
- Right-Angled Triangle (base $b$, height $h$): $G = (\frac{b}{3}, \frac{h}{3})$ from the right angle corner
- Semicircle (radius $r$): Centered at origin along flat base, $G = (0, \frac{4r}{3\pi}) \approx (0, 0.4244r)$
- Symmetric Trapezoid (top base $a$, bottom base $b$, height $h$): $G_y = \frac{h}{3} \cdot \frac{2a + b}{a + b}$ from the bottom base
Explore Related Geometry and Physics Calculators
Discover more calculation tools on OnlineMiniTools:
- Area of Triangle with Coordinates Calculator - Calculate triangle area from 2D and 3D coordinate vertices.
- Center of Mass Calculator - Calculate centers of mass with variable particle mass weights.
- Triangle Calculator - Solve side lengths, angles, inradius, and circumradius.
- 3D Distance Calculator - Measure spatial distance and midpoint between 3D points.
Frequently Asked Questions
What is the difference between a centroid and an orthocenter or circumcenter?
The centroid is where the triangle's three medians intersect and represents the geometric average of the vertices. The circumcenter is where the perpendicular bisectors intersect (center of the circumscribed circle), and the orthocenter is where the three altitudes intersect. In any triangle, the centroid, circumcenter, and orthocenter lie on a single line called the Euler line.
Does the centroid of a polygon always lie inside the shape?
For all convex polygons (including every triangle), the centroid always lies strictly inside the figure. However, for concave or non-convex polygons (like an L-shaped room or star shape), the centroid can lie outside the interior boundaries.
What is the centroid of a triangle with vertices at (0, 0), (6, 0), and (3, 6)?
Using the vertex formula: $G_x = (0 + 6 + 3) / 3 = 9 / 3 = 3$, and $G_y = (0 + 0 + 6) / 3 = 6 / 3 = 2$. Therefore, the centroid is located at $(3, 2)$.
What is the difference between vertex mean and lamina centroid for polygons?
The vertex mean is simply the average of the coordinates of the corner points. The lamina centroid (area-weighted) considers the interior area of the flat surface. For triangles they are identical, but for quadrilaterals and higher polygons with unevenly spaced vertices, the lamina centroid provides the true physical balance point.