Here's an interesting group of algorithms I developed while answering a post.
It creates a beaded chain affected by gravity and inertia.
Center of gravity" is created by using a vector intersection calc.
Gravity is created by a Bezier control point plotted with a pythagorean theorem to control chain length.
Inertia is plotted with a Proportional error calc from a PID loop.