GalileoG
Structural
- Feb 17, 2007
- 467
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.
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.