My first thought is that - hmm, that's as good as it gets. Then as a game programmer I wonder "Why do you want to know?" Because if the question was - given 2 points see if they are less than 40 apart - a much faster solution presents itself. Square roots are very expensive... multiplies not so much.
My first thought is that - hmm, that's as good as it gets. Then as a game programmer I wonder "Why do you want to know?" Because if the question was - given 2 points see if they are less than 40 apart - a much faster solution presents itself. Square roots are very expensive... multiplies not so much.
Golfed: