Centroid / Center of Mass Calculator

A canvas showing the selected shape drawn to scale with X-Y axes, dimension arrows, and a red crosshair at the centroid. Below the canvas, a calculation steps panel shows the full working line by line.


6 shapes available:

Single shapes (1 part):

  • Rectangle — centroid at b/2, h/2. The baseline case everyone should know.

  • Triangle — centroid at b/3, h/3 from the right-angle vertex. Most tested position.

  • Circle — centroid at center (r, r). Area = πr².

Composite shapes (2-3 parts, broken into rectangles):

  • L-shape — vertical web + horizontal flange. 2 rectangles. Centroid shifts toward the thicker section.

  • T-beam — wide top flange + narrow web below. 2 rectangles. Centroid sits higher than geometric center because the flange has more area.

  • I-beam — top flange + web + bottom flange. 3 rectangles. Symmetric, so centroid is exactly at center. The classic neutral axis position.

Visual details:

Each sub-shape is color-coded (blue, orange, purple) with light fill and part label at its local centroid

  • Small + marks show each part's individual centroid

  • The red crosshair circle with crossing lines shows the combined centroid

  • Dashed lines drop from centroid to both axes showing x̄ and ȳ

  • Dimension arrows with mm values on the right and bottom edges

  • The calculation bar below shows every step: each part's area, local centroids, summation, and final x̄ and ȳ with full arithmetic