distanceSquared property

double get distanceSquared

The square of the magnitude of the offset.

This is cheaper than computing the distance itself.

Implementation

double get distanceSquared => dx * dx + dy * dy;