This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / The Mathematica Book / A Practical Introduction to Mathematica / Graphics and Sound /

1.9.9 Parametric Plots

Section 1.9.1 described how to plot curves in Mathematica in which you give the coordinate of each point as a function of the coordinate. You can also use Mathematica to make parametric plots. In a parametric plot, you give both the and coordinates of each point as a function of a third parameter, say .

Functions for generating parametric plots.

Here is the curve made by taking the coordinate of each point to be Sin[t] and the coordinate to be Sin[2t].

In[1]:= ParametricPlot[{Sin[t], Sin[2t]}, {t, 0, 2Pi}]


The "shape" of the curve produced depends on the ratio of height to width for the whole plot.

In[2]:= ParametricPlot[{Sin[t], Cos[t]}, {t, 0, 2Pi}]


Setting the option AspectRatio to Automatic makes Mathematica preserve the "true shape" of the curve, as defined by the actual coordinate values it involves.

In[3]:= Show[%, AspectRatio -> Automatic]


Three-dimensional parametric plots.

ParametricPlot3D[, , , t, tmin, tmax] is the direct analog in three dimensions of ParametricPlot[, , t, tmin, tmax] in two dimensions. In both cases, Mathematica effectively generates a sequence of points by varying the parameter t, then forms a curve by joining these points. With ParametricPlot, the curve is in two dimensions; with ParametricPlot3D, it is in three dimensions.

This makes a parametric plot of a helical curve. Varying t produces circular motion in the , plane, and linear motion in the direction.

In[4]:= ParametricPlot3D[{Sin[t], Cos[t], t/3}, {t, 0, 15}]


ParametricPlot3D[, , , t, tmin, tmax, u, umin, umax] creates a surface, rather than a curve. The surface is formed from a collection of quadrilaterals. The corners of the quadrilaterals have coordinates corresponding to the values of the when t and u take on values in a regular grid.

Here the and coordinates for the quadrilaterals are given simply by t and u. The result is a surface plot of the kind that can be produced by Plot3D.

In[5]:= ParametricPlot3D[{t, u, Sin[t u]},
{t, 0, 3}, {u, 0, 3}]


This shows the same surface as before, but with the coordinates distorted by a quadratic transformation.

In[6]:= ParametricPlot3D[{t, u^2, Sin[t u]},
{t, 0, 3}, {u, 0, 3}]


This produces a helicoid surface by taking the helical curve shown above, and at each section of the curve drawing a quadrilateral.

In[7]:= ParametricPlot3D[{u Sin[t], u Cos[t], t/3},
{t, 0, 15}, {u, -1, 1}]


In general, it is possible to construct many complicated surfaces using ParametricPlot3D. In each case, you can think of the surfaces as being formed by "distorting" or "rolling up" the , coordinate grid in a certain way.

This produces a cylinder. Varying the t parameter yields a circle in the , plane, while varying u moves the circles in the direction.

In[8]:= ParametricPlot3D[{Sin[t], Cos[t], u},
{t, 0, 2Pi}, {u, 0, 4}]


This produces a torus. Varying u yields a circle, while varying t rotates the circle around the axis to form the torus.

In[9]:= ParametricPlot3D[
{Cos[t] (3 + Cos[u]), Sin[t] (3 + Cos[u]), Sin[u]},
{t, 0, 2Pi}, {u, 0, 2Pi}]


This produces a sphere.

In[10]:= ParametricPlot3D[
{Cos[t] Cos[u], Sin[t] Cos[u], Sin[u]},
{t, 0, 2Pi}, {u, -Pi/2, Pi/2}]


You should realize that when you draw surfaces with ParametricPlot3D, the exact choice of parametrization is often crucial. You should be careful, for example, to avoid parametrizations in which all or part of your surface is covered more than once. Such multiple coverings often lead to discontinuities in the mesh drawn on the surface, and may make ParametricPlot3D take much longer to render the surface.