distanceToSquared method

double distanceToSquared(
  1. Vector2 arg
)

Squared distance from this to arg

Implementation

double distanceToSquared(Vector2 arg) {
  final dx = x - arg.x;
  final dy = y - arg.y;

  return dx * dx + dy * dy;
}