Hello it is quite always better to post a script.
Here you compare a point with a double. Also if your surface is on XY plane and flat it is surely OK Do that and it could work but you should (MUST)surely must take just a single point from surface points
There are others ways of doing that are better.