Michael Bowen's VC Course Pages
Math V21B Maple Scripts for 3D Visualization and Plotting Polar Functions
Introduction
This page lists some Maple scripts that may help you with graphingintensive portions of the course. Some of the graphing capabilities used below are also available on highend graphing calculators. However, the high speed of a computer, and its extended viewing screen, often make Maple a better choice for visualization. Maple software is available in the computer lab ("BEACH") located on the first floor of the LRC; ask at the main desk for an appropriate pod and reservation. The software may also have been bundled with your textbook; the student license is valid for a year from the date it is first installed on your home computer. For my courses, use of this software is optional.
The following scripts may be cut and pasted directly from your browser window into a blank Maple file. Then click anywhere on the red script and press the ENTER button on your computer's keyboard to activate the script. Useradjustable parameters described at the beginning of each listing tell you how to edit the script in order to customize it to fit the problem you are investigating. If you "break" a script by accidental editing, you can copy and paste a new copy of the original script from the browser window into Maple. In Windows, the ALT+TAB key combination allows you to toggle quickly back and forth between your browser and Maple.
In the examples below, black text is documentation, and red text is the actual script. The documentation should not be copied into Maple; please be careful to select an entire section of red text, from the beginning of the first line to the end of the last line. If you seek more information concerning the syntax of Maple commands, click on the command, then press the help (F1) button from Maple (not from the browser). Extensive information concerning Maple commands is also available on line via search engine.
"Classic Maple" Scripts

Animation of Surface of Revolution About xaxis, One Function f; rightclick the image to control the animation via menu.
Useradjustable parameters: f := function to revolve; a := lower limit; b := upper limit; fracrev := fraction of a complete revolution to display at the end of the animation (try 0.5 for a crosssection, or 0.75 for a cutaway view) frames := number of animation frames
with(plots): with(plottools): f := t > t^3/22*t^2+2*t+1: a := 0.75: b := 3: fracrev := 1: frames := 40: start := spacecurve([0,t,f(t)],t=a..b,thickness=3): pic := n > plot3d(f(z),theta=0..n*2*Pi*fracrev/frames,z=a..b,coords=cylindrical): display(start,seq(rotate(pic(n),Pi/2,Pi/2,0),n=1..frames),axes=normal,insequence=true,labels=[" ",x,y],orientation=[24,84,12],tickmarks=[5,5,5]);

Animation of Surface of Revolution About xaxis, Two Functions f and g.
Useradjustable parameters: f := first function to revolve; g := second function to revolve; a := lower limit; b := upper limit; fracrev := fraction of a complete revolution to display at the end of the animation (try 0.5 for a crosssection, or 0.75 for a cutaway view) frames := number of animation frames
with(plots): with(plottools): f := t > t^3/22*t^2+2*t+1: g := t > 0.15*t^2: a := 0.75: b := 3: fracrev := 0.75: frames := 40: start := spacecurve({[0,t,f(t)],[0,t,g(t)]},t=a..b,thickness=3): pic := n > plot3d({f(z),g(z)},theta=0..n*2*Pi*fracrev/frames,z=a..b,coords=cylindrical): display(start,seq(rotate(pic(n),Pi/2,Pi/2,0),n=1..frames),axes=normal,insequence=true,labels=[" ",x,y],orientation=[24,84,12],tickmarks=[5,5,5]);

Parametric Curve and Animation of Parametric Curve Construction.
Useradjustable parameters: x := x(t); y := y(t); a := lower limit of t; b := upper limit of t
with(plots): x := t > sin(3*t): y := t > sin(2*t): a := 0: b := 2*Pi: plot([x(t),y(t),t=a..b]); animate([x(c*u),y(c*u),u=a/25..b/25], c=0..25, numpoints=600);

Polar Plot (No Animation).
Useradjustable parameters: r := function of theta to be plotted; theta := theta; a := lower limit of theta; b := upper limit of theta; rmax := maximum r to display (adjust this value if your graph is too small or too large); radials := number of radial lines to draw on the polar graph paper (setting to 12 gives a 30degree grid); labels := set "true" or "false" (no quotes), depending whether you want the coordinate axes labeled; "scaling=constrained" guarantees that the scale is the same on both axes (without this, some graphs will be distorted; try removing it)
with(plots): r := theta > sin(4*theta): a := 0: b := 1*Pi: rmax := 2: radials := 12: labels := true: p := plot([r(theta),theta,theta=a..b],coords=polar,scaling=constrained,thickness=3): c := coordplot(polar,[0..rmax,0..2*Pi], color=[gray,gray],grid=[rmax+1,radials+1],labelling=labels,scaling=constrained,view=[rmax..rmax,rmax..rmax]): display([p,c]);
Code for graphing two functions simultaneously: r1 := first function of theta to be plotted; r2 := second function of theta to be plotted; (other parameters as described in the previous example)
with(plots): r1 := theta > 1+cos(theta): r2 := theta > 1cos(theta): a := 0: b := 2*Pi: rmax := 2: radials := 12: labels := true: p := plot([r2(theta),r1(theta)],theta=a..b,coords=polar,color=[red,blue],scaling=constrained,thickness=3): c := coordplot(polar,[0..rmax,0..2*Pi], color=[gray,gray],grid=[rmax+1,radials+1],labelling=labels,scaling=constrained,view=[rmax..rmax,rmax..rmax]): display([p,c]);