Centroid Calculator
Free centroid calculator: find the centroid (geometric center) of triangles, rectangles, composite shapes, and point set
Calculator
Your Results
Enter your values and click Calculate to see results
How the Centroid Calculator Works
The centroid calculator finds the geometric center (centroid) of a shape — the point where the shape would balance if supported at that single point. For uniform density objects, the centroid is also the center of mass. The centroid coordinates (x̄, ȳ) are calculated by averaging all points in the shape weighted by area.
For a set of discrete points: x̄ = Σ(xᵢ × Aᵢ) / ΣAᵢ; ȳ = Σ(yᵢ × Aᵢ) / ΣAᵢ, where xᵢ, yᵢ are coordinates of each sub-shape's centroid and Aᵢ is its area. For a solid triangle with vertices (x₁,y₁), (x₂,y₂), (x₃,y₃): centroid = ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3) — the average of the three vertex coordinates.
Centroid of Common Shapes
Centroid locations for standard geometric shapes (measured from a reference corner or center):
- Rectangle (width w, height h): Centroid at (w/2, h/2) from corner. Always at the geometric center.
- Triangle (base b, height h): Centroid at (base/2, h/3) from base — 1/3 of height from base, 2/3 from apex. For vertices: average of all three vertex coordinates.
- Circle (radius r): Centroid at geometric center (0, 0) by symmetry.
- Semicircle (radius r): Centroid at 4r/(3π) from the diameter. For r = 1: ȳ ~ 0.424r from the flat edge.
- Right triangle (base b, height h): Centroid at (b/3, h/3) from the right angle vertex.
- Trapezoid (parallel sides a and b, height h): ȳ = h(2b+a)/(3(a+b)) from the base of length b.
- Quarter circle (radius r): Both x̄ and ȳ = 4r/(3π) from the center of the full circle.
- Parabolic segment: 3/5 of height from base.
Centroid of Triangle Calculator — Step-by-Step
The centroid of a triangle is always located at 1/3 of the median from each side (or 2/3 from each vertex). For triangle with vertices A(1, 2), B(5, 4), C(3, 8):
- x̄ = (x_A + x_B + x_C) / 3 = (1 + 5 + 3) / 3 = 9/3 = 3
- ȳ = (y_A + y_B + y_C) / 3 = (2 + 4 + 8) / 3 = 14/3 ~ 4.667
- Centroid = (3, 4.667)
The three medians of any triangle always intersect at the centroid — a fundamental property of triangles. This is also called the "center of gravity" of a uniform triangular plate. The centroid divides each median in the ratio 2:1 (from vertex to opposite midpoint).
Centroid of Composite Shapes (L-Shape, T-Shape, etc.)
For complex shapes made of simpler sub-shapes, find each sub-shape's centroid and area, then take the weighted average:
Example: L-shaped cross-section made of two rectangles. Rectangle 1: 4" × 1" (vertical part). Area₁ = 4 in2. Centroid₁ = (0.5, 2) from bottom-left corner. Rectangle 2: 3" × 1" (horizontal base). Area₂ = 3 in2. Centroid₂ = (1.5, 0.5) from bottom-left corner.
- Total area = 4 + 3 = 7 in2
- x̄ = (Area₁ × x₁ + Area₂ × x₂) / Total area = (4 × 0.5 + 3 × 1.5) / 7 = (2 + 4.5) / 7 = 6.5 / 7 ~ 0.929"
- ȳ = (4 × 2 + 3 × 0.5) / 7 = (8 + 1.5) / 7 = 9.5 / 7 ~ 1.357"
- Centroid of L-shape ~ (0.929", 1.357") from bottom-left corner
For composite shapes with holes (subtractive areas), treat the hole as a negative area: subtract (area × centroid_coordinate) for the hole from the total. This is the composite area method used extensively in structural engineering for calculating section properties like moment of inertia.
Applications of Centroid in Engineering and Physics
- Structural engineering: The centroid of a cross-section is used to calculate the neutral axis — the line about which a beam neither stretches nor compresses under bending loads. Stress distribution in beams depends on distance from the neutral axis (centroid).
- Moment of inertia: Area moments of inertia (second moments of area) are calculated about the centroidal axis using the parallel axis theorem: I = Ī + Ad2, where Ī is centroidal moment of inertia and d is the distance from centroid to the new axis.
- Fluid mechanics: The center of pressure on a submerged surface is below the centroid (for non-horizontal surfaces) — critical for designing dam gates and underwater structures.
- Computer graphics: Centroid calculations determine the pivot point for rotation and scaling of polygons; collision detection uses centroid as a reference point.
- Robotics and balance: Calculating the center of mass of a robot or vehicle determines stability and balance point — critical for bipedal robots and autonomous vehicles.
Centroid vs. Center of Mass vs. Center of Gravity
These three concepts are often used interchangeably but have precise distinctions:
- Centroid: Purely geometric concept — the average position of all points in a shape. Depends only on shape, not on density or gravity.
- Center of mass: The weighted average position of all mass elements. For uniform density objects, center of mass = centroid. For non-uniform density, they differ.
- Center of gravity: The point where gravity acts on an object — equal to center of mass in a uniform gravitational field (like on Earth's surface). They differ only in non-uniform gravitational fields (like at different altitudes or near massive objects).
Frequently Asked Questions
What is the centroid of a triangle formula?
For a triangle with vertices (x₁,y₁), (x₂,y₂), (x₃,y₃): Centroid = ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3). This is simply the arithmetic mean of the three vertex coordinates. The centroid is located at 1/3 of the height from the base and always inside the triangle (unlike the orthocenter or circumcenter, which can be outside for obtuse triangles).
How do you find the centroid using integration?
For a region bounded by f(x) on [a,b]: x̄ = (1/A) × ∫[a to b] x × f(x) dx; ȳ = (1/A) × ∫[a to b] 1/2 × [f(x)]2 dx, where A = ∫[a to b] f(x) dx is the area. For example, the centroid of the region under y = x2 on [0,1]: A = ∫[0 to 1] x2 dx = 1/3. x̄ = 3 × ∫[0 to 1] x3 dx = 3 × 1/4 = 3/4. ȳ = 3 × ∫[0 to 1] 1/2x⁴ dx = 3 × 1/10 = 3/10.
What is the centroid of a semicircle?
For a semicircle of radius r with the flat edge along the x-axis: x̄ = 0 (by symmetry); ȳ = 4r/(3π) ~ 0.4244r from the diameter. For r = 6": ȳ = 4(6)/(3π) = 8/π ~ 2.546". This value is used extensively in structural engineering for T-sections and flanged beams with semicircular components.
How is centroid used in structural engineering?
The centroid of a beam's cross-section defines the neutral axis — the axis about which bending stress is zero. Bending stress at any point = M × y / I, where M is bending moment, y is distance from centroid, and I is moment of inertia about the centroidal axis. Maximum stress occurs at the top and bottom fibers (maximum y). This is why I-beams are efficient — they concentrate material far from the centroid where stress is highest, maximizing moment of inertia for a given area.