Results 1 to 5 of 5

Thread: [RESOLVED] Center of mass: practical aspects

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [RESOLVED] Center of mass: practical aspects

    In this earlier post of mine I mentioned I usually register 2 very similar polygons by shifting one relative to the other by the differences in the x & y coordinates of their centers of mass.
    In actual practice it works fine most of the time but at times I find that, for 2 extremely similar figures, the x coordinate (and / or the y coordinate) for the center of mass comes out obviously "wrong" (i.e. comparing the figures by the naked eye). Delving into the problem I found the reason was a much higher concentration of points in a specific part of one of the 2 polygons, not obvious unless you zoomed onto that region.

    So, the question I'm facing now is how to calculate the geometrical center rather than the center of mass. For example, a square with coordinates
    (0,0)
    (0,1)
    (1,1)
    (1,0)
    has both its center of mass and geometrical center at (0.5, 0.5), but the square defined by:
    (0,0)
    (0,1)
    (1,1)
    (1, 0.75)
    (1, 0.5)
    (1, 0.25)
    (1, 0)
    which is identical (if you don't plot the points, just the lines connecting them) has it's center of mass at (5/7, 0.5) but it's geometrical center still

    at (0.5, 0.5).

    Any ideas on how to deal with this?
    Last edited by krtxmrtz; Aug 29th, 2005 at 01:37 PM.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Center of mass: practical aspects

    Well, I think the way to go is by integration. In the case of a polygon it's just a matter of adding the x & y coordinates for the center of mass of the various trapeziums that the polygon can be split into (see figures below).

    I think it should work, at least it did in the simple examples I used for testing.
    Attached Images Attached Images    
    Last edited by krtxmrtz; Aug 28th, 2005 at 03:25 PM.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Center of mass: practical aspects [Probably resolved]

    Unfortunately I made a mistake in my derivation. In the previous post, figure 2 is wrong and must be replaced by the attachment I've just uploaded.
    Attached Images Attached Images  
    Last edited by krtxmrtz; Aug 29th, 2005 at 08:24 AM.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  4. #4

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: Center of mass: practical aspects [Probably resolved]

    I should also add the expression for the area of the trapezium APiPi+1B:

    ai = yi(xi+1 - xi) + (1/2)(xi+1 - xi)(yi+1 - yi) = (1/2)(xi+1 - xi)(yi+1 + yi)
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: [RESOLVED] Center of mass: practical aspects

    I've tried out the recipe in my app and it works like a dream.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width