>
|
|
We construct two lines; the first contains the point and the direction , the second the points and . The Line and Plane objects understand lists as points and Vectors as directions.
>
|
|
>
|
|
Let us see if intersects .
>
|
|
| (4) |
The intersection is a point.
We can also find by obtaining equations for both lines (there are two for each) and solving them simultaneously. The default coordinate variables are , , and ; when constructing a line or plane, you can choose different variables.
>
|
|
| (7) |
>
|
|
| (8) |
| (9) |
We can obtain various other representations of a line with the GetRepresentation command.
>
|
|
>
|
|
| (10) |
>
|
|
We construct a third line, parallel to .
>
|
|
>
|
|
What is the relative position of with respect to ?
>
|
|
We can compute the (Euclidean) distance between a pair of lines using the Distance command. Intersecting lines are at distance 0.
The GetPlot command shows a visualization of the line.
In order to combine visualizations, one can use plots:-display. With all features of the visualizations turned on, it is a little crowded, so we turn some of them off.
>
|
|
Let's consider the plane containing and .
What is the relative position of and ?
>
|
|
The distance between and is the same as the distance between and . This is always the case when is parallel to , which contains , but is not parallel to .
Since and intersect, also intersects the plane containing and .
Now let us consider a family of lines. We let be a line containing the point and the direction , for some values and .
>
|
|
| (28) |
| (29) |
If we can find values for and that make the numerators of both those distances zero, we get a line that intersects both and .
>
|
|
| (30) |
We now let be the particular line with these values for and .
>
|
|
| (32) |
>
|
|
| (33) |
Additional examples can be found in the MultivariateCalculus Example Worksheet.