force method

double force(
  1. double t
)

Attraction force magnitude at time t.

Implementation

double force(double t) {
  final dist = (position(t) - target).abs();
  if (dist < 0.0001) return 0.0;
  return strength / (dist * dist);
}