balls with rules

Here are some java animations of some balls moving around in a square while following some rules.

a Each ball heads directly toward another ball (no pair heads toward each other).
b Each ball heads directly toward another ball (no pair heads toward each other), except for the red ball which just moves in a straight line.
c Each ball heads directly toward another ball (no pair heads toward each other), but they cannot get too close to their targets.
d Each ball heads directly toward another ball (no pair heads toward each other), except for the red ball that just moves linearly, but they cannot get too close to their targets.
e In this one, balls move toward their target ball until they get within a certain distance, at which point the bounce away linearly and coast until they're a certain (larger) distance away, at which point they head toward their target ball again colors indicate: red if they are coasting, otherwise the distance to the target ball.
f The red dots move linearly, while the green dots all move directly away from their nearest neighbors.


Doctor Matt>>graphics