When bounces fade away…
Damped spring motion referes to the behavior of a spring system where energy is dissipated over time, causing the oscillation to gradually decrease in amplitude until the system comes to a rest.
The basic differential equation for a damped harmonic oscillator can be written in standard form as:
whose solution depends on the damping level, in this case with an exponentially decaying amplitude (slightly adjusted):
Where:
- is the amplitude
- is the equilibrium position
- is the damping ratio
- is the damped frequency
- is the phase angle
Dirty vex demo
vex
float eq = chf("distance");
float zeta = chf("damping");
float amp = chf("amplitude");
vector mult = chv("mult");
float TAU = (PI * 2);
float freq = TAU * sqrt(1 - zeta * zeta);
float p = A * exp(-zeta * TAU * @Time) * cos(freq * @Time + PI) + eq;
@P = set(mult.x * p, mult.y * p, mult.z * p);
