static double squaredDistance(Vec2D a, Vec2D b) { double x = b.x - a.x; double y = b.y - a.y; return x * x + y * y; }