See section 11.14.3 for squares of lengths in two-dimensional geometry.
The distance2 command takes as arguments two points or two lists with the coordinates of the points.
distance2 returns the square of the distance between these two points.
Input:
or:
Output: