# Where is the centroid?

Finds the centroid of a triangle or any set of points (with optional masses), or the centroid of a polygon’s area from its vertices, with the working.

- Page: https://www.acalculator.org/math/centroid-calculator
- JSON spec: https://www.acalculator.org/math/centroid-calculator.json
- Version: 8076b6742cee

## Default answer

Example with the default inputs (Find the centroid of Triangle or points, Points [x 0, y 0; x 6, y 0; x 0, y 3]): The centroid is at (2, 1).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| mode | Find the centroid of | The points themselves (a triangle’s vertices, or point masses) or the area inside a polygon. |
| points | Points | The points or vertices in order around the shape, up to 20. A mass applies to points only. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| centroid | Centroid | The centroid (x̄, ȳ). |
| cx | x̄ | The x coordinate of the centroid. |
| cy | ȳ | The y coordinate of the centroid. |
| area | Polygon area | The area inside the polygon, from the shoelace formula (polygon only). |
| steps | Working | The sums and the division. |

## Method

Points: x̄ = Σmx ÷ Σm, ȳ = Σmy ÷ Σm (m = 1 when no mass is typed). Polygon: A = ½Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ), x̄ = Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A, ȳ = Σ(yᵢ + yᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A.

## Assumptions

- A triangle’s centroid is the same as the centroid of its three vertices with equal masses.
- Polygon vertices are typed in order around the outline (either direction), and the outline does not cross itself.
- Typed decimals are read exactly; each result is rounded once.

## Worked examples

1. mode = points, points = {"x":-1,"y":3,"m":2} or {"x":1,"y":1,"m":6} gives centroid = (1, 0.3333333333), cx = 1, cy = 0.333333. Source: OpenStax, Calculus Volume 2, §2.6 Moments and Centers of Mass (x̄ = My ÷ m, ȳ = Mx ÷ m for point masses; Example 2.30: 2 kg at (−1, 3), 6 kg at (1, 1) and 4 kg at (2, −2) balance at (1, 1/3)), https://openstax.org/books/calculus-volume-2/pages/2-6-moments-and-centers-of-mass (retrieved 2026-10-05).
2. mode = points, points = {"x":0,"y":0} or {"x":6,"y":0} gives centroid = (2, 1). Source: OpenStax, Calculus Volume 2, §2.6 Moments and Centers of Mass (x̄ = My ÷ m, ȳ = Mx ÷ m for point masses; Example 2.30: 2 kg at (−1, 3), 6 kg at (1, 1) and 4 kg at (2, −2) balance at (1, 1/3)), https://openstax.org/books/calculus-volume-2/pages/2-6-moments-and-centers-of-mass (retrieved 2026-10-05).
3. mode = polygon, points = {"x":0,"y":0} or {"x":6,"y":0} gives centroid = (2, 1), area = 9. Source: Wikipedia, Centroid, section "Of a polygon" (the shoelace area and Cx = (1 ÷ 6A)Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ)), https://en.wikipedia.org/wiki/Centroid#Of_a_polygon (retrieved 2026-10-05).
4. mode = polygon, points = {"x":0,"y":0} or {"x":4,"y":0} gives centroid = (1.5, 1), cx = 1.5, cy = 1, area = 6. Source: Wikipedia, Centroid, section "Of a polygon" (the shoelace area and Cx = (1 ÷ 6A)Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ)), https://en.wikipedia.org/wiki/Centroid#Of_a_polygon (retrieved 2026-10-05).

## FAQ

### How do I find the centroid of a triangle?

Average the three vertices: x̄ = (x₁ + x₂ + x₃) ÷ 3 and ȳ = (y₁ + y₂ + y₃) ÷ 3. The triangle (0, 0), (6, 0), (0, 3) has its centroid at (2, 1).

### Where is the centroid of a triangle on the medians?

The three medians (lines from each vertex to the middle of the opposite side) meet at the centroid. It lies two thirds of the way from each vertex to the middle of the opposite side.

### How do I find the center of mass of point masses?

Multiply each coordinate by its mass, add, and divide by the total mass: x̄ = Σmx ÷ Σm and ȳ = Σmy ÷ Σm. Masses of 2, 6 and 4 at (−1, 3), (1, 1) and (2, −2) balance at (1, 1/3).

### How do I find the centroid of a polygon?

Type the vertices in order around the outline. The page finds the area with the shoelace formula, A = ½Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ), then x̄ = Σ(xᵢ + xᵢ₊₁)(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ) ÷ 6A and ȳ the same way with y.

### Is the centroid of a polygon the average of its vertices?

Only for a triangle (and for shapes with enough symmetry, such as a rectangle). For an L shape with corners (0, 0), (4, 0), (4, 1), (1, 1), (1, 3), (0, 3), the vertex average is (1.67, 1.33), but the area centroid is (1.5, 1).

### What is the difference between the centroid and the center of mass?

The centroid is the geometric center of a shape. It equals the center of mass when the shape has the same density everywhere, or when every point has the same mass.

## Sources

- OpenStax, Calculus Volume 2, §2.6 Moments and Centers of Mass (x̄ = My ÷ m and ȳ = Mx ÷ m for point masses in a plane; Example 2.30), CC BY-NC-SA 4.0. https://openstax.org/books/calculus-volume-2/pages/2-6-moments-and-centers-of-mass (retrieved 2026-10-05)
- Wikipedia, Centroid, section "Of a polygon" (the shoelace area and the centroid sums for a non-self-intersecting closed polygon). https://en.wikipedia.org/wiki/Centroid#Of_a_polygon (retrieved 2026-10-05)
