public static float Distance(Point2d a, Point2d b) { return((float)Math.Sqrt(SqDist(a, b))); }
public static int SqDist(Point2d a, Point2d b) { return((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)); }