FrictionSimulation constructor

FrictionSimulation(double drag, double position, double velocity, { Tolerance tolerance: Tolerance.defaultTolerance })

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

Implementation

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