added method squareDistance to avoid expensive operation "sqrt" where it's not necessary (compare distances for example)