See Section 27.10.8 for squares of lengths in 3D geometry.
The distance2 command finds the square of the distance between two points.