The centroid of a geometric figure is its mean position: the point obtained by averaging the positions of all its parts, with each part weighted according to a specified geometric measure. For a finite collection of equally weighted points, it is the arithmetic average of their coordinates. For a uniform wire, planar region, or solid, the averaging is performed with respect to length, area, or volume. In geometry, the word usually implies uniform geometric weighting; its physical counterpart, the center of mass, allows material density to vary.
Centroids connect elementary constructions, such as the intersection of a triangle’s medians, with integration, mechanics, statistics, and computational geometry. They are preserved by affine transformations, characterize the point minimizing squared distances, and provide a natural reference for moments and shape measurements. The definition depends on what is being averaged: the vertices, boundary, and interior of the same figure generally have different centroids.
Definition and dependence on measure
For points in Euclidean space , their equally weighted centroid is
Each coordinate of is the arithmetic mean of the corresponding coordinates of the points. Thus the centroid of , , and is . More generally, positive weights give the weighted centroid
Multiplying every weight by the same positive constant leaves the centroid unchanged. The weights may represent masses, areas of component pieces, frequencies, or other quantities appropriate to the application.
A continuous definition uses measure theory. Let be a nonnegative measure on , with finite positive total measure
If the first absolute moment is finite,
its centroid is
The vector integral can be interpreted coordinate by coordinate. This formulation includes discrete point sets, continuous bodies, and mixtures of discrete and continuous distributions. The absolute-moment condition ensures that the answer is not dependent on an arbitrary order of integration or cancellation of divergent terms.
For a bounded measurable planar region of positive area , the area centroid is
The analogous formulas use volume for a solid and arc length for a curve. A region of zero area cannot be assigned an area centroid by these formulas, although it may have a centroid under another measure. A line segment, for example, has a length centroid at its midpoint even though its planar area is zero.
The choice of measure is essential, not a technical detail. For a triangle, averaging its three vertices gives the same point as averaging its entire area. Averaging its boundary by arc length generally gives another point. Likewise, a polygon’s vertex average changes if an extra vertex is inserted along an existing edge, whereas its area centroid does not. The centroid of a hollow hemispherical shell differs from that of the solid hemisphere with the same outer boundary. An unqualified reference to a figure’s “center” therefore requires attention to whether the intended object is a point set, a wire, a surface, or a filled region.
Affine structure, symmetry, and convexity
The centroid is fundamentally an affine construction. If is an affine map, then for any weighted point set,
The same identity holds for a continuous measure when that measure is transported by . Thus translation, rotation, reflection, scaling, and shear all carry a centroid to the centroid of the transported distribution. No preservation of angles or distances is required.
For an invertible affine transformation of a full-dimensional uniform region, the transported measure differs from uniform measure on the image only by a constant factor. That factor is the absolute value of the determinant of the linear part, and it cancels between the first moment and the total measure. Consequently, the area centroid of an ellipse is the image of the center of a disk under any invertible affine map producing that ellipse. A similar statement applies to parallelograms, parallelepipeds, and ellipsoids. For a curved wire, however, a shear can stretch different portions by different amounts. Transporting the original wire’s length measure is then not the same as assigning uniform length density to the transformed wire.
Symmetry frequently determines centroids without calculation. If reflection in a line preserves a planar distribution, the centroid lies on that line. If a bounded distribution is centrally symmetric about a point , its centroid is , because the contributions at and cancel relative to . A uniform regular polygon therefore has its centroid at its symmetry center. A semicircular region has its centroid on its symmetry axis, but symmetry alone does not determine its distance from the diameter.
With nonnegative weights, a finite centroid is a convex combination of the input points. It therefore belongs to their convex hull. More generally, the centroid of a finite positive distribution with a finite first moment lies in the closed convex hull of its support. One way to see this is through separating hyperplanes: a point strictly separated from the support cannot be its coordinate average in the separating direction.
Belonging to the convex hull does not mean belonging to the figure itself. The centroid of a uniform annulus is its central point, which lies in the hole. The centroid of a sufficiently bent or crescent-shaped region can likewise lie outside the material. For a full-dimensional convex body, by contrast, the centroid lies in its interior. These facts explain both the usefulness and the limitations of treating a centroid as a representative position: it respects affine structure and overall balance, but need not be an occupied or accessible location.
Triangles, simplices, and barycentric coordinates
In a triangle with vertex position vectors , the centroid is
The median from joins to the midpoint of the opposite side. Since
the centroid lies two-thirds of the way along that median from the vertex. The same expression applies cyclically to the other vertices, proving that all three medians meet at one point. Each median is divided in the ratio , with the longer segment adjacent to the vertex.
This intersection is also the area centroid, not merely the average of the vertices. One proof begins with a reference triangle and evaluates its first moments directly; every nondegenerate triangle is an affine image of that triangle. Another uses the fact that lines parallel to a side cut cross-sections whose midpoints lie on the corresponding median. Averaging these cross-sections places the area centroid on each median. The three medians also divide the triangle into six smaller triangles of equal area, reflecting the same balance of areas around their common intersection.
The centroid is one of several distinct triangle centers. The circumcenter is equidistant from the vertices, the incenter is equidistant from the sides, and the orthocenter is the intersection of the altitudes. These points generally do not coincide. In a non-equilateral triangle, the circumcenter , centroid , and orthocenter lie on the Euler line, named for Leonhard Euler, with
Thus . The centroid always lies inside a nondegenerate triangle, whereas the circumcenter and orthocenter can lie outside it.
The higher-dimensional analogue of a triangle is a simplex. If a -simplex has affinely independent vertices , its uniform volume centroid is
The segment from a vertex to the centroid of its opposite facet is divided by in the ratio , measured from the vertex. In a tetrahedron, for example, the centroid lies three-quarters of the way from each vertex toward the centroid of the opposite triangular face.
These formulas are naturally expressed through barycentric coordinates. A point in a simplex is written as
At the centroid, every coordinate equals . Nonnegative barycentric coordinates describe the simplex itself. Equal coefficients explain why the centroid treats all vertices symmetrically, while unequal coefficients describe weighted point centroids. This agreement between vertex average and uniform volume centroid is special to simplices and certain symmetric figures; it is not a general property of arbitrary polyhedra.
Integral calculations for curves, regions, and solids
Centroid calculations usually reduce to first moments evaluated by calculus. Suppose a planar region lies between and , with for . Its area and first moments are
The last expression follows because a thin vertical strip has its midpoint at height . This illustrates a general method: decompose the body into elements with known centroids, multiply each centroid coordinate by its measure, and integrate.
For a uniform semicircular region of radius above the horizontal diameter, symmetry gives . Using polar coordinates,
Hence
For the semicircular arc alone, the length is , and integration with respect to arc length gives
The arc centroid is farther from the diameter because all of its measure lies on the outer boundary rather than being distributed throughout the interior.
For a piecewise smooth parametrized curve , , the length centroid is
The speed factor is indispensable: averaging with respect to the parameter alone describes a parameter-dependent distribution, not generally a uniform wire. Surface centroids similarly use surface area elements. For a parametrized surface , the area element is
This weighting corrects for the local distortion introduced by the coordinates.
Solids can often be handled by cross-sections. If sections perpendicular to the -axis have area , then
A solid cone or pyramid of height , with base in and apex in , has section areas proportional to , giving . A solid hemisphere of radius , measured from its flat face, has ; a uniform thin hemispherical surface has . These examples distinguish volume and surface centroids and show why a visually plausible center is not a substitute for specifying the measure.
Polygon formulas and computational methods
For a simple planar polygon with cyclically ordered vertices , let and define
Its signed area is
Provided , the area centroid is
Reversing the vertex order reverses the signs of both numerator and denominator, leaving the centroid unchanged. The calculation requires only a single traversal of the edges and therefore has linear running time in the number of vertices.
These formulas can be derived by decomposing the polygon into oriented triangles formed by each edge and a common reference point. When the reference point is the origin, each triangle has signed area and centroid
Adding their signed first moments gives the polygon formulas. The same identities follow from Green’s theorem, which converts area integrals into boundary integrals. Oriented cancellation makes the formulas valid for concave as well as convex simple polygons; the reference point need not lie inside the polygon.
Regions with holes can be handled by giving outer and inner boundary rings opposite orientations, or by explicitly subtracting the areas and moments of the holes. More generally, if component regions have areas and centroids , then
where removed regions carry negative signed areas in this bookkeeping convention. Overlapping components require an actual partition or an inclusion–exclusion calculation; simply adding overlapping areas counts the overlap more than once. For self-intersecting polygonal paths, signed boundary formulas describe algebraic area and moments, which may differ from those of a filled region defined by a particular graphical filling rule.
Practical implementations must account for floating-point arithmetic and numerical stability. Large coordinate offsets combined with a small polygon area can cause severe cancellation in the cross-products. Translating the coordinates to a nearby reference point before accumulation, using compensated summation, or employing higher precision can reduce error. If the signed area is zero, the area-centroid formula is undefined; a segment or polyline centroid must instead be calculated using length.
For a triangulated surface, its surface centroid is the area-weighted average of triangle centroids. For a solid represented by a consistently oriented, closed triangular boundary, signed tetrahedra formed with a reference point provide corresponding volume and first-moment formulas. These procedures assume that the mesh represents the intended geometry: holes, inconsistent orientations, duplicate faces, and self-intersections can change the computed result or make its physical interpretation invalid.
Balance, moments, and geometric mechanics
The physical interpretation of the centroid arises from the mass distribution of a body. If a region has constant density, its center of mass coincides with its geometric centroid because the density factor cancels from the defining ratio. With variable density ,
and the center of mass need not coincide with the volume centroid. A geometrically symmetric object can therefore have an asymmetric mass distribution. The distinction is important in mechanics, where the relevant averaging measure is mass rather than geometric volume.
In a uniform gravitational field , the total torque about a point is
The distributed gravitational force consequently has the same net force and torque as a single force applied at the center of mass. This gives a suspension method for locating the centroid of a uniform planar lamina: when freely suspended in equilibrium, its center of mass lies on the vertical line through the suspension point. Suspending it from two distinct points produces two such lines whose intersection identifies the centroid. The interpretation assumes a sufficiently uniform gravitational field; a general spatially varying field need not have the same simple representation.
The centroid also makes first moments vanish:
This identity is the basis of the parallel-axis theorem. For a unit vector , define the second moment about the hyperplane through normal to by
Expanding around the centroid gives
because the cross term contains the vanishing first moment. In three-dimensional mechanics, the corresponding theorem for the moment of inertia about parallel axes is , where is the perpendicular distance between the axes. Area moments used in structural analysis obey the analogous relation with area replacing mass.
The Pappus centroid theorems relate centroids to solids of revolution. Under the usual nonintersection conditions, rotating a plane curve of length about a coplanar axis produces surface area
where is the distance from the curve’s length centroid to the axis. Rotating a planar region of area gives volume
where now refers to its area centroid. Rotating a disk of radius , whose center is distance from the axis, gives a torus of volume . These theorems can also be used in reverse, determining a centroid from a known surface area or volume.
Probability, least squares, and clustering
After normalization by its total measure, a positive distribution becomes a probability distribution. Its centroid is then its expected value. If a random vector has finite first absolute moment,
A uniform random point in a bounded region has expectation equal to the region’s geometric centroid. For observed points , their centroid is the sample mean. This connection permits geometric identities to be expressed probabilistically and statistical quantities to be understood as moments about a geometric center.
When the second moment is finite, the centroid uniquely minimizes the expected squared Euclidean distance. For any point ,
The cross term vanishes because . For weighted finite data, the corresponding decomposition is
Thus the centroid is the optimal single representative under squared-distance loss. The choice of loss is crucial: it is not generally the point minimizing the unsquared sum of distances.
This property underlies k-means clustering, a method of cluster analysis. Given a fixed assignment of observations to a cluster, the center minimizing the within-cluster sum of squared Euclidean distances is that cluster’s centroid. Lloyd’s algorithm alternates between assigning observations to nearest centers and replacing each center with the mean of its assigned observations. Each ordinary assignment or update step does not increase the objective, but the algorithm can stop at a local optimum rather than a global one. The method also requires a rule for clusters that receive no observations.
The centroid depends on scale and is sensitive to extreme observations. Adding one point to observations with centroid changes the centroid to
The displacement grows without bound as moves arbitrarily far away. A geometric median, by contrast, minimizes the sum of unsquared Euclidean distances and generally does not equal the centroid. It has no comparable coordinate-average formula in arbitrary dimension. These different centers answer different optimization questions rather than offering interchangeable definitions.
Centering data at their centroid is also the first step in forming a covariance matrix. For a random vector,
The matrix describes second-order spread around the mean. In principal component analysis, its eigenvectors identify directions of maximal variance through the centroid. In mechanics, related second-moment matrices determine principal inertia axes. The shared algebra reflects the common operation of first removing the mean position and then measuring how the remaining distribution spreads around it.
Images, spatial data, and numerical models
In a digital image, a centroid can describe either a selected region or an intensity distribution. If pixel centers have coordinates and nonnegative weights , the raw image moments are
Provided , the centroid is
For a binary image with equal-area pixels, this is the centroid of the selected pixel centers and also of the union of their full pixel cells. For a grayscale image, it is an intensity-weighted centroid, which may shift with lighting, background subtraction, or detector response even when the object’s geometric outline does not change.
Central image moments replace and by and . Their construction removes dependence on translation, making them useful for shape description and orientation estimation. A centroid alone, however, contains no information about topology, elongation, or boundary detail: a ring, disk, and pair of separated equal components can share the same centroid. Image-based tracking therefore often combines centroid location with area, second moments, and other features. If background correction introduces negative pixel values, the resulting ratio is a signed moment calculation and no longer necessarily lies in the image region’s convex hull.
In geographical information systems, polygon centroids are used to summarize land parcels, administrative regions, and other spatial objects. A centroid of a disconnected region may lie between its components, and one of a concave region may lie outside its boundary. Label-placement systems therefore often use an interior representative point rather than the mathematical centroid. Coordinate choice also matters: averaging longitude and latitude directly treats angular coordinates as if they formed a flat Cartesian plane. Map projections distort area, while longitude has a discontinuity at the antimeridian. Consequently, a planar projected centroid, an embedded spherical average, and an intrinsic surface mean represent different constructions.
In the finite element method, simplicial centroids have a direct integration role. If is affine on a -simplex , then
where is its volume centroid and its -dimensional volume. This follows because an affine function commutes with averaging. Evaluation at the centroid therefore gives an exact one-point quadrature rule for affine integrands, although not for general quadratic or higher-degree functions.
Centroids also appear in mesh generation and finite-volume models. In a centroidal Voronoi configuration, each generator coincides with the centroid of its Voronoi cell, often computed with a prescribed density. Such configurations connect spatial discretization to quantization and squared-distance optimization. Algorithms commonly alternate between constructing cells and moving generators to their centroids. Boundary constraints, nonuniform density, and curved geometry alter the centroid calculation, and convergence to a globally best configuration is not guaranteed by the averaging step alone.
Historical development and broader notions of a center
The study of centroids grew from ancient investigations of balance and centers of gravity. Archimedes, who lived approximately from 287 to 212 BCE, treated equilibrium and centers of gravity in On the Equilibrium of Planes. His work connected geometrical propositions with mechanical reasoning about weights and lever arms, including results for triangles and parabolic segments. In this setting, what is now called an area centroid was interpreted through the equilibrium of an ideal uniform lamina. The historical language of centers of gravity therefore overlaps with, but is not identical to, the modern measure-based definition.
Pappus of Alexandria, active in the fourth century CE, recorded the centroid theorems for surfaces and solids of revolution in his Collection. Paul Guldin later discussed the same principles in the seventeenth century, giving rise to the alternative name “Pappus–Guldinus theorems.” The development of analytic geometry and calculus supplied systematic coordinate and integral methods for calculating first moments. Modern measure theory subsequently placed discrete, continuous, and mixed distributions within one definition, while the language of expectation linked the geometric center to probability.
The term barycenter, originating in the language of weights and balance, is often used for a weighted centroid. In affine geometry, a finite barycenter needs only the ability to form an affine combination; distances and angles are unnecessary. Some algebraic uses permit negative weights, provided their sum is nonzero. The resulting point can lie outside the convex hull, and cancellation can make the denominator vanish. Such signed constructions are useful, but their properties differ from those of centroids formed with nonnegative geometric or mass measures.
On a general manifold or metric space, points cannot necessarily be added or divided by a number. One extension is the Fréchet mean, defined as a minimizer of
In Euclidean space with a finite second moment, this reproduces the ordinary centroid. In curved spaces, a minimizer may fail to be unique, and existence depends on the space and distribution. Curvature and the location of the data affect uniqueness; a symmetric distribution on a sphere can have multiple minimizing points.
An alternative is to embed a curved space in Euclidean space, compute the ambient centroid, and then project or normalize it back onto the space. This produces an extrinsic rather than intrinsic mean. For unit vectors on a sphere, normalizing gives an extrinsic directional mean when the sum is nonzero. If two antipodal observations have equal weight, the sum is zero and normalization is undefined. Their intrinsic squared-distance means form the equator perpendicular to the antipodal axis, illustrating nonuniqueness in a different construction. Neither construction is identical to averaging coordinate labels such as latitude and longitude; each specifies a distinct geometric meaning for “center.”