distance static method

double distance(
  1. Vector2 a,
  2. Vector2 b
)

Implementation

static double distance(Vector2 a, Vector2 b) {
  final dx = a.x - b.x;
  final dy = a.y - b.y;
  return sqrt(dx * dx + dy * dy);
}