3 ms·
It should be easy enough to compute the "center of mass" (quite efficiently too, by considering a weighted average of component centers of mass recursively) for
by ssivark 5y ago
It should be easy enough to compute the "center of mass" (quite efficiently too, by considering a weighted average of component centers of mass recursively) for the objects, rather than something even more naive like the center of the bounding box. The former, being a sensible physical quantity is much more likely to be well-behaved under physical transformations.
- Someone 5y agoIt is rotation invariant, so it behaves well under rotation, but I think it sometimes would give highly surprising/undesirable results. For example, the center of mass between earth and the sun is deep inside the sun, IIRC, so it would almost rotate around the sun. So, if you have the sun showing at the left of your screen, earth at the right, and rotate that pair over 180 degrees, the sun would stay put, and earth would move off-screen. You could auto-scroll to keep both on-screen, but I don’t think users would find either a good choice. In general, I think users would expect a rectangle with some parts cut out if it to keep the same bounds after a 180 degree rotation, or a circle with some parts after any rotation.
- ssivark 5y agoTry drawing the two circles to the scale of the masses, and you’ll see how massive the sun actually is, relative to the earth :-)