3D PLOTTING EXAMPLES 

by 

Christopher P. Benton, Ph.D. 

 

The following examples illustrate how to use many of the basic 3d plotting features of MAPLE. 

 

 

> with(plots); 1
 

Warning, the name changecoords has been redefined 

[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
[Interactive, animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, cylinderplot, densityplot, ...
 

>
 

 

Here are a couple of examples of basic 3d plots and how to combine them into a single graph. 

 

> plot3d(x^2+y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); 1
plot3d(x^2+y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); 1
 

Plot 

> plot3d(x^2-y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); 1
plot3d(x^2-y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); 1
 

Plot 

> a1 := plot3d(x^2+y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); -1
a1 := plot3d(x^2+y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); -1
 

> b1 := plot3d(x^2-y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); -1
b1 := plot3d(x^2-y^2, x = -3 .. 3, y = -3 .. 3, transparency = .5, orientation = [25, 85], axes = boxed); -1
 

> display([a1, b1]); 1
 

Plot 

> plot3d(2*x+y+5, x = -3 .. 3, y = -3 .. 3, axes = normal, orientation = [65, 45], numpoints = 50); 1
plot3d(2*x+y+5, x = -3 .. 3, y = -3 .. 3, axes = normal, orientation = [65, 45], numpoints = 50); 1
 

Plot 

 

Here are some examples of how you can create level curves in a plane and contour lines on the graph itself. 

 

> f := x^2+y^2; 1
 

(Typesetting:-mprintslash)([f := x^2+y^2], [x^2+y^2]) 

> plot3d(f, x = -5 .. 5, y = -5 .. 5, axes = normal, orientation = [25, 85]); 1
 

Plot 

> contourplot(f, x = -5 .. 5, y = -5 .. 5); 1
 

Plot 

> contourplot(f, x = -5 .. 5, y = -5 .. 5, contours = [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], thickness = 2, color = red, numpoints = 2000); 1
contourplot(f, x = -5 .. 5, y = -5 .. 5, contours = [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], thickness = 2, color = red, numpoints = 2000); 1
contourplot(f, x = -5 .. 5, y = -5 .. 5, contours = [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5], thickness = 2, color = red, numpoints = 2000); 1
 

Plot 

> contourplot3d(f, x = -5 .. 5, y = -5 .. 5, contours = 20, thickness = 2, color = red, numpoints = 2000, orientation = [25, 85]); 1
contourplot3d(f, x = -5 .. 5, y = -5 .. 5, contours = 20, thickness = 2, color = red, numpoints = 2000, orientation = [25, 85]); 1
 

Plot 

> a2 := plot3d(f, x = -5 .. 5, y = -5 .. 5, axes = normal, orientation = [25, 85]); -1
 

> b2 := contourplot3d(f, x = -5 .. 5, y = -5 .. 5, contours = 20, thickness = 2, color = red, numpoints = 2000, orientation = [25, 85]); -1
b2 := contourplot3d(f, x = -5 .. 5, y = -5 .. 5, contours = 20, thickness = 2, color = red, numpoints = 2000, orientation = [25, 85]); -1
 

> display([a2, b2], title =
 

Plot 

>
 

Here are some examples of how to use implicitplot3d to examine the cross-sections of a surface with a plane. 

 

> a3 := plot3d(x^2+y^2, x = -3 .. 3, y = -3 .. 3, orientation = [25, 85], axes = boxed); -1
 

> b3 := implicitplot3d(x = 2, x = -3 .. 3, y = -3 .. 3, z = -3 .. 20, color = cyan); -1
 

> display([a3, b3]); 1
 

Plot 

> c3 := implicitplot3d(y = 2, x = -3 .. 3, y = -3 .. 3, z = -3 .. 20, color = cyan); -1
 

> display([a3, c3]); 1
 

Plot 

> d3 := implicitplot3d(z = 2, x = -3 .. 3, y = -3 .. 3, z = -3 .. 20, color = cyan); -1
 

> display([a3, d3]); 1
 

Plot 

> e3 := implicitplot3d(x = y, x = -3 .. 3, y = -3 .. 3, z = -3 .. 20, color = cyan); -1
 

> display([a3, e3]); 1
 

Plot 

>
 

This is how you can plot a single point or a series of points. 

 

> pointplot3d([1, 2, 3], axes = normal, symbol = circle, symbolsize = 40, color = red, orientation = [25, 85]); 1
pointplot3d([1, 2, 3], axes = normal, symbol = circle, symbolsize = 40, color = red, orientation = [25, 85]); 1
 

Plot 

> pointplot3d([[1, 2, 3], [-3, 4, -2], [5, 5, 5]], axes = normal, symbol = circle, symbolsize = 40, color = [red, green, blue], orientation = [25, 85]); 1
pointplot3d([[1, 2, 3], [-3, 4, -2], [5, 5, 5]], axes = normal, symbol = circle, symbolsize = 40, color = [red, green, blue], orientation = [25, 85]); 1
 

Plot 

>
 

Here are some curves in space that ae defined by a single parameter. 

 

> spacecurve([cos(t), sin(t), 0], t = 0 .. 2*Pi, thickness = 3, color = red, axes = normal); 1
spacecurve([cos(t), sin(t), 0], t = 0 .. 2*Pi, thickness = 3, color = red, axes = normal); 1
 

Plot 

> spacecurve([cos(t), sin(t), t], t = 0 .. 16*Pi, thickness = 3, color = red, axes = normal, numpoints = 1000); 1
spacecurve([cos(t), sin(t), t], t = 0 .. 16*Pi, thickness = 3, color = red, axes = normal, numpoints = 1000); 1
 

Plot 

> spacecurve([cos(t), sin(t), .5*cos(10*t)], t = 0 .. 16*Pi, thickness = 3, color = red, axes = normal, numpoints = 1000, scaling = constrained); 1
spacecurve([cos(t), sin(t), .5*cos(10*t)], t = 0 .. 16*Pi, thickness = 3, color = red, axes = normal, numpoints = 1000, scaling = constrained); 1
 

Plot 

> spacecurve([cos(t), sin(t), .5*cos(10*t)*t], t = 0 .. 16*Pi, thickness = 1, color = red, axes = normal, numpoints = 2000); 1
spacecurve([cos(t), sin(t), .5*cos(10*t)*t], t = 0 .. 16*Pi, thickness = 1, color = red, axes = normal, numpoints = 2000); 1
 

Plot 

> a4 := plot3d(x^2-y^2, x = -3 .. 3, y = -3 .. 3, axes = normal, transparency = .5, orientation = [65, 85]); -1
a4 := plot3d(x^2-y^2, x = -3 .. 3, y = -3 .. 3, axes = normal, transparency = .5, orientation = [65, 85]); -1
 

> b4 := spacecurve([t, 2, t^2-4], t = -3 .. 3, color = red, thickness = 3); -1
 

> display([a4, b4]); 1
 

Plot 

> a5 := pointplot3d([[0, 0, 0], [3, 4, 6]], axes = normal, symbol = circle, symbolsize = 40, color = [green, blue], orientation = [25, 85]); -1
a5 := pointplot3d([[0, 0, 0], [3, 4, 6]], axes = normal, symbol = circle, symbolsize = 40, color = [green, blue], orientation = [25, 85]); -1
 

> b5 := spacecurve([3*t, 4*t, 6*t], t = 0 .. 1, color = red, thickness = 3, axes = normal, orientation = [25, 85]); -1
b5 := spacecurve([3*t, 4*t, 6*t], t = 0 .. 1, color = red, thickness = 3, axes = normal, orientation = [25, 85]); -1
 

> display([a5, b5]); 1
 

Plot 

> a6 := pointplot3d([[3, 2, 5], [8, 4, 8], [0, 0, 0]], axes = normal, symbol = circle, symbolsize = 40, color = [green, blue, brown], orientation = [25, 85]); -1
a6 := pointplot3d([[3, 2, 5], [8, 4, 8], [0, 0, 0]], axes = normal, symbol = circle, symbolsize = 40, color = [green, blue, brown], orientation = [25, 85]); -1
 

> b6 := spacecurve([3+5*t, 2+2*t, 5+3*t], t = 0 .. 1, color = red, thickness = 3, axes = normal, orientation = [25, 85]); -1
b6 := spacecurve([3+5*t, 2+2*t, 5+3*t], t = 0 .. 1, color = red, thickness = 3, axes = normal, orientation = [25, 85]); -1
b6 := spacecurve([3+5*t, 2+2*t, 5+3*t], t = 0 .. 1, color = red, thickness = 3, axes = normal, orientation = [25, 85]); -1
 

> display([a6, b6]); 1
 

Plot 

Here are a couple of tubeplots. 

 

> tubeplot([cos(t), sin(t), t], t = 0 .. 16*Pi, numpoints = 1000, axes = normal, radius = 0.8e-1, orientation = [25, 55]); 1
tubeplot([cos(t), sin(t), t], t = 0 .. 16*Pi, numpoints = 1000, axes = normal, radius = 0.8e-1, orientation = [25, 55]); 1
 

Plot 

> tubeplot([3+5*t, 2+2*t, 5+3*t], t = 0 .. 1, radius = .1, axes = normal, orientation = [25, 85])
tubeplot([3+5*t, 2+2*t, 5+3*t], t = 0 .. 1, radius = .1, axes = normal, orientation = [25, 85])
 

Plot 

>
 

Here are a couple examples of plots using cylindrical coordinates. 

 

> plot3d(3, theta = 0 .. 2*Pi, z = 0 .. 10, coords = cylindrical, axes = boxed, orientation = [25, 75]); 1
plot3d(3, theta = 0 .. 2*Pi, z = 0 .. 10, coords = cylindrical, axes = boxed, orientation = [25, 75]); 1
 

Plot 

> plot3d(1+cos(2*theta)*cos(z), theta = -1 .. 2*Pi, z = -3 .. 3, coords = cylindrical, numpoints = 2000, scaling = constrained, axes = normal, orientation = [25, 75]); 1
plot3d(1+cos(2*theta)*cos(z), theta = -1 .. 2*Pi, z = -3 .. 3, coords = cylindrical, numpoints = 2000, scaling = constrained, axes = normal, orientation = [25, 75]); 1
plot3d(1+cos(2*theta)*cos(z), theta = -1 .. 2*Pi, z = -3 .. 3, coords = cylindrical, numpoints = 2000, scaling = constrained, axes = normal, orientation = [25, 75]); 1
 

Plot 

Here are a couple of examples of plots using spherical coordinates. 

 

> plot3d(3, theta = 0 .. 2*Pi, phi = 0 .. Pi, coords = spherical, axes = boxed, orientation = [25, 85]); 1
plot3d(3, theta = 0 .. 2*Pi, phi = 0 .. Pi, coords = spherical, axes = boxed, orientation = [25, 85]); 1
 

Plot 

> plot3d(sin(phi)*.8^theta, theta = 0 .. 3*Pi, phi = 0 .. Pi, color = phi, scaling = constrained, coords = spherical, orientation = [-45, 45], numpoints = 1000); 1
plot3d(sin(phi)*.8^theta, theta = 0 .. 3*Pi, phi = 0 .. Pi, color = phi, scaling = constrained, coords = spherical, orientation = [-45, 45], numpoints = 1000); 1
 

Plot 

> plot3d(sin(phi)*1.3^theta, theta = 0 .. 3*Pi, phi = 0 .. Pi, color = phi, scaling = constrained, coords = spherical, orientation = [-45, 45], numpoints = 1000); 1
plot3d(sin(phi)*1.3^theta, theta = 0 .. 3*Pi, phi = 0 .. Pi, color = phi, scaling = constrained, coords = spherical, orientation = [-45, 45], numpoints = 1000); 1
 

Plot 

And finally, here are some examples of surfaces that are defined parametrically using two parameters.
 

> plot3d([u*cos(v), u*sin(v), 10*u], u = 0 .. 1, v = 0 .. 2*Pi, axes = normal); 1
 

Plot 

> plot3d([10+4*cos(u), v, 4*sin(u)], u = 0 .. 2*Pi, v = 0 .. 2*Pi, scaling = constrained, coords = cylindrical, transparency = .5); 1
plot3d([10+4*cos(u), v, 4*sin(u)], u = 0 .. 2*Pi, v = 0 .. 2*Pi, scaling = constrained, coords = cylindrical, transparency = .5); 1
 

Plot 

> plot3d([v*(1+cos(u)), v, v*sin(u)], u = 0 .. 3*Pi, v = 0 .. 3*Pi, scaling = constrained, coords = cylindrical, transparency = .5, numpoints = 1000, orientation = [-55, 10]); 1
plot3d([v*(1+cos(u)), v, v*sin(u)], u = 0 .. 3*Pi, v = 0 .. 3*Pi, scaling = constrained, coords = cylindrical, transparency = .5, numpoints = 1000, orientation = [-55, 10]); 1
plot3d([v*(1+cos(u)), v, v*sin(u)], u = 0 .. 3*Pi, v = 0 .. 3*Pi, scaling = constrained, coords = cylindrical, transparency = .5, numpoints = 1000, orientation = [-55, 10]); 1
 

Plot 

> plot3d([`+`((u+v^2)*cos(u), (u^2-v)*sin(v), 3*u+3*v), `+`((u+v^2)*sin(v), (u^2-v)*cos(u), 3*u+3*v), `+`(3*u+3*v^2, (u^2-v)*sin(v), (u+v)*cos(u))], u = 0 .. 2*Pi, v = 0 .. 2*Pi, color = u*v, transparen...
plot3d([`+`((u+v^2)*cos(u), (u^2-v)*sin(v), 3*u+3*v), `+`((u+v^2)*sin(v), (u^2-v)*cos(u), 3*u+3*v), `+`(3*u+3*v^2, (u^2-v)*sin(v), (u+v)*cos(u))], u = 0 .. 2*Pi, v = 0 .. 2*Pi, color = u*v, transparen...
plot3d([`+`((u+v^2)*cos(u), (u^2-v)*sin(v), 3*u+3*v), `+`((u+v^2)*sin(v), (u^2-v)*cos(u), 3*u+3*v), `+`(3*u+3*v^2, (u^2-v)*sin(v), (u+v)*cos(u))], u = 0 .. 2*Pi, v = 0 .. 2*Pi, color = u*v, transparen...
 

Plot 

> plot3d([rho, 1/2*Pi, phi], rho = 0 .. 5, phi = 0 .. Pi, coords = spherical, axes = boxed, scaling = constrained); 1
plot3d([rho, 1/2*Pi, phi], rho = 0 .. 5, phi = 0 .. Pi, coords = spherical, axes = boxed, scaling = constrained); 1
 

Plot 

> plot3d([rho, theta, 1/4*Pi], rho = 0 .. 5, theta = 0 .. 2*Pi, coords = spherical, axes = boxed, scaling = constrained, orientation = [25, 85]); 1
plot3d([rho, theta, 1/4*Pi], rho = 0 .. 5, theta = 0 .. 2*Pi, coords = spherical, axes = boxed, scaling = constrained, orientation = [25, 85]); 1
 

Plot 

> plot3d([r, 1/4*Pi, z], r = 0 .. 5, z = 0 .. 5, coords = cylindrical, axes = boxed, scaling = constrained, orientation = [25, 85]); 1
plot3d([r, 1/4*Pi, z], r = 0 .. 5, z = 0 .. 5, coords = cylindrical, axes = boxed, scaling = constrained, orientation = [25, 85]); 1
 

Plot 

> plot3d([r, theta, 5], r = 0 .. 5, theta = 0 .. 2*Pi, coords = cylindrical, axes = boxed, scaling = constrained, orientation = [25, 65]); 1
plot3d([r, theta, 5], r = 0 .. 5, theta = 0 .. 2*Pi, coords = cylindrical, axes = boxed, scaling = constrained, orientation = [25, 65]); 1
 

Plot 

>
 

And finally, here are a couple of nonorientable surfaces.  The Mobius strip is the classic example of a one-sided surface, and the Klein bottle takes a twist through a fourth dimension in order to create a 3-dimensional object whose inside is the same as its outside. 

 

> plot3d([cos(u)+v*sin(1/2*u)*cos(u), sin(u)+v*sin(1/2*u)*cos(u), v*cos(1/2*u)], u = 0 .. 2*Pi, v = -.5 .. .5, transparency = .5, scaling = constrained, color = cyan, orientation = [25, 65]); 1
plot3d([cos(u)+v*sin(1/2*u)*cos(u), sin(u)+v*sin(1/2*u)*cos(u), v*cos(1/2*u)], u = 0 .. 2*Pi, v = -.5 .. .5, transparency = .5, scaling = constrained, color = cyan, orientation = [25, 65]); 1
plot3d([cos(u)+v*sin(1/2*u)*cos(u), sin(u)+v*sin(1/2*u)*cos(u), v*cos(1/2*u)], u = 0 .. 2*Pi, v = -.5 .. .5, transparency = .5, scaling = constrained, color = cyan, orientation = [25, 65]); 1
 

Plot 

>
 

> klein1 := plot3d([(2.5+1.5*cos(v))*cos(u), (2.5+1.5*cos(v))*sin(u), 3*v], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
klein1 := plot3d([(2.5+1.5*cos(v))*cos(u), (2.5+1.5*cos(v))*sin(u), 3*v], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
 

> klein2 := plot3d([2-2*cos(v)+sin(u), cos(u), 3*v], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
klein2 := plot3d([2-2*cos(v)+sin(u), cos(u), 3*v], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
 

> klein3 := plot3d([2+(2+cos(u))*cos(v), sin(u), 3*Pi+(2+cos(u))*sin(v)], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
klein3 := plot3d([2+(2+cos(u))*cos(v), sin(u), 3*Pi+(2+cos(u))*sin(v)], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
 

> klein4 := plot3d([(2.5+1.5*cos(v))*cos(u), (2.5+1.5*cos(v))*sin(u), -2.5*sin(v)], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
klein4 := plot3d([(2.5+1.5*cos(v))*cos(u), (2.5+1.5*cos(v))*sin(u), -2.5*sin(v)], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
klein4 := plot3d([(2.5+1.5*cos(v))*cos(u), (2.5+1.5*cos(v))*sin(u), -2.5*sin(v)], u = 0 .. 2*Pi, v = 0 .. Pi, transparency = .5); -1
 

> display([klein1, klein2, klein3, klein4], orientation = [65, 125], scaling = constrained); 1
display([klein1, klein2, klein3, klein4], orientation = [65, 125], scaling = constrained); 1
 

Plot 

>