Centroid Calculator

Calculate the centroid of a triangle or polygon from vertex coordinates, with area, perimeter, interior angles, and polygon diagram.

About the Centroid Calculator

The centroid of a polygon is its geometric center — the point at which a uniform lamina of that shape would balance perfectly. For simple polygons, the centroid coordinates are calculated using integral formulas simplified by the Shoelace method, which operates directly on vertex coordinates without requiring calculus.

For a triangle with vertices (x₁, y₁), (x₂, y₂), (x₃, y₃), the centroid is simply the average of the vertices: ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3). For general polygons with more than three sides, the computation involves a weighted sum that accounts for the area contribution of each edge, using the same cross-product terms as the Shoelace area formula.

This calculator supports any simple polygon — from triangles to complex multi-sided shapes. Enter vertex coordinates in order and the tool instantly computes the centroid, area, perimeter, all side lengths, interior angles, bounding box dimensions, and whether the polygon is convex or concave. The interactive polygon diagram plots vertices as dots and marks the centroid in red.

Presets include a right triangle, equilateral triangle, square, L-shape, and regular pentagon. You can add or remove vertices freely to model any planar shape. The formulas reference table summarizes the mathematical foundations.

Engineers, architects, and students use centroid calculations for structural load analysis, balance point determination, moment-of-inertia computations, and computational geometry algorithms.

Why Use This Centroid Calculator?

Centroid calculations for polygons and irregular shapes require averaging vertex coordinates, and the signed-area (shoelace) formula for non-triangular polygons is notoriously easy to mis-index. This calculator handles triangles, rectangles, and arbitrary convex or concave polygons, computing the centroid instantly from vertex coordinates. It also shows the signed area, verifies vertex winding order, and plots the shape with its centroid marked — giving engineers, architects, and students a visual sanity check that hand calculation cannot easily provide.

How to Use This Calculator

  1. Select a preset or enter vertex coordinates manually.
  2. Add more vertices with the "+ Add Vertex" button for complex shapes.
  3. Read the centroid coordinates from the output cards.
  4. Check area, perimeter, and convexity in the results.
  5. View the polygon diagram with the centroid marked in red.
  6. Use the vertices table for side lengths and interior angles.

Formula

A = ½|Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ)|; Cx = (1/6A)Σ(xᵢ+xᵢ₊₁)(xᵢyᵢ₊₁−xᵢ₊₁yᵢ); Cy = (1/6A)Σ(yᵢ+yᵢ₊₁)(xᵢyᵢ₊₁−xᵢ₊₁yᵢ)

Example Calculation

Result: Centroid = (3.00, 1.67), Area = 15

A triangle with vertices at (0,0), (6,0), (3,5) has its centroid at the average: (9/3, 5/3) = (3.00, 1.67) and area = ½|6×5| = 15.

Tips & Best Practices

Centroid Formulas by Shape

For a triangle with vertices (x₁,y₁), (x₂,y₂), (x₃,y₃), the centroid is simply the arithmetic mean: ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3). For a general polygon with n vertices, the centroid uses the first moment of area divided by the signed area A = ½|Σ(xᵢ yᵢ₊₁ − xᵢ₊₁ yᵢ)|, with centroid coordinates weighted by the cross products of consecutive vertices. Rectangles and other symmetric shapes have their centroid at the intersection of lines of symmetry, but irregular polygons require the full shoelace-based computation. Getting the vertex winding order (clockwise vs. counterclockwise) right is essential — a sign error flips the area and shifts the centroid.

Centroids in Structural Engineering

In structural analysis, the centroid of a beam's cross-section is the neutral axis — the line where bending stress is zero. Axial loads applied through the centroid produce pure compression or tension with no bending moment. When the load is eccentric (off-centroid), the resulting bending moment M = P·e creates stress variations across the section. Engineers design columns and beams by first finding the centroid, then computing the second moment of area (moment of inertia) about centroidal axes. Composite sections (e.g., steel I-beam with a concrete slab) use the parallel axis theorem, which requires knowing each sub-section's centroid.

Centroid vs. Center of Mass vs. Center of Gravity

These three concepts coincide for a uniform-density body in a uniform gravitational field, but they differ in general. The centroid is a purely geometric property of a shape (area or volume). The center of mass accounts for varying density. The center of gravity accounts for a non-uniform gravitational field (important for very large bodies like moons). For most engineering applications the three are identical, but in aerospace and geophysics the distinctions matter. This calculator computes the geometric centroid; for variable-density bodies, use the center of mass calculator instead.

Frequently Asked Questions

What is a centroid?

The centroid is the geometric center of a shape — the average position of all points in the area. A uniform flat shape balances at its centroid.

How is the centroid of a triangle calculated?

For a triangle, the centroid is the average of all three vertex coordinates: ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3). Use this as a practical reminder before finalizing the result.

What is the Shoelace formula?

The Shoelace formula computes the area of a simple polygon from its vertex coordinates using cross products: A = ½|Σ(xᵢyᵢ₊₁ − xᵢ₊₁yᵢ)|. Keep this note short and outcome-focused for reuse.

Can the centroid be outside the polygon?

For concave (non-convex) polygons, yes. The centroid of an L-shape or crescent may lie outside the actual area.

Does vertex order matter?

Yes. Vertices must be listed in order (either clockwise or counterclockwise) for correct area and centroid calculations.

What is the difference between centroid and center of mass?

Centroid is the geometric center assuming uniform density. Center of mass accounts for varying density or discrete masses.

Related Pages