SpringDescription.withDampingRatio constructor

SpringDescription.withDampingRatio({double mass, double stiffness, double ratio: 1.0 })

Creates a spring given the mass (m), stiffness (k), and damping ratio (ζ). The damping ratio is especially useful trying to determining 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 stiffness for the units for those arguments. The damping ratio is unitless.

Implementation

SpringDescription.withDampingRatio({
  this.mass,
  this.stiffness,
  double ratio = 1.0
}) : damping = ratio * 2.0 * math.sqrt(mass * stiffness);