distanceToSquared static method

double distanceToSquared(
  1. DFPosition point1,
  2. DFPosition point2
)

距离的平方

Implementation

static double distanceToSquared(DFPosition point1, DFPosition point2) {
  final dx = point1.x - point2.x;
  final dy = point1.y - point2.y;

  return dx * dx + dy * dy;
}