distanceSquaredTo method

double distanceSquaredTo(
  1. Vector2 other
)

Implementation

double distanceSquaredTo(Vector2 other) {
  final dx = x - other.x;
  final dy = y - other.y;
  return dx * dx + dy * dy;
}