I have 4 NSPoints, which are 4 corners of a rectangle
Now I have another NSPoint, which is where the mouse goes down (mousedown_nsp).
What is the best way for me to find the closest NSPoint (out of the 4 rectangle corner NSPoints) in relation to mousedown_nsp?
I was thinking of just doing a comparison to find the distance between mousedown_nsp and the other 4 NSPoints, then choosing the smallest distance, but I feel like there has got to be a better way.
Any ideas?
Thanks in advance!