mass point of 2D polygone

Started by
27 comments, last by CPeX 22 years ago
can someone tell me where I can find formules to calculate the mass point coordinates of a 2D polygone. I think I can make them myself but if someone else has already done it I don''t want to do the work just over :-)
Advertisement
ok that''s the formule for a polygone wiht 3 points.
But my problem is the calculation of the center of mass for a polygone with more points and I don''t think that
x= (x1+x2+x3+x4+x5+....+xn)/n is the right formule
in physics u would have each point ortho to earth surface and draw a line from the point to earth, for all points the center of mass would be the intersection of all the lines.
hope this helps.
no that formule can''t be right
ex:
0----0 0----0
| | | |
| | | |
0 | | |
| | | |
0----0 0----0
0 ==> point of polygone

have the same center of mass but with x = x1+x2+...+xn/n you get two different coordinates
no that formule can''t be right
ex:
0----0 0----0
| | | |
| | | |
0 | | |
| | | |
0----0 0----0
0 ==> point of polygone

have the same center of mass but with x = x1+x2+...+xn/n you get two different coordinates
wooops the figure is mixed up. but I think that you can guess how he had to look like.
Break your polygon up into triangles. Compute the centre of mass of each triangle and it's area. Divide each triangles area by the total area of the polygon (sum of all triangle areas) and use this as the triangles weight. Take the average of each triangles centre of mass multiplied by its weight and that is the centre of mass of the polygon.

(I don't mean weight as in mass x acceleration, but rather as in 'a weighted average')

Timkin



[edited by - Timkin on March 20, 2002 9:06:00 PM]
sounds to be the right solution and even very simple to program.
I''m just wondering why I didn''t found it myself :-) it''s very simple and logic. thanks
This method would work for 3D object as well, right?

Swedish: #Gamedev.se on EFNET
what do you mean with 3D ?
a polygone in 3D ? ==> yes it will work
a object made of polygones ==> no it will not work

This topic is closed to new replies.

Advertisement