Spring constructor

Spring(
  1. PointMass p1,
  2. PointMass p2, {
  3. double stiffness = 1.0,
  4. SpringKind kind = SpringKind.structural,
  5. Spring? dependsOnA,
  6. Spring? dependsOnB,
})

Implementation

Spring(
    this.p1,
    this.p2, {
      this.stiffness = 1.0,
      this.kind = SpringKind.structural,
      this.dependsOnA,
      this.dependsOnB,
    })  : restingDistance = _restLength(p1, p2),
      restSquared = _restLength(p1, p2) * _restLength(p1, p2);