15.10.2012, 14:27
Quote:
If you need the distance then you HAVE to use that function, the point is that most of the time you don't actually need the distance. If you are just checking if two things are within a certain range of each other then it is faster to square the range and compare to that than it is to square-root the distance and compare to the original range.
|
Like on this page for example:
http://en.wikipedia.org/wiki/Square_...ebraic_formula