Mathematics 41, section 1 – Analysis 3 Lab Day 1 – Getting Acquainted With Sun/Unix, 3D Plotting January 27, 1998

Running Maple in SW 219

To run Maple on the Sun workstation network, log onto any machine, open a Terminal window using the Workspace Menu, and type in xmaple &. (The xmaple part should be more or less self-explantory; the ampersand & means that Maple will be run in an independent window, and the Terminal window will be available for you to input additional commands, etc. If you omit the ampersand, the Terminal is not usable this way while Maple is running.)

Take a moment to look over the Maple window and note that it is almost the same as on the PC’s in HA 408. In particular, the toolbar icons are the same (and do the same things), there are similar pull-down menu items under FILE, EDIT, VIEW, etc. The smaller window outlined in green is the active Maple worksheet. You can have several worksheets open simultaneously, but only one will be active. The worksheets themselves work exactly as on the PC’s in HA 408 – input lines, output, and text regions are all handled as before.

A New Maple Command

Today, we will be using the spacecurve command in the plots package to draw line segments in 3D, using the parametric form for lines we discussed in class yesterday. Begin your Maple session by entering the command

                               with(plots):

to load this package.

The spacecurve command can be used to plot any parametric curve in R^{3}. The format for the command is

                   spacecurve([x(t),y(t),z(t),t=a..b]);

where x = x(t),y = y(t),z = z(t) are the parametric equations of the curve and the range of parameter values to be plotted is a ≤ t ≤ b. (Note the placement of the square brackets!) For instance, try entering

                    spacecurve([1-t,2*t,3-4*t,t=0..1]);

This plots the portion of the line through the point P = (1, 0, 3) with direction vector v⃗ = (−1, 2, −4) for t in [0, 1].

The first plot you see here will be rather uninformative. Fortunately, Maple also lets you add axes and look at a 3D plot from different viewpoints. Here’s how:

1) Click the left mouse button once over the graph. This should bring up a “bounding box” for the graph with corners you can drag and drop with the mouse to resize the graph.

2) If you place the mouse over the graph now and hold the left button down, when you move the cursor, you should see a box rotating following the cursor position. Release the left mouse button when you get to the position you want.

3) If you click the right mouse button, you will bring up a menu containing the options

    Redraw, Copy, Style, Axes, Color and several others. Select Axes, Normal with

the left mouse button. Then repeat clicking the right mouse button and select Redraw.

Practice a few times repositioning the viewpoint (rotating the viewing box) and redrawing the graph.

To draw several parametric curves in the same graph, you can include several curve specifications in the form [x(t),y(t),z(t),t=a..b] between curly braces {,}, separated by commas inside the parentheses for the spacecurve command.

Saving Your Work, Printing, Etc.

As part of your user privileges on the Sun network, you have a directory on a local network disk. This is separate from your campus network P: drive, and your P: drive is not accessible from this system. You can save your Maple worksheets there by clicking the toolbar icon that looks like a floppy disk, filling out the filename field in the Save As form and clicking OK. You can read the worksheet back in by clicking the open folder toolbar icon.

To print a file in SW 219, use the printer toolbar icon. In the Printer Setup form, the settings might need one adjustment – make sure the Print Command button is depressed, and the box next to it says lp. After you press Print, the output will be routed to the HP4MV printer in SW219 for you to pick up.

You exit Maple by selecting the EXIT option from the FILE menu.

Lab Exercise

The points P = (0, 0, 0), Q = (2, 0, 0), R = (0, \sqrt{3}, 1), S = (0, −1, \sqrt{3}) are four corners of a cube in R^{3} with edges P Q, P R, and P S, because the vectors u⃗ = Q−P, v⃗ = R−P, w⃗ = S − P all have magnitude 2, and u⃗ · v⃗ = u⃗ · w⃗ = v⃗ · w⃗ = 0. Your assignment, should you decide to accept it (just kidding!), is to create a picture of this cube by drawing the 12 edges together on the same set of axes in R^{3} (begin by drawing the line segments from P to Q, P to R, and P to S). In your writeup, include the Maple worksheet with your graph. Also explain how you found the other 4 corners of the cube. This can be done in a text region.

For this lab, we will be doing individual writeups due Tuesday, February 3.