×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Calculating the geometric centroid of a floor plan

Calculating the geometric centroid of a floor plan

Calculating the geometric centroid of a floor plan

(OP)
I have been struggling with this for a few days now. When I think I have a code that works for any possible geometric configuration, I find a flaw. You kind folks are my last resort.

I have two columns in my spreadsheet, for x and y values. The user inputs the following to create a square:

x,y

0,0
0,50
50,50
50,0
0,0

Then, I am trying to get my spreadsheet to find the centroid of this shape. Easy enough for a square, but my code needs to work for any possible configuration. For example, this configuration:

x,y

0,30        
0,120        
50,120        
50,155        
80,155        
80,180        
155,180        
155,155        
290,155        
290,120        
300,120        
300,19.3        
50,0        
0,30        

How can I find the centroid of the shape that the above would give me? I'm about to rip my hair out. Would appreciate any and all help. Thank you.

Clansman

If a builder has built a house for a man and has not made his work sound, and the house which he has built has fallen down and so caused the death of the householder, that builder shall be put to death." Code of Hammurabi, c.2040 B.C.

RE: Calculating the geometric centroid of a floor plan

(OP)
That is EXACTLY what I was looking for. I love you.

Have a GREAT weekend!

Clansman

If a builder has built a house for a man and has not made his work sound, and the house which he has built has fallen down and so caused the death of the householder, that builder shall be put to death." Code of Hammurabi, c.2040 B.C.

RE: Calculating the geometric centroid of a floor plan

(OP)
Now I have to reverse engineer his spreadsheet into mine. He is using VBA to calculate the centroid, I am wondering if there is an excel only solution out there?

Clansman

If a builder has built a house for a man and has not made his work sound, and the house which he has built has fallen down and so caused the death of the householder, that builder shall be put to death." Code of Hammurabi, c.2040 B.C.

RE: Calculating the geometric centroid of a floor plan

Why the aversion to VBA?

RE: Calculating the geometric centroid of a floor plan

If I am not mistaken, there was a program in the Structural Analysis module for my HP41C that would calculate that for any set of closed coodinate point sequence, plus structural A, Ix, Iy, and Ixy values.

Mike McCann
MMC Engineering

 

RE: Calculating the geometric centroid of a floor plan

I have posted an example of calculating areas and centroid coordinates without VBA here (the spreadsheet is also attached to this message):

http://newtonexcelbach.wordpress.com/2011/08/07/section-properties-from-coordinates-without-vba/

The on-sheet calculation is fairly straightforward, but using the Secprop User Defined Function is really much more convenient, flexible and robust, so I have also included that with the download spreadsheet.

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/
 

RE: Calculating the geometric centroid of a floor plan

Pretty cool use of array formulas.  

=====================================
(2B)+(2B)'  ?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources