use square_distance for better cayley-menger