squaredDistance static method

double squaredDistance(
  1. Vec2D a,
  2. Vec2D b
)

Implementation

static double squaredDistance(Vec2D a, Vec2D b) {
  double x = b[0] - a[0];
  double y = b[1] - a[1];
  return x * x + y * y;
}