mass point of 2D polygone

Started by
27 comments, last by CPeX 22 years ago
cedricl, the arithmetic average of vectors is equivalent to the geometric average of the displacements that the vectors represent...

...and who said anything about duplicating vertices? We're talking about a polygon. It has exactly n vertices, all distinct! If you add a vertex along an edge without changing the shape of the object, then you haven't added a vertex... the vertices of a polygon are the minimal set of external points that enclose the set of points IN the polygon, IF you assume that all vertices are connected by straight lines.

I must say, please read someones post and make sure you understand it before going off and canning the method suggested.

Timkin

[edited by - Timkin on April 1, 2002 8:57:06 PM]
Advertisement
Whoops,

I guess I''m guilty of not totally reading the post either. My solution (via link) was for 3D polyhedra, not 2D polygons....

But if you do want to calculate mass properties for 3D polyhedra, Mirtich''s solution is fast and robust. Actually much faster than certain brute force methods.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Timkin,

I didn''t sense any animosity in cedricl''s brief reply, only an observation. I don''t really see a reason for you to be defensive. Please try to calm your nerves.

quote:Original post by Timkin
cedricl, the arithmetic average of vectors is equivalent to the geometric average of the displacements that the vectors represent...

...and who said anything about duplicating vertices? We''re talking about a polygon. It has exactly n vertices, all distinct! If you add a vertex along an edge without changing the shape of the object, then you haven''t added a vertex... the vertices of a polygon are the minimal set of external points that enclose the set of points IN the polygon, IF you assume that all vertices are connected by straight lines.

I must say, please read someones post and make sure you understand it before going off and canning the method suggested.



Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
I would like to further comment on this conversation, to clarify the technical argument between cedricl and Timkin. Timkin, you asked cedricl to read a post carefully prior to replying, while I find his reply to be accurate and your rebuttal to his reply to be faulty, as I''ll describe. Your request to read carefully before replying is applicable to EVERYONE . (including myself, since I''m more guilty than most! .)

I consider cedricl''s comment on extra vertices to be perfectly correct (even with your constraint that vertices only truly exist at the corners of a polygon), as I''ll argue.

Suppose we add that vertex at (say), the center of an edge. Further (to satisfy your constraint), lets just slightly move the vertex normal to the edge by an infinitesimal amount so that there now two edges and an infinitesimally changed polygon with an added edge. The center of area/mass of the polygon will not have changed much at all, but the center of mass calculated by arithmetic averaging the vectors you describe may change quite a bit, especially if the starting polygon was a triangle. And if we keep subdividing that same original edge again and again, adding tens, hundreds of vertices and tens, hundreds of very small edges, the center of mass will migrate towards the collection of added edges. We can perturb that original edge so that it looks like a zig-zag, a saw-blade with teeth that are small with respect to the radius of gyration of the polygon, so that we retain the same basic mean shape of the original polygon. And eventually, in the limit, the center of mass will lie somewhere along that saw-blade edge. Clearly wrong, even for a polygon that satisfies your constraints.

quote:Original post by Timkin
...and who said anything about duplicating vertices? We''re talking about a polygon. It has exactly n vertices, all distinct! If you add a vertex along an edge without changing the shape of the object, then you haven''t added a vertex... the vertices of a polygon are the minimal set of external points that enclose the set of points IN the polygon, IF you assume that all vertices are connected by straight lines.


Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Some pertinent formulae from a calc book:
Given the point masses m1, m2...mn located at (x1,y1), (x2,y2)...(yn,yn)
The moment about the
y axis is My = (m1)(x1) + (m2(x2) +...+ (mn)(xn)
x exis is Mx = (m1)(y1) + (m2(y2) +...+ (mn)(yn)
I did check my variables, this is how the book gives them.

Center of mass (X,Y)(or center of gravity) is given by

X = My/m and Y = Mx/m

Where m = m1 + m2 +...+mn is the total mass of the system.

My notation is that mn is m sub n, not m times n.

So you grab each point, which has a mass.
Thats a key feature here. Each point needs a mass value.
That way you avoid a cluster of verts hauling the centerpoint towards them.

Bugle4d
~V'lionBugle4d
quote:Original post by Vlion
Some pertinent formulae from a calc book:
Given the point masses m1, m2...mn located at (x1,y1), (x2,y2)...(yn,yn)
The moment about the
y axis is My = (m1)(x1) + (m2(x2) +...+ (mn)(xn)
x exis is Mx = (m1)(y1) + (m2(y2) +...+ (mn)(yn)
I did check my variables, this is how the book gives them.


Note that the key phrase here is "point masses". For a polygon, which is an area , the mass is distributed continuously across the area, not just concentrated at the vertices. These "point mass" based formulas are not valid for a general polygon without the concentrated mass as a weight factor (you made the same point of course). For symmetric polygons (square, equilateral triangle), the equation for the center of mass may simplify to the same point mass equation, but that is a special case that doesn't work in general.

Look 4 or 5 pages further in that calc book, or read the fine print, and you may find they make my point better than I do. . Usually, in my experience, these point formulas are just presented as an introduction to the concept of inertias and center-of-mass that are superceded by integral area or volume formulas in the next section of the book.

You do lend some validity to the vertex averaging approach, though. IF (and only if) you weight each vertex with a proportional amount of the total polygon area (called the "dual area" of the vertex), then you will get the correct CM. But this is not a simple average. And its actually a bit easier to tesselate into triangles and just do the weighted average on the CM's of triangles using the triangle areas as the weights (Timkin's original approach).

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.


[edited by - grhodes_at_work on April 1, 2002 12:27:25 AM]
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
You are correct Graham... I clearly have a faulty recollection of some other method, probably applied to some other problem. My sincere apologies to cedricl and to the other readers of this forum for my error and the resulting posts.

My original post on the problem (before my latter, erroneous post) still stands though, as it represents a simple method for computing the first moment of the mass distribution, which is the center of mass of the polygon.

One interesting side thought though regarding your gedakenexperiment Graham... in the limit that you create an infinte set of saw teeth along one edge, you add an infinite amount of mass to that side of the polygon!

Timkin

PS: hehe... having gone back through some old notes on geometry I found the method I was thinking about... it's only good for triangles! Ouch!

[edited by - Timkin on April 3, 2002 10:05:00 PM]
quote:Original post by Timkin
You are correct Graham... I clearly have a faulty recollection of some other method, probably applied to some other problem. My sincere apologies to cedricl and to the other readers of this forum for my error and the resulting posts.

My original post on the problem (before my latter, erroneous post) still stands though, as it represents a simple method for computing the first moment of the mass distribution, which is the center of mass of the polygon.


Thanks Timkin. I may have overreacted to your post a bit myself. I''m actually thrilled that this forum seems to be one of the best behaved forums on the site, .

And its absolutely true that your first post was perfectly accurate.

quote:Original post by Timkin
One interesting side thought though regarding your gedakenexperiment Graham... in the limit that you create an infinte set of saw teeth along one edge, you add an infinite amount of mass to that side of the polygon!


Actually, there''s no change in mass at all, since the area of the polygon can remain the same as the undisturbed polygon and mass is distributed uniformly across the area independent of the number of vertices! I think this gets back to the difference between distributed mass and point-mass.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
quote:Original post by grhodes_at_work
Actually, there''s no change in mass at all, since the area of the polygon can remain the same as the undisturbed polygon...


Ah, okay. I was assuming you had added the saw-teeth to the edge, rather than perturbed the edge in-out-in-out-in-out-... etc. That wasn''t quite clear in your original post, however I can see that this was what you were getting at.

Cheers,

Timkin

This topic is closed to new replies.

Advertisement