Loading…

Centroid of Polygon Calculator

Math Geometry • Coordinate Geometry

View all topics

Compute the centroid of a triangle or a simple polygon from its vertices. Choose between the filled-area centroid (shoelace-based) and the vertex-average centroid.

Pan/zoom/rotate on the diagram: drag = pan • wheel/pinch = zoom • right-drag or Shift + wheel or two-finger twist = rotate.

Vertices
Tip: keep vertices in order around the boundary
# x y

For a triangle, the centroid is always the average of its three vertices (same as the filled-area centroid). For general polygons, the area centroid and vertex-average are usually different.

Graph options

The plot uses square units (same scale on x and y).

Ready
Enter vertices and click Calculate.
Centroid diagram (square units • pan/zoom/rotate)

Drag = pan • wheel/pinch = zoom • right-drag / Shift+wheel / two-finger twist = rotate • “Reset view” fits geometry.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What is the difference between the filled polygon centroid and the vertices average centroid?

The filled polygon centroid treats the shape as a uniformly filled region and uses shoelace-based area weighting, while the vertices average centroid is simply the mean of the vertex coordinates. For triangles, both definitions give the same centroid.

How do I enter vertices for the centroid of a polygon calculator?

Enter vertices in the table or paste a list with one vertex per line as x, y pairs. Vertices should be listed in order around the polygon boundary to represent the intended shape correctly.

Do I need to repeat the first vertex at the end to close the polygon?

No. The polygon is treated as closed for computation and drawing by connecting the last vertex back to the first, so repeating the first vertex is unnecessary.

Why is the filled-area centroid undefined for some inputs?

If the polygon’s signed area is near zero (for example, points are collinear or nearly collinear), the area centroid formula divides by the area and becomes unstable or undefined. In those cases, the vertex-average centroid remains defined as long as at least one vertex is provided.

What formula is used for the filled polygon centroid?

For vertices (xi, yi) with (x(n+1), y(n+1)) = (x1, y1), the signed area is A = 0.5 * sum(i=1..n) (xi*y(i+1) - x(i+1)*yi). The centroid uses xbar = (1/(6A)) * sum (xi + x(i+1))*(xi*y(i+1) - x(i+1)*yi) and ybar = (1/(6A)) * sum (yi + y(i+1))*(xi*y(i+1) - x(i+1)*yi).