squaredDistanceTo method
Returns the squared distance to another point. More efficient than distanceTo when comparing distances.
Implementation
double squaredDistanceTo(Point other) {
final dx = x - other.x;
final dy = y - other.y;
return dx * dx + dy * dy;
}