Kinematic Chains
By projecting point positions so they respect constraints (minimum distance, maximum distance or exact distance), their velocity implicityly gets manipulated, resulting in seemingly correct impulse transfers when colliding. Or by chaining points together and having them keep a fixed distance to their neighboring points, one can get snake-like chains that follow the first point. Going along the chain back and forth, enforcing the constraint, one can get a chain of which both end points can be set to a desired position and the other points will follow.
Touch the screen or move the mouse around to start and interact. Note that scrolling with a touchscreen requires to touch ouside the canvas area.
The code can be found at https://github.com/sven-hoek/interactive_animations/.
Inspired by Sublucid Geometry’s blog post.