See section 12.12.8 for squares of lengths in three-dimensional geometry.
The distance2 command takes as arguments two points.
distance2 returns the square of the distance between the points. Input:
Output: