Lab 2B - Parametrizing Surfaces
Math 2374 - University of Minnesota
http://www.math.umn.edu/math2374
Questions to: rogness@math.umn.edu
Introduction
As in last week's lab, there is no calculus in this notebook. Last week you learned how to graph curves using ParametricPlot and ParametricPlot3D. You also had the chance to find the parametrizations for various curves. This week we'll do the same thing with surfaces.
We haven't rigorously defined surfaces yet, but you probably have an intuitive idea of what a surface is. It's like a piece of paper, or a sheet of rubber, but it doesn't have to be flat; it can be bent, curved, or even have holes in it. Sometimes a surface encloses a solid region in space. If so, we call it a closed surface. The following pictures both show surfaces; the last one is a closed surface, while the first is not.
A First Look
Often our surfaces will be (a piece of) the graph of a function z=f(x,y), such as this example:
In[41]:=
Out[41]=
Out[42]=
Mathematica can draw a great picture of graphs like this, but Plot3D has its limitations. For example, what if we wanted to plot the graph of x = + ? You should know by looking at this equation that this is a paraboloid, just like our picture above, except this one opens in the direction of the positive x-axis. Suppose we tried to plot this with Plot3D:
In[43]:=
Out[43]=
We get exactly the same picture as before! The paraboloid opens upwards, which is incorrect. The reason is that Plot3D expects a function of two variables, and it interprets the values of the function as the height. Normally we give it a function of x and y, and since the z-axis represents height, this fits in to our view of the world.
How can we get a true graph of x = + from Mathematica? Using parametric equations is one possibility. Think back to last week when we did a "trivial parametrization" of the graph of y=g(x) by setting f(x) equal to (x, g(x)). Define f(y,z)=( + , y, z):
In[44]:=
Out[44]=
Essentially we're saying that y and z are our parameters. Now we can plot the graph of f using ParametricPlot3D:
In[45]:=
Out[45]=
And you can see that this is a paraboloid opening in the direction of the positive x-axis, as desired.
Note that we're using two parameters now, which is different than when we plotted curves. This makes sense, if you think about it. Curves are like a line, a one-dimensional object, so they require one parameter. Surfaces are two-dimensional creatures, and so they require two parameters.
Note: if a curve is in the xy-plane, you can use ParametricPlot, or you can use ParametricPlot3D by letting z(t)=0. If you want to plot a surface, however, you must use ParametricPlot3D. The command ParametricPlot will not accept more than one parameter! (So you can't give it ranges for, say, y and z.)
Also, most of this lab uses ParametricPlot3D, so if you're using Mathematica version 4.x it would be a good idea to execute the command Off[ParametricPlot3D::ppcom] to get rid of those blue error messages about compiling functions. People using Mathematica 5.0 needn't worry about this.
More Examples
Let's look at more examples of how to parametrize surfaces. As in last week's lab, circular regions will be very important, and there is one technique in particular that you should learn. Many of our surfaces will be relatively easy to describe using cylindrical coordinates (r,θ,z), which have been covered in class. A parametrization has to be in rectangular coordinates (x,y,z), so we can't just describe the surface in cylindrical coordinates and say we're done. But if we've described the surface in cylindrical coordinates, we can use the following formulas to convert our description into rectangular coordinates:
x = r Cos[θ]
y = r Sin[θ]
z = z
Example 1(a). Disks of Radius R in the Plane z=h
In cylindrical coordinates, such a disk is described by (r,θ,h) where 0≤r≤ R, 0≤θ≤2π, and h is some constant number. Converting to rectangular coordinates, we have: , where r and θ have the same bounds. (r and θ are our parameters now.) For example, if R=1 and h=0,
In[46]:=
Out[46]=
Out[47]=
Or, with other values of h:
In[48]:=
Out[48]=
Out[49]=
Or, all together:
In[50]:=
Out[50]=
FYI: Normally when we use one parameter we choose the letter t. When we use two parameters, the standard letters are s and t. So often we would write these parametrizations as (for example):
f(s,t) = (s·Cos[t], s·Sin[t], 0), 0≤s≤1, 0≤t≤2π.
When we do a parametrization related to cylindrical coordinates, it might be more intuitive to use r (=radius) and t (=theta), but you're not required to do so. You should also be aware that some textbooks use u and v as parameters instead of s and t (or r and t).
Example 1(b). An Annulus
We won't actually use this much, but it's an interesting example to point out. Suppose we parametrize the disk of radius 4 in the plane z=1:
In[51]:=
Out[51]=
Out[52]=
Now, instead of letting s range from 0 to 4, let's use values of s from 2 to 4 instead:
In[53]:=
Out[53]=
This type of surface is called an annulus. More informally, we might refer to this surface as a "washer," as in the little thing you can buy at the local hardware store.
Example 2. A Filled in Ellipse.
Last week we parametrized an ellipse:
In[54]:=
Out[54]=
We can fill in the ellipse by introducing a second parameter, s. Notice the similarity to the disk above!
In[55]:=
Out[55]=
Out[56]=
Example 3. Shifted Circles and Ellipses.
As with our circles last week, we can shift a circle so that it's centered at another point by adding the appropriate numbers to the components of the parametrization. For example, here's a disk of radius 2 in the plane centered at (1.5,1):
In[57]:=
Out[57]=
Out[58]=
It's also easy to graph a circle or ellipse in, say, the yz-plane instead of the xy-plane:
In[62]:=
Out[62]=
Out[63]=
Use the following command to rotate the previous picture and see which plane the ellipse is in.
In[64]:=
Out[64]=
Example 4. A Piece of a Paraboloid
Suppose we want to work with the portion of the paraboloid z=+ which is above the unit disk in the xy-plane. We could try the "trivial" parametrization,
f(x,y) = (x, y, +), where -1≤x≤1 and - ≤ y ≤
The problem is that neither Plot3D or ParametricPlot3D accept bounds like that for y. Try it! Both of these commands will produce errors:
In[65]:=
Out[65]=
In[66]:=
Out[66]=
We can solve this problem, though. It turns out to be very easy to parametrize the surface if we describe it in cylindrical coordinates first. Our x and y values are in the unit disk; this corresponds to 0≤r≤1 and 0≤θ≤2π. All we need to do is describe z=+in terms of r and θ; but we know that x=rCos[θ] and y=rSin[θ]! On paper, square these and add them together; you should get z = So our parametrization is:
In[67]:=
Out[67]=
Out[68]=
Scroll up and compare this graph to the very first graph in this lab, which is of the very same paraboloid. Notice how much nicer it looks when we use a circular domain and ParametricPlot3D instead of Plot3D and the rectangle -1≤x≤1, -1≤y≤1.
FYI: Sometimes this graph is called "the portion of the paraboloid z=+which is above the unit disk." Even more commonly we might call it "the portion of the paraboloid z=+ cut off by the cylinder += 1;" it's really the same thing if you think about it. If we draw the cylinder += 1 and only take the points of the paraboloid which are inside the cylinder, we get those points which, in cylindrical coordinates, have a radius between 0 and 1. Those are precisely the points we used while creating this graph!
Example 5. A Cylinder
So far nearly everything we've graphed has actually been a function of x and y -- for example, the circles were really just plots of z=0 (or z=1, z=2) where we happened to restrict our domain of x- and y- values to get a circle. Here's an example which is not a function of x and y! Let's graph the cylinder +=9, 0≤z≤10. You learned in an earlier lab that you can graph this cylinder with the following command. If you don't remember for sure how ContourPlot3D works, you should look back at Lab 1B.
In[69]:=
Out[69]=
The problem with this approach is that we can see the cylinder, but we can't really work with it because we don't have a parametrization. So let's find a way to plot it using ParametricPlot3D.
Because we're graphing a cylinder, it's very natural to describe it in cylindrical coordinates. With our earlier disks and other surfaces, r and θ varied while z stayed constant (or at least depended on r and θ). So r and θ were our two parameters. Now our situation is a little different. In the cylinder +=9, r is constantly equal to three, θ ranges from 0 to 2π, and z ranges from 0 to 5. So now θ and z are our two parameters, and when we convert from cylindrical to rectangular coordinates we get:
In[70]:=
Out[70]=
Out[71]=
Compare this to the plot from ContourPlot3D and decide which one you think looks better!
Example 6. A Helicoid.
Here's another example which is not a function of x and y. Using the same sort of technique as with the circle and the ellipse -- multiplying x(t) and y(t) by a new parameter that ranges from 0 to 1 -- we can "fill in" the helix from last week's lab, producing sort of a spiral staircase. (Well, at least a spiral ramp, anyway...)
In[72]:=
Out[72]=
Out[73]=
This is somewhat choppy, but if we use the PlotPoints option with ParametricPlot3D, we can make it look better:
In[74]:=
Out[74]=
Out[75]=
A filled-in helix such as this is called a helicoid.
FYI: Note that the PlotPoints option is used a little differently if we're plotting surfaces instead of curves. Last week you learned that with just one parameter, PlotPoints tells ParametricPlot3D how many different values of that one parameter to use. When you have two parameters, however, you must tell ParametricPlot3D how many different values of each parameter to use. That's why in the command above, we used a list of numbers after PlotPoints instead of just one number. In the command above we told ParametricPlot3D to use 15 different values for s, and 50 different values for t. Because Mathematica plots a point of the surface for every possible combination of s and t, that means we drew the nicer looking helix with 15*80=1200 points, instead of 15*15=225 points with the default values. No wonder it looks better!
Warning! With just one parameter, the default PlotPoints value is 75, and we often increased it to 400. With surfaces -- i.e. if you give ParametricPlot3D two parameters -- the default value is {15, 15}. (Sometimes Mathematica changes its defaults to make things look better, but it doesn't always do a good job.) If you try to increase these numbers as high you can with one parameter, you will run out of memory and Mathematica will crash, and you will lose your work. As a rule of thumb, when plotting surfaces you should never use values {a, b} with PlotPoints if a*b is bigger than, say, 1500 or so.
And now for something completely different...
Exercise 1
Graph the portion of the paraboloid x = + which is cut off by the cylinder + = 1.
Hint: use the ideas of Example 4. In fact, you can start with the same parametrization, and then flip-flop some of the components to get the right answer!
You should hand in your parametrization (including the bounds for your parameters!), a picture of the graph, and an explanation of how you arrived at your parametrization. Stumbling across the correct graph without understanding why it works will result in very little credit.
Exercise 2
In Example 5 we graphed the cylinder +=9. Now graph the hyperbolic paraboloid z = + 3. (Suggestion: use Plot3D with x- and y-ranges of {x,-4,4} and {y,-4,4}.) Show the two of these graphs together so you can see what the intersection looks like.
(a) The intersection of the cylinder and the hyperboloid is a curve. Find a parametrization for this curve. (Your answer should NOT be the parametrization of a surface!)
Hint: you did a problem similar to this in Exercise 3 in last week's lab. Now that you've used cylindrical coordinates, here's an easy way to find the parametrization if you were confused by that problem: you can actually describe this curve in cylindrical coordinates. r will be constant, θ will change, and z will depend on θ, so θ is your parameter. Now express z in terms of θ (and the constant r) and change back to rectangular coordinates.
(b) Find a parametrization for the portion of the hyperboloid which is cut off by the cylinder. In other words, fill in the part of the surface which is inside the curve you found in part (a). (Suggestion: when you graph the surface, use the option BoxRatios→{1,1,1} in ParametricPlot3D.)
You should hand in your parametrizations, complete with bounds for your parameters, and well as pictures of their graphs and an explanation of how you arrived at your answers.
Exercise 3
Throughout this lab we have described many surfaces using cylindrical coordinates, and then converted back to rectangular coordinates to get a parametrization. Use this same idea to produce a graph of the unit sphere, + + = 1, using ParametricPlot3D.
Hint: describe the sphere in spherical coordinates, and then convert this description to rectangular coordinates using the given change-of-coordinate formulas in your book.
You should hand in your parametrization and an explanation of what you did to find it.
Exercise 4
Find a parametrization for the following surface:
Hint: the bottom of the ribbon is in the xy-plane and follows the graph of The height of the ribbon is 1.
You should hand in your parametrization (as always, with bounds), a picture, and an explanation of how you arrived at your answer.
Exercise 5
Do Exercise 4 for the following surface:
Hint: the surface is a piece of the graph of .
Credits
Created by Mathematica (November 6, 2004)