Calculate the centroid (geometric center) of triangles, polygons, or point clouds. Essential for engineering, physics, and computer graphics.
Last updated: April 2026 | By Patchworkr Team
The centroid is the geometric center or "center of mass" of a shape, assuming uniform density. It's the point where the shape would balance perfectly if made of a uniform material.
Key properties:
Identify whether your shape is a triangle, polygon, or point cloud. Why: Different shapes use different mathematical approaches. Triangles have a simple averaging formula, polygons require area-weighted calculation (shoelace formula), and point clouds use simple coordinate averaging.
For triangles: collect (x₁,y₁), (x₂,y₂), and (x₃,y₃). For polygons: list all vertices in order (clockwise or counter-clockwise). For point clouds: collect all point coordinates. Why: Accurate input ensures accurate output. Polygon order matters for the shoelace formula (wrong order reverses the area sign but magnitude stays the same).
Why: Each formula corresponds to the shape's geometry. The triangle formula's simplicity reflects triangles' symmetry. The polygon formula's complexity ensures it accounts for non-uniform area distribution. Point cloud averaging is basic because order is irrelevant.
For triangles and polygons, calculate area using the shoelace formula: A = ½|Σ(xᵢyᵢ₊₁ - xᵢ₊₁yᵢ)|. Why: Area is needed for polygon centroid calculation (it's the normalizing factor in the denominator). It also validates your input—zero area means degenerate (collinear) points that don't form a proper shape.
Check that the computed centroid lies within (or very near) your shape. For triangles, it should always be inside. For polygons, it may be outside if the shape is concave. Verify units and precision. Why: This sanity check catches calculation errors. Understanding where the centroid should be helps you spot mistakes immediately, and confirming units ensures correct application to real-world problems (e.g., structural loading calculations).
Structural Engineering - Beam Center of Mass
Average the three vertices: Cx = (x₁+x₂+x₃)/3 and Cy = (y₁+y₂+y₃)/3. This point is where the three medians intersect.
For shapes with uniform density, yes. For non-uniform density or 3D objects, the center of mass may differ from the geometric centroid.
At the intersection of the three medians, 2/3 of the way from each vertex to the opposite side's midpoint.
Yes, for concave shapes. A crescent moon or L-shape can have a centroid in the empty space.
Break the shape into simpler pieces (triangles, rectangles), find each centroid, then compute the weighted average based on areas.
Centroid is the center of mass/area. 'Center' can mean different things: geometric center (average of bounds), circumcenter (equidistant from vertices), or incenter (center of inscribed circle).
It accounts for how area is distributed. Simple averaging of vertices only works for triangles; polygons need area-weighted calculation.
The formulas here are for 2D. For 3D, extend to volume integrals or decompose into simpler 3D shapes (tetrahedra, cubes).
Related Tools
Calculate cross-sectional area.
Calculate cylindrical coordinates.
Calculate direction vector.
Calculate distance between points.
Calculate point-to-plane distance.
Calculate dot product.