distanceSquared property Null safety

double 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;