Previous Up Next

12.12.8  The length squared of a segment in space: distance2

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:

distance2(point(-1,1,1),point(1,1,1))

or:

distance2([-1,1,1],[1,1,1])

Output:

4

Previous Up Next