1. Foliations: Mathematicians refer to a surface which fills a space as being a foliation. A book is an example of a foliation of a rectangular solid by rectangles. This animation gives an example of a foliation of E3 by quadric surfaces, namely hyperboloids of one and two sheets and a cone. The cone represents a singularity; it is a "leaf" of the foliation at which the foliation essentially changes shape.
  2. restart: with(plots):
    
    n := 12:      # frames = 2n+1
    d := 1.01:    # radius
    
    for k from 0 to n-1 do
      c := (1-k/n)^2:
      an1[k] := plot3d([r*cos(t),r*sin(t), sqrt(r^2+c)],
                r=0..d,t=0..2*Pi,view=-d..d,grid=[8,24]):
      an2[k] := plot3d([r*cos(t),r*sin(t),-sqrt(r^2+c)],
                r=0..d,t=0..2*Pi,view=-d..d,grid=[8,24]):
      an3[k] := display(an1[k],an2[k]):
    end do:
    an4 := plot3d([r*cos(t),r*sin(t),r],r=-1..1,
           t=0..2*Pi,view=-d..d,grid=[16,24],
           scaling=constrained):
    for k from 1 to n do
      c := k/n:
      an5[k] := plot3d([r*cos(t),r*sin(t), sqrt(r^2-c^2)],
                r=c+.0000000001..d,t=0..2*Pi,view=-d..d,
                grid=[8,24]):
      an6[k] := plot3d([r*cos(t),r*sin(t),-sqrt(r^2-c^2)],
                r=c+.0000000001..d,t=0..2*Pi,view=-d..d,
                grid=[8,24]):
      an7[k] := display(an5[k],an6[k]):
    end do:
    an8 := plots[display]([seq(an3[i],i=1..n-1)],insequence=true):
    an9 := plots[display]([seq(an7[i],i=1..n-1)],insequence=true):
    display(an8,an4,an9,insequence=true);
  3. Deformation from Sphere to Torus: This animation shows a deformation from the unit sphere into a torus. One "level" of the deformation has a singularity. Notice the similarity between this animation and the previous one, which essentially focuses on the center point of this one.
  4. restart: with(plots):
    
    n := 12:      # frames = 2n-2
    
    for k from 1 to n do
      an1[k] := tubeplot([k/n*cos(t),k/n*sin(t),0],
                t=0..2*Pi,radius=1/2*k/n+1*(1-k/n),numpoints=20,
                tubepoints=16,scaling=constrained):
      an2[n-k+1] := an1[k]:
    end do:
    an3 := display(seq(an1[k],k=1..n),
           insequence=true,scaling=constrained):
    an4 := display(seq(an2[k],k=2..n-1),
           insequence=true,scaling=constrained):
    display(an3,an4,insequence=true);
  5. Cutting the Möbius Strip: This animation shows the Möbius Strip as it is cut lengthwise. You should notice that it does not split into two pieces. However, the new object, a twisted annulus, is no longer 1-sided.
  6. restart:with(plots):
    p:=2: q:=1: n:= 12:                          # constants
    animate3d([(2*cos(p*(t+Pi))+cos(p*(t+Pi))*cos(q*(t+Pi)))*(s-k)+
               (2*cos(p*t)+cos(p*t)*cos(q*t))*(1-s+k),
               (2*sin(p*(t+Pi))+sin(p*(t+Pi))*cos(q*(t+Pi)))*(s-k)+
               (2*sin(p*t)+sin(p*t)*cos(q*t))*(1-s+k),
               sin(q*(t+Pi))*(s-k)+sin(q*t)*(1-s+k)],
               t=0..2*Pi,s=0..1/2,k=0..1/4,grid=[37,2],
               frames=n,scaling=constrained);    # cut strip
  7. klein.gifThe Klein Bottle: Here is code to display the Klein Bottle, a closed surface which intersects itself (in 3 dimensional Euclidean space) and is 1-sided, similar to the Möbius strip.
  8. restart:with(plots):
    top := plot3d([3*cos(t)/4+cos(t)*cos(s)/4,
           3*sin(t)/4+sin(t)*cos(s)/4,1+sin(s)/4],
           t=-Pi..Pi,s=0..Pi,grid=[17,5]):
    middle := cylinderplot(-1/8*z^3+3/8*z+3/4,
              theta=-Pi..Pi,z=-1..1,grid=[17,8]):
    bottom := plot3d([3/4+3/4*cos(t)+cos(t)*cos(s)/2,
              sin(s)/2,-1+3/4*sin(t)+sin(t)*cos(s)/2],
              t=-Pi..0,s=-Pi..Pi,grid=[10,17]):
    nx := z -> 8/sqrt(81*z^4-162*z^2+145):
    nz := z -> (9-9*z^2)/sqrt(81*z^4-162*z^2+145):
    handle := plot3d([3/8*z^3-9/8*z+3/4+nx(z)*cos(s)/2,
              sin(s)/2,z+nz(z)*cos(s)/2],z=-1..1,
              s=-Pi..Pi,grid=[10,17]):
    display(top,middle,bottom,handle,scaling=constrained);
  9. (p,q)-Torus Knots: Imagine wrapping a string around a donut so that the string never touches itself--this can be done in many ways--and then removing the donut, say with a suitably small yet hungry mouse. This code draws such a knot. The "p" determines how many times around the large circumference we travel, and the "q" tells us how many times we wrap around the small circumference. The animation shows both the knot and the torus it is formed around. To see only the knot, remove the an2 from the display command on the last line.
  10. restart:with(plots):
    
    p:=3: q:=2:                            # the constants
    
    an1 := tubeplot([2*cos(p*t)+cos(p*t)*cos(q*t),
           2*sin(p*t)+sin(p*t)*cos(q*t),sin(q*t)],
           t=0..2*Pi,radius=.2,numpoints=(p+q)*10,
           color=red):                     # p,q torus knot
    an2 := tubeplot([2*cos(t),2*sin(t),0],t=0..2*Pi,
           numpoints=45,color=blue):
    display(an1,an2,scaling=constrained);
  11. The Figure-8 Knot: The simplest of hyperbolic knots, this gives a simple parametrization of the figure-8 knot, also known as the 41-knot.
  12. restart:with(plots):
    tubeplot([2*cos(3*t)+cos(1*t),2*sin(3*t)+sin(1*t),
            sin(4*t)],t=0..2*Pi,radius=.2,numpoints=80,
            scaling=constrained);
  13. Seifert Surface for The Trefoil Knot: This graphs the simplest Seifert Surface for the Trefoil knot. Note that the boundary of the surface is the knot itself.
  14. restart:with(plots):
    p:=2: q:=3:
    an1:=polygonplot3d([[1,sqrt(3),1],[1,-sqrt(3),1],[-2,0,1]]):
    an2:=polygonplot3d([[1,sqrt(3),-1],[1,-sqrt(3),-1],[-2,0,-1]]):
    for i from 0 to 2 do
      k:=(10+8*i)*Pi/6:
      an3[i] := plot3d([(2*cos(p*t)+cos(p*t)*cos(q*t))*(1-s)+
                (2*cos(p*(k-t))+cos(p*(k-t))*cos(q*(k-t)))*s,
                (2*sin(p*t)+sin(p*t)*cos(q*t))*(1-s)+
                (2*sin(p*(k-t))+sin(p*(k-t))*cos(q*(k-t)))*s,
                sin(q*t)*(1-s)+sin(q*(k-t))*s],
                t=(1+4*i)*Pi/6..(3+4*i)*Pi/6,s=0..1,grid=[10,2]):
    end do:
    display(an1,an2,an3[0],an3[1],an3[2]);