Calculate the centroid (center of mass) for various 2D and 3D shapes. Supports 15+ shape types with visualization and export options.
The centroid (also known as the geometric center or barycenter) is the arithmetic mean position of all the points in a shape. For objects with uniform density, the centroid coincides with the center of mass. It is a fundamental concept in mathematics, physics, and engineering.
For a polygon, the centroid is calculated using the shoelace integration formula. For continuous shapes like circles or ellipses, we use standard integral calculus. This tool applies these exact formulas to give you precise, reliable results.
General Polygon Centroid (Shoelace):
A = ½ ∑ (xᵢ yᵢ₊₁ – xᵢ₊₁ yᵢ)
Gₓ = (1/(6A)) ∑ (xᵢ + xᵢ₊₁)(xᵢ yᵢ₊₁ – xᵢ₊₁ yᵢ)
Gᵧ = (1/(6A)) ∑ (yᵢ + yᵢ₊₁)(xᵢ yᵢ₊₁ – xᵢ₊₁ yᵢ)
The concept of the centroid dates back to Archimedes (c. 287–212 BC), who studied centers of gravity. The term "centroid" was coined in the 19th century, but the properties of triangle medians were known to Euclid. The centroid is one of the four classic triangle centers (along with the orthocenter, circumcenter, and incenter) and plays a key role in Euler's line.
In modern times, centroid calculations are vital in structural engineering (neutral axis of beams), computer graphics (mesh optimization), robotics (stability analysis), and GIS (polygon labeling).
| Shape | Centroid (relative to given origin) | Key Parameters |
|---|---|---|
| Rectangle | (x + w/2, y + h/2) | Corner (x,y), width w, height h |
| Triangle | ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3) | 3 vertices |
| Circle | (cx, cy) | Center (cx,cy), radius r |
| Ellipse | (cx, cy) | Center (cx,cy), semi-axes a, b |
| Semicircle | (cx, cy + 4r/(3π)) | Base center (cx,cy), radius r, direction |
| Quarter Circle | (cx + 4r/(3π), cy + 4r/(3π)) | Corner (cx,cy), radius r |
| Parabola | (x₀ + 3b/4, y₀ + 3h/10) | Base b, height h, origin (x₀,y₀) |
| Circular Sector | (cx + R·sin(θ/2)·(2/(3θ/2)), cy + ... ) | Center, radius R, angle θ (rad) |
| Polygon | Integration (shoelace) | List of vertices (≥3) |
| Composite | Weighted average of components | Centroid & area of each sub-shape |