An Example of Plotting Lines with Maple

The interactive version of this notebook is available in MSB 203 in the Math 210 folder.

A line
L in has parametric vector equation

r = + t v ,

where
= O is the vector from the origin to a known point on L , v is a vector in the direction of L and t is the real parameter. Exercise 18, Section 13.5, of James Stewart's text Calculus , 4th Edition asks whether the lines

x = 1 + t , y = 2 - t , z = 3 t and x = 2 - s , y = 1 + 2 s , z = 4 + s .

are parallel, intersect or are skew. Since the direction vectors for the lines,
v = < 1, -1, 3 > and w = < -1, 2, 1 > are clearly not scalar multiples of each other, the lines are definitely not parallel. Plotting them might help resolve the question of intersection.

The following routine generates a plot of the two lines. Its principal tool is the three-dimensional parametric plotting command spacecurve , which is part of Maple's plots3d package. The colon at the end of the first line suppresses printing the list of the package's many routines. The colons at the end of the text two lines suppress plotting of the individual lines in isolation. The final line displays Maple's standard plot of the lines as the parameters s and t range over the interval [Ð2, 2].

> with (plots):
firstline := spacecurve( [1 + t, 2 - t, 3*t], t = -2..2, axes = framed, labels = ["x", "y", "z"] ):
secondline := spacecurve( [2 - s, 1 + 2*s, 4 + s], s = -2..2, axes = framed, labels = ["x", "y", "z"] ):
display(firstline, secondline);

```Warning, the name changecoords has been redefined
```

>

Unfortunately, the plot doesn't reveal whether the lines meet, or one lies above the other. To get a better idea, click on the plot to put bounding lines around it. A new plotting menu bar and context bar then appear at the top of the screen. You can then use Maple's interactive 3-dimensional rotation capability to get a better view of the lines. Depress the mouse button and drag the mouse to rotate the graph and view it from any angle. Try it on your own!

Some manipulation eventually produced the view below, which suggests that the lines do lie in parallel planes, hence are skew. In this case, it is easy to confirm that by equating the expressions for the x - and y - coordinates of the two lines. That gives the system

1 + t = 2 - s
2 - t = 1 + 2s

of two equations in s and t that has the unique solution s = 0, t = 1. For those values, the
z -coordinates do not coincide, so the lines cannot intersect.