SpringDescription.withDampingRatio constructor Null safety

SpringDescription.withDampingRatio(
  1. {required double mass,
  2. required double stiffness,
  3. 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({
  required this.mass,
  required this.stiffness,
  double ratio = 1.0,
}) : damping = ratio * 2.0 * math.sqrt(mass * stiffness);