squaredDistanceTo method

  1. @override
T squaredDistanceTo(
  1. Point<T> other
)
override

Returns the squared distance between this and other.

Squared distances can be used for comparisons when the actual value is not required.

Implementation

@override
T squaredDistanceTo(math.Point<T> other) {
  final dx = x - other.x;
  final dy = y - other.y;
  return dx * dx + dy * dy as T;
}