Lets say I have two 10 meter radius circles and I want to put 5 1-meter radius circles on each bigger circle toward the z axis.
I want the big circles and the little circles to move arbitrarily. The big circles should be able to collide and the little circles should be able to collide.
What is the best way to accomplish this? I happen to use Java, but an algorithm/pseudo code would be fine.
More specifically; How do I transfer acceleration and rotational movements of the larger circles to the smaller circles efficiently, while allowing all of them to move dynamically. Solutions I’ve seen tend to get unwieldy in large numbers especially when I start thinking about objects that are more complicated than large circles, but that might just be the way it is.
Sounds like you just need to do some math.
Suppose we have a “boat” (as you term it) centered at x1, y1, with radius r1. A “sailor” is at x2, y2, with radius r2, such that x2 y2 is inside the bounds of the boat. If the boat rotates some angle A, and the sailor is simply co-moving with this rotating frame, then the new center position of the sailor is just going to rotate through the same angle.
If that round circle (sailor) has some orientation to it, then it will have to rotate by A as well – think of an orientation on the sailor aligned with the radial vector from the boat. In the new position, after the boat has rotated through some angle A, this orientation has also rotated A, so the we should apply that rotation to the sailor as well. If the sailor is just a featureless circle then all orientations are the same and we can skip it.