calculateAttractionForce method
Hooke's law calculates the elastic force
Implementation
double calculateAttractionForce({required double k, required double length}) {
final distance = this.distance;
final deformation = distance - length;
return k * deformation;
}