Math 20C
—
Calculus
—
Prof. Tesler
Graphing
Updated 08/29/21 for Rogawski textbook
Here are various websites and products that do 3D graphs, contour graphs, and parametric graphs. They may not work on all computers, devices, or web browsers.
Google
- Enter a function of one variable in the regular Google search box to generate a plot of it:
sin(x)
- Enter a function of two variables, x and y, to make a 3D plot. The variables have to be called x and y, and each of them has to appear at least once. This feature may not be available on phones and older computers.
sin(x)*sin(y)
- The plot automatically rotates. Click/drag the plot or use the controls in the upper left corner to manually rotate or zoom.
- To adjust the x, y, z ranges, click on them in the lower right corner.
- The peaks in this graph are cut off:
cos(x)*sin(y)*exp(-x^2-y^2)
The problem is that the z range (-0.0124833 to 0.0124833) is too small. To fix it, click on the z range (in the lower right corner) and change it to a bigger range (-.4 to .4 works; this can be shown by finding the maximum/minimum or by just trying larger ranges).
- You can also specify the ranges when entering a formula:
cos(x)*sin(y)*exp(-x^2-y^2), x is from -2*pi to 2*pi, y is from -2*pi to 2*pi, z is from -.4 to .4
- It will not make a 3D graph if x or y is completely missing in the formula, so you are out of luck with making a 3D graph of z = f(x,y) = cos(y); instead of a 3D plot, it will make a 2D plot whose axes are called y and z:
z=cos(y)
Here is a workaround, though:
z=cos(y)+(1e-100)*x
- The surface is colored with a checkered pattern. You can see the vertical traces x=constant or y=constant on it by following along the edge of a row or column of the checkered squares. But it does not currently show horizontal traces z=constant (besides the xy plane, z=0) or make contour plots; see other tools below that do.
Wolfram Alpha
- Wolfram Alpha can do many types of plots, including functions of one variable, two variables, contour plots, and parametric plots. The basic plots are free, but they require a paid subscription for essential features like zooming, rotating, customizing, etc.
- Info and examples of the types of plots available.
- This generates both a 3D plot and a contour plot:
plot sin(x)*sin(y)
In the first panel, use the button "Show contour lines" to show the horizontal traces (z=constant) on the surface. Then use "Show mesh" to switch back to the vertical traces (simultaneously showing x=constant and y=constant). The second panel shows the contour plot.
- Same function with a custom range:
plot sin(x)*sin(y), x=0 to 2*pi, y=-pi to 3*pi
- To make a 3D plot z=f(x,y) when only one variable is in the formula, use
plot3d cos(x)
Using plot instead of plot3d would give a 2D plot y=f(x).
plot cos(x)
- 3D parametric curve:
parametric plot (cos(t), sin(t), t), t=0 to 2*pi
- 2D polar coordinates r=f(θ):
polar plot r=sin(3*theta)
Advanced Software
- Commercial products: Matlab, Maple, Mathematica.
- Free products: R, SAGE, Gnuplot.
- Matlab with UCSD license: Download or web-based.
- These products can do 2D, 3D, contour, parametric, and other types of plots.
- They are harder to use than the websites listed above, and are too advanced for general use in Math 20C, but may be of interest to some students. They require experience in computer programming, matrices, and linear algebra (covered later, in Math 18).
Demos by chapter
Chapter 13.1/11.1: Parametric Equations & Vector-Valued Functions
Chapter 13.3: Arc Length of Parametric Curves
Chapter 13.5: Velocity and Acceleration Vectors of Parametric Curves
Chapter 14.1/12.6: Functions of Two or More Variables
Weather and geographic maps
Websites that make 3D plots of z=f(x,y)
The sites/software below may not work on all computers, devices, or web browsers. See more info on these and other programs earlier on this page.
- Google, Example 1: 3D plots of z=f(x,y). Note the rotation, controls, and checkerboard mesh (grid of x=constant and y=constant).
sqrt(1-x^2-y^2) x*y^2 x^2+4*y^2
- Example 2: Look at the mesh (grid lines) on xy^2. For constant x=a and varying y, we get z=ay^2, which traces a parabola in the plane x=a. For constant y=b and varying x, we get z=xb^2, which traces a line in plane y=b.
- Example 3: The peaks are cut off:
sin(y)*exp(-x^2)
Fix by changing the range to -1≤z≤1. This can be done by typing new limits in the field in the lower right corner of the graph, or by including them with the formula as follows:
sin(y)*exp(-x^2), x is from -10 to 10, y is from -10 to 10, z is from -1 to 1
- Example 4: It will not make a 3D graph if x or y is completely missing in the formula. If you enter z=cos(y), it will make a 2D graph with axes called y and z, instead of a 3D plot:
z=cos(y)
Here's a workaround:
z=cos(y)+(1e-100)*x
- Wolfram Alpha: It shows a 3D plot of z=f(x,y) with a mesh (grid of x=constant, y=constant) and a contour plot. On the 3D plot, click "Show contour lines" to see the horizontal traces (z=constant) on the surface and "Show mesh" to switch back. Other useful features require a paid subscription.
plot x*y^2
Chapter 14.3: Application of Partial Derivatives: Standing Waves
Chapter 14.5: Cowles Mountain Topographic Maps