Simple Springs

A demo of a simple spring attached to two points.

Click and drag the points to move them.
This can also be used to make a rope simulation. Click and drag the points to move them. The physics is very simple. The following vector equation is all you need to calculate the force.

Where k is the spring stiffness, x is the spring extension, û is the unit direction vector between the two nodes, c is the damping constant and v is the relative velocity of the two nodes.