distanceSquared static method

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

Implementation

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