An IEqualityComparer for a Point3d
Lady Justice: who’s blind and weighs objects impartially. Isn’t she beautiful?
But a problem I faced was: how to implement an IEqualityComparer for a Point3d when a tolerance is involved. I didn’t have to think at all, before this answer was proffered by Gilles. The problem with hashcodes are that they more or less return different values. But what happens when you want to return the same hashcode for similar objects, yet different ones for different objects. How do you handle that? See below:
The MSDN documentation suggests that we should not implement the IEqualityComparer
The beauty of it lies in the fact that similar points return similar hash codes. Which is what you want.
Enjoy!