Springs
Common extensions:
Force one point to remain in place
Add gravity, or other forces
Add damping or drag
Example:
spring1.cpp
Without drag, the masses will continue moving forever
Basic formula for drag:
C = coefficient of drag
v = velocity vector
next