FrictionSimulation constructor Null safety

FrictionSimulation(
  1. double drag,
  2. double position,
  3. double velocity,
  4. {Tolerance tolerance = Tolerance.defaultTolerance}
)

Creates a FrictionSimulation with the given arguments, namely: the fluid drag coefficient cₓ, a unitless value; the initial position x₀, in the same length units as used for x; and the initial velocity dx₀, in the same velocity units as used for dx.

Implementation

FrictionSimulation(
  double drag,
  double position,
  double velocity, {
  super.tolerance,
}) : _drag = drag,
     _dragLog = math.log(drag),
     _x = position,
     _v = velocity;