Creates a spring given the mass (m), spring constant (k), and damping ratio (ΞΆ). The damping ratio is especially useful trying to determing the type of spring to create. A ratio of 1.0 creates a critically damped spring, > 1.0 creates an overdamped spring and < 1.0 an underdamped one.
See mass
and springConstant
for the units for those arguments. The
damping ratio is unitless.
Source
SpringDescription.withDampingRatio({ double mass, double springConstant, double ratio: 1.0 }) : mass = mass, springConstant = springConstant, damping = ratio * 2.0 * math.sqrt(mass * springConstant);