pub fn spring(
damping: f32,
stiffness: f32,
mass: f32,
) -> Result<Curve, CurveError>Expand description
Damped-cosine “spring” curve.
damping— fraction of critical damping in[0, 1].0.0= pure oscillation,1.0= critically damped.stiffness,mass— control the natural angular frequencyω = sqrt(stiffness / mass).
The curve starts at 0, overshoots 1 (unless critically damped) and
settles near 1 at t = 1. It is normalised so the shape doesn’t
depend on the animation’s wall-clock duration.