krtxmrtz
Aug 21st, 2005, 04:24 AM
In this (http://www.vbforums.com/showthread.php?t=355577) 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?
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?