What Is a Centroid?
A centroid (also called the geometric center) is the arithmetic mean position of all the points in a shape. You can think of it as the exact point where you could balance a flat geometric object on the tip of a pin — assuming uniform density throughout.
The centroid is widely used in physics (center of mass of uniform-density objects), engineering (beam deflection calculations), computer graphics (polygon positioning), and many branches of mathematics.
What Is the Formula for the Centroid?
For a set of k points (x₁, y₁), (x₂, y₂), …, (xₖ, yₖ), the centroid coordinates G are:
Gₓ = (x₁ + x₂ + x₃ + … + xₖ) / k Gᵧ = (y₁ + y₂ + y₃ + … + yₖ) / k
This is a simple arithmetic mean and applies to any finite collection of points.
What Is the Centroid Formula for a Triangle?
For a triangle with vertices A(x₁, y₁), B(x₂, y₂), and C(x₃, y₃), the centroid G is:
Gₓ = (x₁ + x₂ + x₃) / 3 Gᵧ = (y₁ + y₂ + y₃) / 3
The centroid of a triangle is the intersection of its three medians (lines connecting each vertex to the midpoint of the opposite side). It lies at ⅓ of the way from each side.
Centroid of a Set of Points
When you have a discrete set of points — not a filled area — the centroid is simply the average of all coordinates:
- Sum all x-coordinates and divide by the number of points to get Gₓ.
- Sum all y-coordinates and divide by the number of points to get Gᵧ.
This calculator supports up to 10 points in this mode.
Centroid of a Polygon
For a filled polygon — such as a rectangle, trapezoid, pentagon, or any closed shape — the centroid is calculated using the shoelace formula (also known as the surveyor's formula):
A = ½ · |Σ(xᵢ · yᵢ₊₁ − xᵢ₊₁ · yᵢ)| Gₓ = 1/(6A) · Σ(xᵢ + xᵢ₊₁)(xᵢ · yᵢ₊₁ − xᵢ₊₁ · yᵢ) Gᵧ = 1/(6A) · Σ(yᵢ + yᵢ₊₁)(xᵢ · yᵢ₊₁ − xᵢ₊₁ · yᵢ)
where the sums run from i = 1 to n (with vertex n+1 = vertex 1), and A is the signed area of the polygon.
Centroid of a Rectangle
For a rectangle with corners (x₁, y₁) and opposite corner (x₂, y₂), the centroid is simply the geometric center:
Gₓ = (x₁ + x₂) / 2 Gᵧ = (y₁ + y₂) / 2
Centroid of a Trapezoid
For a trapezoid with parallel sides of length a (top) and b (bottom) and height h (both sides horizontal):
Gᵧ = h/3 · (2a + b)/(a + b) (from the base)
Enter the four trapezoid vertices in order using the Polygon mode of this calculator for a precise result.
How to Use This Centroid Calculator
- Choose the mode — Set of Points for a discrete point cloud, or Polygon for a filled closed shape.
- Select the unit system — metric (mm, cm, m, km) or US imperial (in, ft, yd, mi).
- Set the number of points/vertices — from 2 to 10.
- Enter the coordinates — X and Y values for each point or vertex. Negative values are accepted.
- Click Calculate Centroid to instantly get the result.
Tip for Polygon mode: enter vertices in order (clockwise or counter-clockwise). If all points are collinear, the calculator automatically falls back to the arithmetic-mean formula.
FAQs
- Can the centroid lie outside the shape?
- Yes — for concave shapes (like an L-shaped figure or a crescent) the centroid can fall outside the boundary of the shape. For convex shapes it always lies inside.
- Is the centroid the same as the center of mass?
- For a two-dimensional shape of uniform density, yes. If the density varies across the object, you need a weighted centroid formula.
- What is the centroid of a circle?
- The centroid of a circle (or any regular shape with rotational symmetry) is its geometric center — the point equidistant from all boundary points.
- Does the order of polygon vertices matter?
- Yes — for the polygon centroid formula to give the correct result, the vertices must be listed in consistent order (all clockwise or all counter-clockwise). Random ordering will produce an incorrect area and wrong centroid.
- What units does this calculator use?
- The calculator accepts any numeric coordinate values. The unit label (m, cm, ft, in, etc.) is used only for display and does not change the calculation.