[REQUEST] Distance SQUARED method for Point


#1

Could we possibly have a distance-squared method for the Point class?

It's very frequently used, for example in calculating which of several points is nearest a particular point.

Currently it's just a little bit clumsy: pow(x.getDistanceFrom(y),2) reads okay but is horribly inefficient and (y-x).dotProduct(y-x) is obfuscated.

π


#2

Yes, good request. I needed this myself the other day too, will add it..