distanceTo method

double distanceTo(
  1. Vector2 other
)

Implementation

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