double update(double dt, double target) { final double force = (target - value) * stiffness - velocity * damping; velocity += force * dt; value += velocity * dt; return value; }