This page contains a collection of equations of curves and surfaces -- some mundane and some more interesting -- which can be plotted using dynagraph. With most browsers you should be able to cut commands from this page with the mouse and paste to dynagraph's command line.
Important: Some examples below introduce auxiliary variables which must be cleaned up (undefined) when no longer needed in order to avoid interference with subsequent examples. These are marked with # cleanup: tags below.
a standard-issue paraboloid
plot3d(x^2+y^2, x=-1..1, y=-1..1);and a hyperboloid
plot3d(x^2-y^2, x=-1..1, y=-1..1);the two of the above together
plot3d({x^2+y^2,x^2-y^2}, x=-1..1, y=-1..1);the paraboloid in cylindrical coordinates
plot3d(r^2, r=0..1, t=0..2*Pi, coords=z_cylindrical);and an "inverse-paraboloid"
plot3d(z^2, t=0..2*Pi, z=0..1, coords=cylindrical);torus + sphere
p := plot3d([(2+cos(t))*cos(s),(2+cos(t))*sin(s),sin(t)], t=-Pi/2..Pi/2,s=0..2*Pi,grid=[15,25]): q := plot3d([1.5*sin(t)*cos(s),1.5*sin(t)*sin(s),1+1.5*cos(t)], t=0..Pi/2,s=0..2*Pi): display([p,q]);the Cassini surface: level curves are the ``Cassini ovals''. Note that if we replace
d1*d2
with d1+d2
, then the level
curves will be ellipses.
d1 := sqrt((x-1)^2+y^2); d2 := sqrt((x+1)^2+y^2); plot3d(d1*d2,x=-2..2, y=-2..2,contours=60,style=patchcontour,view=0..2); # cleanup: d1 := d1; d2 := d2;The graph of atan2:
plot(atan2(y,x)/Pi, x=-1..1,y=-1..1, grid=[50,50],contours=30,style=patchcontour);The Bessel function of zeroth order:
plot(5*BesselJ(0,r), r=0..8.6, t=0..1.5*Pi, coords=z_cylindrical);Temple of Viviani: the intersection of a sphere and a cylinder. Idea for rendering from http://alem3d.obidos.org/en/struik/viviani/comm, which in turn credits Tom Banchoff.
R := 1: a := 1.2; sp := plot(R, s=0..2*Pi, t=0..Pi, coords=spherical, grid=[60,60],color=brown): cy := plot([R/2 + R/2*cos(t), R/2*sin(t), s], t=0..2*Pi, s=-a*R..a*R,grid=[50,50], color=MediumPurple4): tu := tubeplot([R/2 + R/2*cos(t), R/2*sin(t), R*sin(t/2)], t=0..4*Pi, tuberadius=R/30, color=gold3, tubepoints=10): display([sp,cy,tu], title=`Temple of Viviani\n[ http://alem3d.obidos.org/en/struik/viviani/comm ]`); R := R; a := a; sp := sp; cy := cy; tu := tu; # cleanup: x := x; y := y; z := z;handling singularities: dynagraph avoids a singularity by leaving a hole in its place. This can be seen here by viewing the graph from above
plot3d(x^2*y/(x^4+y^2), x=-1..1, y=-1..1, style=patch);the same function with
grid=[24,24]
instead of the default
grid=[25,25]
does not have a hole because the origin is no longer
a mesh point
plot3d(x^2*y/(x^4+y^2), x=-1..1, y=-1..1, style=patch, grid=[24,24]);anatomy
plot3d(t, t=-Pi..Pi, s=0..Pi, coords=spherical, shading=zgrayscale, title=anatomy);a torn sphere
plot3d(t, t=-Pi..Pi,s=-Pi/2..Pi/2, coords=spherical, title=`a torn sphere`);shell 1
plot3d([x*sin(x)*cos(y), x*cos(x)*cos(y), x*sin(y)], x=0..2*Pi, y=0..Pi, title=`shell 1`);shell 2
plot3d((1.3)^x * sin(y), x=-1..2*Pi, y=0..Pi, coords=spherical, title=`shell 2`);shell 3
plot3d(theta, theta=0..3*Pi, phi=Pi/12..Pi-Pi/12, grid=[48,16], coords=spherical, title=`shell 3`);shell 4 (from Gnuplot demos)
plot3d([cos(u)*u*(1+cos(v)/2), sin(v)*u/2, sin(u)*u*(1+cos(v)/2)], u=0..2*Pi, v=0..2*Pi, title=`shell 4`);a cone
plot3d(z, theta=0..2*Pi, z=-5..5, coords=cylindrical);the real part of the complex square root function
plot3d(r^(1/2)*cos(t/2), r=0..1, t=0..4*Pi, grid=[10,50], coords=z_cylindrical, title=`Real part of the complex square root function`);the real part of the complex cube root function
plot3d(r^(1/3)*cos(t/3), r=0..1, t=0..6*Pi, grid=[10,75], coords=z_cylindrical, title=`Real part of the complex cube root function`);Enneper's surface (from Gnuplot demo)
plot3d([u -u^3/3 + u*v^2,v -v^3/3 + v*u^2,u^2 - v^2], u=-2..2, v=-2..2, title=`Enneper's surface`);the Klein bottle: change the v range to 0..1.5*Pi to see a cross-section
x := (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*cos(v): y := (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*sin(v): z := 4*sin(u)*sin(v/2)+sin(2*u)*cos(v/2): plot3d([x,y,z], u=0..2*Pi, v=0..2*Pi, grid=[20,40], title=`A Klein bottle`); # cleanup: x := x; y := y; z := z;the Mobius strip: w is the ribbon width and n is the number of half-twists. Experiment with their values.
w := 0.5; n := 1; r := 1 + v * cos(t*n/2); z := v * sin(t*n/2); plot3d([r,t,z], t=0..2*Pi, v=-w/2..w/2, grid=[100,3], coords=z_cylindrical); # cleanup: w:=w; n:=n; r:=r; z:=z;a pointy sphere: note that if we remove the exponents this reduces to the standard equation of a sphere.
plot3d([cos(v)^3*cos(u)^3, sin(v)^3*cos(u)^3, sin(u)^3], u=-Pi/2..Pi/2, v=0..2*Pi, title=`Sphere^3`);interlocking tori (from Gnuplot demos)
p := plot3d([cos(u)+0.5*cos(u)*cos(v), sin(u)+0.5*sin(u)*cos(v), 0.5*sin(v)], u=0..2*Pi, v=0..2*Pi, grid=[25,12]): q := plot3d([1+cos(u)+.3*cos(u)*cos(v), 0.3*sin(v), sin(u)+0.3*sin(u)*cos(v)], u=0..2*Pi, v=0..2*Pi, grid=[25,12]): display([p,q]);interlocking circles (from Maple's spacecurve demos)
spacecurve({[sin(t),0,cos(t)],[cos(t)+1,sin(t),0]}, t=-Pi..Pi, thickness=5);a knot (from Maple's spacecurve demos)
u := -10*cos(t) - 2*cos(5*t) + 15*sin(2*t); v := -15*cos(2*t) + 10*sin(t) - 2*sin(5*t); w := 10*cos(3*t); # plot as a spacecurve: spacecurve([u,v,w], t= 0..2*Pi); # plot as a tube: tubeplot([u,v,w], t= 0..2*Pi, tuberadius=4,tubepoints=20, numpoints=100); # cleanup: u := u; v := v; w := w;a coil spring
n := 4; R := 5; p0 := tubeplot([R*cos(t), R*sin(t), 0], t=0..2*Pi, numpoints=25); p1 := tubeplot([R*cos(t), R*sin(t), t], t=0..2*n*Pi, numpoints=25*n); p2 := tubeplot([R*cos(t), R*sin(t), 2*n*Pi], t=0..2*Pi, numpoints=25); display([p0,p1,p2], title=`a coil spring`); # cleanup: n := n; R := R;trefoil around a torus: Idea from Modern Differential Geometry of Curves and Surfaces, by Alfred Gray.
a := 4; b := 2; c := 2; p := 2; q := 3; knot := spacecurve([(a + b*cos(q*t))*cos(p*t), (a + b*cos(q*t))*sin(p*t), c*sin(q*t)], t=0..2*Pi,numpoints=100); tube := tubeplot([(a + b*cos(q*t))*cos(p*t), (a + b*cos(q*t))*sin(p*t), c*sin(q*t)], t=0..2*Pi,numpoints=100,tuberadius=0.5); torus := plot3d([ (a+b*cos(u))*cos(v), (a+b*cos(u))*sin(v), c*sin(u)], u=0..2*Pi, v=0..2*Pi,grid=[25,50]); display([torus,tube], title=`trefoil around a torus`); # cleanup: a := a; b := b; c := c; p := p; q := q; torus := torus; tube := tube; knot := knot;Steiner's Roman Surface: from Al Gray's book (ibid)
plot3d([sin(2*u)*cos(v)^2, sin(u)*sin(2*v), cos(u)*sin(2*v)], u=0..Pi, v=0..Pi, title=`Steiner's Roman Surface`);Kuen's surface of constant negative curvature: from Al Gray's book (ibid)
w := 1 + u^2*sin(v)^2; x := 2*(cos(u)+u*sin(u))*sin(v)/w; y := 2*(sin(u)-u*cos(u))*sin(v)/w; z := log(tan(v/2)) + 2*cos(v)/w; plot3d([x,y,z], u=-4..4, v=0.05..Pi-0.05,title=`Kuen's surface of constant negative curvature`); # cleanup: x := x; y := y; z := z; w := w;the stereographic ellipsoid: from Al Gray's book (ibid)
d := 1+u^2+v^2; x := a*(1-u^2-v^2)/d; y := 2*b*u/d; z := 2*c*v/d; a := 1; b := 3; c := 5; plot3d([x,y,z], u=-2.8..2.8, v=-2.8..2.8, style=patch, title=`The stereographic ellipsoid`); # cleanup: a := a; b := b; c := c; d := d; x := x; y := y; z := z;the Whitney Umbrella from Al Gray's book (ibid)
plot3d([u*v, u, v^2], u=-1..1, v=-1..1, title=`The Whitney Umbrella`);the cross cap from Al Gray's book (ibid)
x := sin(u) * sin(2*v) / 2; y := sin(2*u) * cos(v)^2; z := cos(2*u) * cos(v)^2; # the complete surface: plot([x,y,z], u=0..Pi, v=-Pi/2..Pi/2, title=`The cross cap`); # the sectioned surface: plot([x,y,z], u=0..Pi, v=-Pi/2..Pi/2, view=-1..0.5, title=`The cross cap split open`); # cleanup: x := x; y := y; z := z;Dini's surface of constant negative curvature from Al Gray's book (ibid)
x := cos(u) * sin(v); y := sin(u) * sin(v); z := cos(v) + log(tan(v/2)) + 0.2 * u; plot([x,y,z], u=0..4*Pi, v=0.1..Pi/2, grid=[50,20], title=`Dini's surface`); # cleanup: x := x; y := y; z := z;the tangent surface of a helix
x := cos(t); y := sin(t); z := t; xp := -sin(t); yp := cos(t); zp := 1; plot3d([x + v*xp, y + v*yp, z + v*zp], t=0..2*Pi, v=-4..4); # cleanup: x := x; y := y; z := z; xp := xp; yp := yp; zp := zp;Bour's Minimal Surface: see http://mathworld.wolfram.com/BoursMinimalSurface.html
x := r*cos(t)-r^2*cos(2*t)/2; y := -r*sin(t)-r^2*sin(2*t)/2; z := (4/3)*r^(3/2)*cos(3*t/2); plot([x,y,z], t=0..4*Pi, r=1..4,grid=[100,10],style=patch); # cleanup: x := x; y := y; z := z;the Klein bottle from Maple Gallery
top := 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 = Pi .. 2*Pi); middle := plot3d([ (2.5 + 1.5*cos(v)) * cos(u),(2.5 + 1.5*cos(v)) * sin(u), 3*v - 6 * Pi ], u = 0.. 2* Pi, v = Pi .. 2*Pi); handle := plot3d( [ 2 - 2*cos(v) + sin(u), cos(u), 3 * v - 6 * Pi], u = 0.. 2*Pi , v = Pi .. 2*Pi); bottom := plot3d( [2 + (2 + cos(u))*cos(v),sin(u), -3 * Pi + (2 + cos(u)) * sin (v) ], u = 0.. 2* Pi, v = Pi .. 2*Pi); display([bottom, middle, handle, top]); # cleanup: top := top; middle := middle; handle := handle; bottom := bottom;pumpkin: from Maple Gallery (ibid)
plot3d(1+(1/3)*sin(2*theta)*sin(5*phi)^2, phi=0..2*Pi, theta=0..Pi, coords=spherical, grid=[60,60]);helix: from Maple Gallery (ibid)
plot3d(3+sin(5*theta+phi)^2, phi=0..2*Pi, theta=0..Pi, coords=spherical, grid=[60,60]);clover: from Maple Gallery (ibid)
plot3d(sin(2*theta+3*phi), phi=0..2*Pi, theta=0..Pi, coords=spherical, grid=[60,60]);