26.13.2 Distance between objects in the plane
See Section 27.10.7 for distances in 3D geometry.
The distance
command finds the distance between two geometric
objects (a point is considered a geometric object).
-
distance two arguments:
G1,G2, two geometric objects.
- distance(G1,G2) returns the distance between
G1 and G2.
Examples
distance(circle(0,1),line(-2,1+3*i)) |
Note that when the distance calculation uses parameters, Xcas
must be in real mode.
Example
In real mode:
assumes(a=[4,0,5,0.1]); A:=point(0); B:=point(a);
simplify(distance(A,B)); simplify(distance(B,A)) |
In complex mode:
assumes(a=[4,0,5,0.1]); A:=point(0); B:=point(a);
simplify(distance(A,B)); simplify(distance(B,A)) |
The distance command has distanceat and
distanceatraw versions (see Section 26.13.1).