Using Maple for 3D function plots
Math 113
February 4, 1997
In Math 113 we will be using Maple to draw sufaces in 3 dimensions. These instructions are for MapleV loaded on an IBM Thinkpad.
The Plot3d Command
The programs that plot 3-dimensional surfaces must be loaded into Maple; this can be done by giving the following command
>with(plots);Recall that every Maple command must end with a semicolon. The names of the available plotting procedures will have appeared on the screen. Use the help facility to see how to use the commands; the bottom of the help screen will give examples of the command which is usually very helpful. For an example, try
>?plot3d;Try plotting over the rectangle given by . This can be given by the command
>plot3d(x^2 - y^2, x=-4..4, y=-4..4);A new graphics window will pop up in which the surface will appear.
You have many options for the way in which the surface will be drawn; they are obtained by using the mouse to pull down menus from `style', `color', and `axes'. Try redrawing the surface using the style `patch', the color `Z', and axes `normal'. Double click on the right mouse button to redraw the image. Try again with axes `boxed'; sometimes `normal' axes result in a cluttered image.
One very nice feature is having the ability to view the surface from different viewpoints. To do this, move the arrow into the graphics window and press the left button of the mouse. A white `box' will appear indicating the orientation of the surface; you can change to a new orientation by moving the mouse while holding down the button until reaching the desired position. Redraw the image by double clicking on the right mouse button. Try several different views.
You can also obtain contour plots. To do this use style `patch and contour' with color `Z'. If are going to print your plot, you may want to use color `Z(GRAYSCALE)' to improve the quality of your black and white paper copy. You will have to experiment to see which choice of axes gives the most readable plot. Now use the mouse to rotate the image until you are viewing the surface directly from above (the box should change to a 2-dimensional rectangle). Light shading will indicate larger values of z while darker shading will indicate smaller values of z.
You can try more than one surface at a time. For example, try the command
>plot3d({x^2 + y^2, 2*(x-1) + 2*(y-1) + 2}, x=0..2, y=0..2);
To force the surfaces to be plotted in different colors you can give
the following commands
>F := plot3d(x^2 + y^2, x=0..2, y=0..2, color=blue):
>G := plot3d(2*(x-1)+2*(y-1) + 2, x=0..2, y=0..2, color=red):
>display3d({F,G});
Note the first two commands end in a colon instead of a semicolon to suppress
output. You can also give style and axes options in the same manner;
see the help on `plot[options]'.
What is the relationship between the two surfaces?
You can also use parameterizations to plot surfaces. Try
plot3d([t,s+t,s-t], t=-1..1, s=-1..1);This is helpful for surfaces that can't be given by functions of the form z=f(x,y). For example, try
plot3d([sin(s*t), cos(3*t), sin(3*s)], t=-1..1, s=-1..1);View the surface from different angles and use different sytles to see that it cannot be given by a function.
Please feel free to experiment with plotting different surfaces and with the various plotting options.
You can create some beautiful surfaces using the `tubeplot' feature. Try to draw various seashells, real or imaginary. Can you draw a Chambered Nautilus?
Later in the course you may find the plotting of direction fields helpful. For example to plot the direction field , over the rectangle give the command
>fieldplot([x,x*sin(y)], x=-2..2, y=-2..2);You may also find the `gradplot' command helpful; use the help feature to see how to use it.