Quadric Surfaces

Copyright © 1997, 2001 by James F. Hurley, University of Connecticut, Department of Mathematics, Unit 3009, Storrs CT 06269-3009.  All rights reserved.

1. Plotting equations that involve z just to the first power. If the variable z occurs in an equation F(x, y, z) = 0 just to the first power, then it is easy to solve for z as an explicit function of the variables x and y. You can then plot the graph by using Mathematica's built-in Plot3D command.

Example 1. Paraboloids. The following routine plots either type of paraboloid: elliptical or hyperbolic. To use it, solve the given equation for z and enter the resulting expression in place of the formula in x and y within the Plot3D command. Altering the plotting window may produce a better image for a particular equation. To do that, change the preliminary values the routine assigns to a, b, and c. As usual, execute the routine by hittting the Enter key after you place the cursor at end of the last line of the blue code.

a = 2;
b = 4;
c = 1;
surf = Graphics3D[
                  Plot3D[c^2(x^2/a^2 - y^2/b^2), {x, -a, a},
                         {y, -b, b}, AxesLabel -> {x, y, z}]
                  ];
coords = Graphics3D[{
                {RGBColor[1, 0, 0],
                 Line[{{-a, 0, 0}, {a+1, 0, 0}}],
                      Text["x", {a + 1.25, 0, 0}]},
                {RGBColor[1, 0, 0],
                 Line[{{0, -b, 0},{0, b+2, 0}}],
                      Text["y", {0, b+2.5, 0}]},
                {RGBColor[1, 0, 0],
                 Line[{{0, 0, -c},{0, 0, c+2}}],
                       Text["z", {0, 0, c+1}]}   }
                  ];
Show[surf, coords, AxesLabel -> {x, y, z}]

[Graphics:Images/QuadSurf_gr_1.gif]

2. Plotting equations that involve [Graphics:Images/QuadSurf_gr_2.gif]. Since the standard graphics package ContourPlot3D by default plots a single level surface f(x, y, z) = 0, it is general enough to provide plots of any quadric surface. (However, for an equation in which the variable z occurs just to the first power, it is quicker and easier to use the method of Section 1 above of solving for z.) For equations that contain [Graphics:Images/QuadSurf_gr_3.gif], the following routine gives a reasonable plot, although the execution is noticeably slower than for routines that use the Plot3D command.

Example 2. The following routine plots cones, cylinders, ellipsoids, or hyperboloids of one or two sheets.  You will want to alter the plotting window and the coordinate-axis plot to produce a good image for a given equation. That led to the choices for the illustrated hyperboloid of two sheets: -- [Graphics:Images/QuadSurf_gr_4.gif] + [Graphics:Images/QuadSurf_gr_5.gif]/4 -- [Graphics:Images/QuadSurf_gr_6.gif]/9 = 1.


Needs["Graphics`ContourPlot3D`"]
a = 1;
b = 2;
c = 3;
surfbr = ContourPlot3D[
             -x^2/a^2 + y^2/b^2 - z^2/c^2 - 1,
             {x, -3 a, 3 a}, {y, -3 b, 3 b}, {z, -3 c, 3 c},
             Axes -> True, AxesLabel -> {x, y, z}];
coords = Graphics3D[{
                {RGBColor[1, 0, 0],
                 Line[{{-2 a, 0, 0}, {5 a + 1, 0, 0}}],
                 Text["x", {5 a + 1.5, 0, 0}]},
                {RGBColor[1, 0, 0],
                 Line[{{0, -2 b, 0}, {0, 6 b, 0}}],
                 Text["y", {0, 6 b + 1, 0}]},
                {RGBColor[1, 0, 0],
                 Line[{{0, 0, -2 c}, {0, 0, 2 c + 1}}],
                   Text["z", {0, 0, 2 c + 2}]}
                   }
                  ];
Show[surfbr, coords]

                    

[Graphics:Images/QuadSurf_gr_7.gif]

3. Printing a graphical image from Mathematica. To print an image like the above plot of a hyperboloid of two sheets,

          • click on the first vertical bar to the right of the plot (to select the image)
          • pull down the File menu, and choose Print Selection.

Mathematica will then print just the selected image, as a PostScript file if your printer is a PostScript printer. This produces better print quality than a bitmap image, which other options--such as the PrintScreen command--give.


Converted by Mathematica      September 28, 2001