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.
| √ |
|
|
| √ |
| −1 |
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:
| −a, a |
The distance command has distanceat and distanceatraw versions (see Section 13.14.1).