Real motion is many forces at once.
Each force is a vector. Add up every force on the particle and divide by its mass to get the acceleration. Here the mass is 1, so the total force is the acceleration.
- Gravity pulls down, the same amount every frame.
- Drag pushes against the velocity, harder the faster you go:
−c · vel. - A spring pulls toward its anchor, harder the further it's stretched:
−k · (pos − anchor)(Hooke's law).
Combine them and a single particle does surprisingly rich things. Hair, water surfaces and cloth all start here.
Toggle forces on and off.
Start with gravity only. Add drag and turn c up: the fall slows, because drag grows as the speed does. Turn on the spring: the particle swings around the anchor (gold dot). Turn k up and down to feel the stiffness.
Gravity + spring: where does it settle?
A spring's anchor is at y = 2 with k = 5. Gravity is 6 and the mass is 1. If the particle eventually stops, at what y does it hang?
Let it settle and check.
This is the setup from the question. Without drag it swings forever around the rest point, so tick drag, press Play, and wait until it stops. Then check where it came to rest.
Damped oscillator challenge.
Challenge: With gravity, spring and drag all on, tune the drag coefficient c so the particle comes to rest within five seconds of pressing Play. Too little drag and it keeps swinging. The checker replays your settings to time it.
A particle is moving up and to the right. Which way does the drag force point?
Pass the check above to complete this lesson.