private bool IsPointsEqual(System.Drawing.Point pa, System.Drawing.Point pb) { int ax = pa.X; int ay = pa.Y; int bx = pb.X; int by = pb.Y; float result = (ax - bx) * (ax - bx) + (ay - by) * (ay - by); // the distance of the 2 points is greater than 0, they're not equal if (/*result > 1*/result != 0) { return false; } // the distance of the 2 points is 0, they're equal else { return true; } }