SpringSimulation constructor

SpringSimulation(SpringDescription spring, double start, double end, double velocity, { Tolerance tolerance: Tolerance.defaultTolerance })

Creates a spring simulation from the provided spring description, start distance, end distance, and initial velocity.

The units for the start and end distance arguments are arbitrary, but must be consistent with the units used for other lengths in the system.

The units for the velocity are L/T, where L is the aforementioned arbitrary unit of length, and T is the time unit used for driving the SpringSimulation.

Implementation

SpringSimulation(
  SpringDescription spring,
  double start,
  double end,
  double velocity, {
  Tolerance tolerance = Tolerance.defaultTolerance,
}) : _endPosition = end,
     _solution = _SpringSolution(spring, start - end, velocity),
     super(tolerance: tolerance);