Previous Up Next

13.14.2  The distance between objects in the plane: distance

See Section 14.12.7 for distances in three-dimensional geometry.

The distance command finds the distance between two geometric objects (a point is considered a geometric object).


Examples.


Note that when the distance calculation uses parameters, Xcas must be in real mode.


Example.
In real mode:
Input:

assumes(a=[4,0,5,0.1]); A:= point(0); B:= point(a);
simplify(distance(A,B)); simplify(distance(B,A))

Output:


a
,
a

In complex mode:
Input:

assumes(a=[4,0,5,0.1]); A:= point(0); B:= point(a);
simplify(distance(A,B)); simplify(distance(B,A))

Output:

 −aa


The distance command has distanceat and distanceatraw versions (see Section 13.14.1).


Previous Up Next