How to Calculate the Centroid

In Fundamentalsby Tom Ormonde22 Comments

In this post we will explore the centroid, it will be full of information in text, equations and pictorial forms with examples that are solved step by step to help you understand and apply equations to calculate the centroid of a shape and the first moment of area and most importantly, why we need too!

What is the Centroid?

To put it very simply, the centroid is the centre of a shape, such as in a 2×2 square, the centroid of the co-ordinates would be (1, 1). For a shape such as a square it is very easy to find the centroid with simple mathematics, or just through looking at it. However, when we have composite shapes, (two shapes together), or even just more complex shapes in general, the easiest, fastest and most efficient way to calculate the centroid is using an equation.

Being able to calculate the centroid is extremely important for the structural analysis of members, it is involved in the various calculations for different section properties, thankfully, it is really easy to calculate!

How Do We Calculate the Centroid?

The formula for the centroid is given below, don’t worry if it looks overly complicated, following a breakdown of the variables will we go through a very basic example and it will all make sense. Then we will look at more complex composite shape, after which you will be finding centroids of shapes in your sleep!

Centroid Formula

X̄*A = ∑(Xi*Ai)


ȳ*A = ∑(Yi*Ai)

Here is the breakdown of the variables in the equation for the X-Axis centroid,  
X̄ = The location of the centroid in the X Axis
A = The total area of all the shapes
Xi = The distance from the datum or reference axis to the centre of the shape i
Ai = The area of shape i.

Lets Find the Centroid – Ex. 1

Below is a rectangle, our aim, to find the co-ordinates of the centroid. To help follow through the example the datum or reference axis (Xo & Yo) is put onto the drawing and therefore we should have the same Xi and Yi values.

Centroid Shape - Example 1

Centroid Shape – Ex. 1

First thing to note in the example is there is only one shape, we will call this shape 1. To solve the centroid we look at each axis separately, the answers to each provide the co-ordinates (Xi, Yi). Units are not relevant for the centroid.


X̄*A = X1*A1

So we break down the variables and calculate them step by step.

X̄ = Coordinate Location (Our Answer!) 
A  = 5 * 2 = 10
X1 = 2 / 2 = 1
A1 = 5 * 2 = 10

Putting it altogether..

X̄ * 10 = 1 * 10
X̄ = 1


ȳ * A = y1 * A1

ȳ = Coordinate Location (Our Answer!) 
A  = 5 * 2 = 10
y1 = 5 / 2 = 2.5
A1 = 5 * 2 = 10

Putting it all together..

ȳ * 10 = 2.5 * 10
ȳ = 2.5

Below is the solution, shown graphically with the co-ordinates (X̄  ,ȳ)   of the centroid of the 5×2 rectangle. Simple right? Now lets try a composite shape, which is slightly more complicated.

Centroid Solution - Example 1
Ex.1 Solution

Complex Centroid – Ex.2

Below is a composite shape made up of a square and a rectangle, our aim, to find the co-ordinates of the centroid. Once again to help you follow through the example, the datum or reference axis (Xo & Yo) is put onto the drawing and therefore we should have the same Xi and Yi values.

Centroid Composite Shape - Example 2
Composite Shape Centroid Example

With composite shapes, we need to split the shape into individual shapes (sub-shapes, if you like). From this we can then apply the formulas as above to calculate X-bar and Y-bar for the co-ordinates of the centroid. We need to ensure that the distance from the datum to the centre of the shape runs through all of the composite shape. In this example, we need to split the shape in two different ways. It may sound confusing but with a few pictures it’ll be clear as rain.


Lets tackle the X axis first. To split it into sub-shapes and ensure that the Xi line follows through both, the solution is given below.

Composite shape made into two sub-shapes. Example 2
Ex.2 – X Axis Subshapes

To make it clearer which to solve for, using the equations, below is the shapes separated. As you become more comfortable, you can do this mentally.

Individual Shapes - Example 2
Ex.2 – X-Axis Shapes

Now using the original equation, we can split Xi and Ai according to both shapes, this lets us calculate the area of each shape (A1 and A2). Remember A in the first part of the equation for the whole composite shape!

To calculate X1 and X2 we have to look at the whole shape, as this is the distance between the centroid of A1 or A2 and the datum that we set, X0. See below.

Calculation X1 and X2 - Example 2

Ex.2 – X-Axis Distance to Datum

X̄*A = ∑(Xi*Ai)


X̄*A = (X1 * A2) + (X2 * A2)

X̄ =  Coordinate Location (Our Answer!) 
A  = (1 * 1) + (3 * 1) = 4
X1 = 1 / 2 = 0.5
A1 = 1
X2 = 1+ (1/ 2) = 1.5
A2 = 1 * 3 = 3

X̄ * 4 = 0.5 * 1  + 1.5 * 3
X̄ = 1.25


Now we tackle the Y-Axis, to do this we need to split the shape up into different sub-shapes to have a continuous axis running through the whole shape. 

Ex.2 – Y Axis Subshapes

Now repeating the same method as completed for the X-axis, we can break the shapes apart to calculate the area. 

Ex.2 – X-Axis Shapes

Before going ahead, see if you can calculate Y1 and Y2 for both shapes.

Calculation Y1 and Y2 - Example 2
Ex.2 – Y-Axis Distance to Datum

ȳ =  Coordinate Location (Our Answer!)
A  = (1 * 2) + (2 * 1) = 4
Y1 = 1 / 2 = 0.5
A1 = 1 * 2 = 2
Y2 = 1+ (2 / 2) = 2
A2 = 1 * 2 = 2

ȳ * 4 = (0.5 * 2) + (2 * 2)
ȳ = 1.25

Putting both X-bar and Y-bar together, we get the co-ordinates of (1.25, 1.25) for the centroid of the composite shape.

Centroid Solution - Example 2
Ex.2 Solution

Video Example

So, this concludes the end of the tutorial on how to calculate the centroid of any shape. You will find out how useful and powerful knowing how to calculate the centroid can be, in particular when assessing the shear capacity of an object using the first moment of area.

I hope you found this post useful, if you have any other questions please leave a comment. Further more, if you have any questions about this site, or in general, please get in touch via the contact form.

Subscribe to our mailing list
* indicates required


  1. Hi friends, how is the whole thing, and what you desire to
    say on the topic of this post, in my view its genuinely remarkable
    designed for me.

  2. I’m pretty pleased to uncover this web site. I need to to thank
    you for your time for this particularly fantastic read!!
    I definitely loved every part of it and I have you saved as a favorite to see
    new information in your web site.

  3. Hi there, You have done a great job. I’ll definitely digg it and
    personally recommend to my friends. I’m confident they will be benefited from this website.

  4. It’s really a nice and helpful piece of information. I’m glad
    that you simply shared this useful info with us. Please keep us informed like this.
    Thank you for sharing.

  5. Simply wish to say your article is as astounding.
    The clearness to your put up is simply excellent and i could
    think you are an expert in this subject. Fine with your
    permission allow me to snatch your RSS feed to keep updated with coming near near
    post. Thank you a million and please carry on the gratifying

  6. I’m impressed, I must say. Rarely do I encounter a blog that’s both equally educative
    and entertaining, and let me tell you, you’ve hit
    the nail on the head. The problem is an issue that too few
    people are speaking intelligently about. Now i’m very happy
    I found this in my search for something relating to this.

  7. Nice blog here! Also your web site loads up very fast!
    What web host are you using? Can I get your affiliate link to your host?
    I wish my site loaded up as quickly as yours lol

  8. I enjoy, result in I found exactly what I used to be taking a look for.

    You’ve ended my four day lengthy hunt! God
    Bless you man. Have a great day. Bye

  9. wonderful issues altogether, you just gained a new reader.
    What would you suggest about your submit that you just made some days ago?
    Any positive?

  10. I do not know whether it’s just me or if perhaps everybody else encountering issues with your blog.
    It seems like some of the text on your posts are running off the
    screen. Can somebody else please provide feedback and let
    me know if this is happening to them as well? This could be a issue with my
    internet browser because I’ve had this happen previously.

  11. My family members all the time say that I am wasting my time here
    at net, except I know I am getting experience every day by
    reading thes good articles or reviews.

  12. Nice weblog right here! Additionally your web site rather a lot up very fast!
    What host are you using? Can I am getting your associate link for your host?
    I desire my website loaded up as quickly as yours lol

  13. Thank you for another wonderful post. The place else may
    anyone get that type of information in such a perfect means of writing?
    I’ve a presentation subsequent week, and I’m on the look for such information.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.