Tutorial 7:  More 2-D Graphing

by R. Dover, IMSA

Parametrics

Primarily, one needs to enter the functions x = f(t), y = g(t) as a list of functions.  Beyond that, the coding for parametrically defined graphs should be fairly clear.

ParametricPlot[{Cos[t],  Sin[t]},  {t,  0,  2  π}]

This really is a circle, though it doesn't quite appear to be.  Add the command "AspectRatio -> Automatic" to make the x- and y-scales equal.

Check to see what options are available with ParametricPlot.

Create a couple of your own parametric graphs.  Use some options to see their effects (and to practice them).

More help

Assume for a moment that you are unsure of the coding for a parametrically-defined graph.  Remember that we can use "?" followed by "ParametricPlot."  (Try it here if you wish.)  But much more help is available.
	Under the "Help" menu, choose "Help."  (The program needs to build the index the first time only.  This will take a minute or so.)  When the window opens, the cursor is at the top, after the "Go to" box.  Slowly, begin to type "ParametricPlot."  Note the highlighted terms which appear in the categories and sub-categories below as you type.  When you get sufficiently far so that the term is highlighted, click on "Go To."  The top section is comparable to what the "?" gives.  Secondly, find some other statements and references.  The words in colored text are hot-links to other topics - either more detailed or related commands - in the Mathematica Book. 
	The third section includes "Further examples."  Open this section (by clicking on the arrow) for the command to give a Lissajous figure.  Note that this is a live cell. As such, it may be executed and edited as desired.  (Lissajous figures are really quite interesting.  Change the coefficients of t to try to see some of the patterns.)

Polar graphs

Polar graphs may be obtained in two ways.  Check them out below.

Method 1

First, we'll use parametrics.  To do this, we begin with our function to be graphed 
r = r(θ).  Then we create the parametric equations x = r(θ) cosθ, y = r(θ) sinθ.  
	We need to define  r = cos(θ) + (cos^3)(3  θ/2).  Note that this is written in "traditional form."  You will need to write it in "input form" for Mathematica to understand.  (Watch the brackets and the placement of the cubic 3.)  Then ask Mathematica to graph the appropriate pair of parametric equations on the interval  0 ≤ θ ≤ 4π. (When expressing r[θ] Cos[θ], be careful to add the necessary space for multiplication.)

Method 2

Mathematica may also create polar graphs directly.  Unfortunately, since polar graphs are not done on a day-to-day basis, the command is part of a separate "package" in Mathematica. We must load the package to recognize the command.  Open the "Help" window again.  Click on the radio button "Add-ons."  In the first column, click on "Standard Packages" and then "Graphics" in the second column, and "Graphics" in the third column as well. 
	You will see some general information, followed by some information on Log plots.  Below that is a line which says, "This loads the package."  Execute the cell below which begins with "<<" - the usual method of loading a package. (Make sure you do this and be sure that the number on the "In[  ]" changes appropriately!)  Scroll more to see the command necessary for our graph - and to see what else this package does.

Now graph the function r(θ) = sin(7θ/4) for 0 ≤ θ ≤ 8π.

Note:  If you tried to use the command "PolarPlot" before loading the package, Mathematica doesn't seem to do much.  Unfortunately, it has read in the word in a global manner so that if you then try to load the package, the command still won't work.  (Did you discover this?  If so, execute the command "Remove[PolarPlot]".  Then load the package and try the command again.)

In case of trouble:  At times, you may have difficulty with the "Help" browser.  First, go to the "Help" menu and try "Rebuild Help Index."  If this doesn't work, there is another method for loading packages.  Try the following command, typing it carefully below (only if you have not previously loaded the package above):  Needs["Graphics`Graphics`"]

Implicit graphs

This also requires a package.  Go back to the "Help" window.  Find the package for "ImplicitPlot", read the info, and load the package.  Then look at the examples.  Note that there are two methods which Mathematica can use.  (These will be a bit more clear after we understand the "Solve" command - soon.)  Try some others.  One can obtain some really surprising graphs.  Note also that this process isn't alway very fast.

In case of trouble:  If you were not able to load the package through the "Help" menu, then create a new cell to use the following command:  Needs["Graphics`ImplicitPlot`"]