{VERSION 1 0 "X11/Motif" "1.0"}{GLOBALS 3 1}{FONT 0 "-adobe-helve
tica-bold-r-normal--*-180-*-*-*-*-*-*" "helvetica" "Helvetica-Bol
d" 8 18 0 "Helvetica-Bold" 18}{FONT 1 "-adobe-new century schoolb
ook-bold-i-normal--*-180-*-*-*-*-*-*" "new century schoolbook" "T
imes-BoldItalic" 8 18 96 "Times-BoldItalic" 18}{FONT 2 "-adobe-co
urier-medium-r-normal--*-140-*" "courier" "Courier" 4 14 192 "Cou
rier" 12}{FONT 3 "-adobe-helvetica-bold-r-normal--*-240-*-*-*-*-*
-*" "helvetica" "Helvetica-Bold" 8 24 0 "Helvetica-Bold" 24}{FONT
 4 "-adobe-helvetica-bold-r-normal--*-240-*-*-*-*-*-*" "helvetica
" "Helvetica-Bold" 8 24 0 "Helvetica-Bold" 24}{FONT 5 "-adobe-hel
vetica-bold-r-normal--*-240-*-*-*-*-*-*" "helvetica" "Helvetica-B
old" 8 24 0 "Helvetica-BoldOblique" 24}{FONT 6 "-adobe-helvetica-
bold-r-normal--*-240-*-*-*-*-*-*" "helvetica" "Helvetica-Bold" 8 
24 0 "Helvetica-Bold" 24}{FONT 7 "-adobe-helvetica-bold-r-normal-
-*-140-*" "helvetica" "Helvetica-Bold" 8 14 0 "Helvetica-Bold" 14
}{SCP_R 1 0 254{COM_R 2 0{TEXT 1 64 "MAPLE WORKSHEET #6:  3d Plot
s, Spacecurves and Parametric Plots."}}{SEP_R 3 0}{INP_R 4 0 "> "
{TEXT 0 12 "with(plots):"}}{SEP_R 5 0}{COM_R 6 0{TEXT 1 116 "Ordi
nary 3d plots of functions with patchcontour option. The color sp
ecifications are given by hue, RGB and by zhue:"}}{SEP_R 7 0}
{INP_R 8 0 "> "{TEXT 0 192 "plot3d(\012x^2-y^2, x=-2..2, y=-2..2,
\012grid=[40,40], scaling=constrained, style=patchcontour, orient
ation=[66,32],\012color=x^2+y^2,\012orientation=[66,32],\012title
font=[TIMES,ROMAN,18],title=`Saddle I`);"}}{SEP_R 9 0}{INP_R 10 0
 "> "{TEXT 0 196 "plot3d(\012x^2-y^2, x=-2..2, y=-2..2,\012grid=[
60,60], scaling=constrained, style=patchnogrid,\012color=[ sin(x*
y), cos(x*y), tan(x*y) ],\012orientation=[90,0],\012titlefont=[TI
MES,ROMAN,18], title=`Saddle II`);"}}{SEP_R 11 0}{INP_R 12 0 "> "
{TEXT 0 170 "plot3d(\012x^2-y^2,x=-2..2,y=-2..2,\012grid=[40,40],
 scaling=constrained, style=patchcontour, shading=zhue,\012orient
ation=[66,32],\012titlefont=[TIMES,ROMAN,18],title=`Saddle III`);
"}}{SEP_R 13 0}{INP_R 14 0 "> "{TEXT 0 165 "plot3d(\012y^2-x^3+3*
x-2, x=-2..2, y=-2..2,\012grid=[50,50], style=patchcontour, shadi
ng=zhue,\012orientation=[-109,22],\012titlefont=[TIMES,ROMAN,18],
 title=`Elliptic Curves`);"}}{SEP_R 15 0}{COM_R 16 0{TEXT 1 152 "
Another way to create the last figure is to use contourplot. Noti
ce that we defined z as a function and we do not need to display \+
the x and y variables."}}{SEP_R 17 0}{INP_R 18 0 "> "{TEXT 0 122 
"z:=(x,y)->y^2-x^3+3*x-2:\012contourplot(\012z, -2..2, -2..2,\012
grid=[50,50], thickness=2, style=patchcontour, axes=none, color=z
);"}}{SEP_R 19 0}{COM_R 20 0{TEXT 1 90 "Her is an example of the \+
real part of the complex function colored by the imaginary part: \+
"}}{SEP_R 21 0}{INP_R 22 0 "> "{TEXT 0 96 "plot3d(\012(E^x)*cos(y
), x=-1..2, y=0..4*Pi,\012grid=[30,50], style=patchnogrid,\012col
or=(E^x)*sin(y) );"}}{SEP_R 23 0}{COM_R 24 0{TEXT 1 12 "Spacecurv
es:"}}{SEP_R 25 0}{INP_R 26 0 "> "{TEXT 0 6 "s:=\{\};"}}{OUT_R 27
 0 26{DAG :3n3\`s`%2,1}}{INP_R 28 0 "> "{TEXT 0 178 "for n from 1
 by 1 to 4 do \012s:=s union \{ [cos(t), cos(n*Pi/12)*sin(t), sin
(n*Pi/12)*sin(t)],\012[ cos(t)/(1-sin(t)*sin(n*Pi/12)), (cos(n*Pi
/12)*sin(t))/(1-sin(t)*sin(n*Pi/12)), 0] \};"}}{INP_R 29 0 "> "
{TEXT 0 3 "od:"}}{SEP_R 30 0}{INP_R 31 0 "> "{TEXT 0 108 "spacecu
rve(s, t=0..2*Pi,\012thickness=2, color=cyan, scaling=constrained
, \012orientation=[-1,79], numpoints=100);"}}{SEP_R 32 0}{COM_R 
33 0{TEXT 1 32 "Combining plots and spacecurves:"}}{SEP_R 34 0}
{INP_R 35 0 "> "{TEXT 0 23 "f:=(x,y)->cos(x^2+y^2);"}}{OUT_R 36 0
 35{DAG :3n3\`f`@8,3n3\`x`n3\`y`,1,3n5\`operator`n4\`arrow`p9(3n3
\`cos`,2+5*3a2x0001j2x0002j2x0001*3a2x0002p1Bp1Dp9p9}}{SEP_R 37 0
}{INP_R 38 0 "> "{TEXT 0 114 "graph := plot3d(\012f-0.05, -Pi^2/8
..Pi^2/8, -Pi^2/8..Pi^2/8,\012grid=[50,50],style=patchnogrid,axes
=none,shading=zhue):"}}{SEP_R 39 0}{INP_R 40 0 "> "{TEXT 0 12 "x0
:=Pi^2/22:"}}{SEP_R 41 0}{INP_R 42 0 "> "{TEXT 0 12 "y0:=Pi^2/22:
"}}{SEP_R 43 0}{INP_R 44 0 "> "{TEXT 0 13 "z0:=f(x0,y0);"}}{OUT_R
 45 0 44{DAG :3n3\`z0`(3n3\`cos`,2+3*3n3\`Pi`j2x0004/3j2x0001j2x0
242}}{SEP_R 46 0}{INP_R 47 0 "> "{TEXT 0 11 "a:=D[1](f);"}}{OUT_R
 48 0 47{DAG :3n3\`a`@8,3n3\`x`n3\`y`,1,3n5\`operator`n4\`arrow`p
9+3*5(3n3\`sin`,2+5*3a2x0001j2x0002j2x0001*3a2x0002p1Dp1Fp1Fp1Bp1
Fi2x0002p9p9}}{SEP_R 49 0}{INP_R 50 0 "> "{TEXT 0 11 "b:=D[2](f);
"}}{OUT_R 51 0 50{DAG :3n3\`b`@8,3n3\`x`n3\`y`,1,3n5\`operator`n4
\`arrow`p9+3*5(3n3\`sin`,2+5*3a2x0001j2x0002j2x0001*3a2x0002p1Dp1
Fp1Fp22p1Fi2x0002p9p9}}{SEP_R 52 0}{INP_R 53 0 "> "{TEXT 0 12 "s:
=a(x0,y0);"}}{OUT_R 54 0 53{DAG :3n3\`s`+3*5(3n3\`sin`,2+3*3n3\`P
i`j2x0004/3j2x0001j2x0242p10pBj2x0002/3i2x0001j2x0011}}{SEP_R 55 
0}{INP_R 56 0 "> "{TEXT 0 12 "t:=b(x0,y0);"}}{OUT_R 57 0 56{DAG :
3n3\`t`+3*5(3n3\`sin`,2+3*3n3\`Pi`j2x0004/3j2x0001j2x0242p10pBj2x
0002/3i2x0001j2x0011}}{SEP_R 58 0}{INP_R 59 0 "> "{TEXT 0 120 "ta
ngentplane:=plot3d(\012s*(x-x0)+t*(y-y0)+z0,x=-Pi^2/8..Pi^2/8,y=-
Pi^2/8..Pi^2/8,\012grid=[30,30],style=wireframe,axes=none):"}}
{SEP_R 60 0}{INP_R 61 0 "> "{TEXT 0 75 "xcurve:=spacecurve([x,y0,
f(x,y0),x=-Pi^2/8..Pi^2/8],color=red,thickness=4):"}}{SEP_R 62 0}
{INP_R 63 0 "> "{TEXT 0 76 "ycurve:=spacecurve([x0,y,f(x0,y),y=-P
i^2/8..Pi^2/8],color=blue,thickness=4):"}}{SEP_R 64 0}{INP_R 65 0
 "> "{TEXT 0 78 "xline:=spacecurve([x,y0,z0+s*(x-x0),x=-Pi^2/8..P
i^2/8],color=red,thickness=4):"}}{SEP_R 66 0}{INP_R 67 0 "> "
{TEXT 0 79 "yline:=spacecurve([x0,y,z0+t*(y-y0),y=-Pi^2/8..Pi^2/8
],color=blue,thickness=4):"}}{SEP_R 68 0}{INP_R 69 0 "> "{TEXT 0 
175 "display(\{ graph, tangentplane, xcurve, ycurve, xline, yline
 \},\012scaling=constrained, orientation=[122,43], shading=XY,\01
2titlefont=[TIMES,ROMAN,18], title=`Partial Derivatives`);"}}
{SEP_R 70 0}{COM_R 71 0{TEXT 1 17 "Parametric plots:"}}{SEP_R 72 
0}{INP_R 73 0 "> "{TEXT 0 228 "plot3d(\012[ cos(u)*cos(v), sin(u)
*cos(v), sin(v) ], u=0..2*Pi, v=-Pi/4..Pi/4,\012grid=[40,30], sty
le=patchnogrid, orientation=[45,38], scaling=constrained,\012shad
ing=zhue, color=u,\012titlefont=[TIMES,ROMAN,18], title=`Spherica
l Belt I`);"}}{SEP_R 74 0}{INP_R 75 0 "> "{TEXT 0 227 "plot3d(\01
2[ cos(u)*cos(v), sin(u)*cos(v), sin(v) ],u=0..2*Pi,v=-Pi/4..Pi/4
,\012grid=[40,30], style=patchnogrid, orientation=[45,38], scalin
g=constrained,\012shading=zhue, color=v,\012titlefont=[TIMES,ROMA
N,18], title=`Spherical Belt II`);"}}{SEP_R 76 0}{INP_R 77 0 "> "
{TEXT 0 279 "display3d(\{\012seq(\012plot3d( [ cos(u)*cos(v), sin
(u)*cos(v), sin(v) ],\012u=2*k*Pi/10..(2*k+1)*Pi/10, v=-Pi/2..Pi/
2,\012grid=[10,30], style=patchnogrid, color=u),\012k=0..9)\},\01
2orientation=[46,47], scaling=constrained, shading=zhue,\012title
font=[TIMES,ROMAN,18], title=`Meridians of Longitude`);"}}{SEP_R 
78 0}{INP_R 79 0 "> "{TEXT 0 275 "display3d(\{\012seq(\012plot3d(
 [ cos(u)*cos(v), sin(u)*cos(v), sin(v) ],\012u=0..2*Pi, v=2*k*Pi
/20..(2*k+1)*Pi/20,\012grid=[40,10], style=patchnogrid, color=u),
\012k=-5..4)\},\012orientation=[46,47], scaling=constrained, shad
ing=zhue,\012titlefont=[TIMES,ROMAN,18], title=`Parallels of Lati
tude`);"}}{SEP_R 80 0}{COM_R 81 0{TEXT 1 5 "Tori:"}}{SEP_R 82 0}
{INP_R 83 0 "> "{TEXT 0 178 "tor:=(R,r,c1,c2,c3,a,b,c,d)->plot3d(
\012[ cos(u)*(R+r*cos(v)), sin(u)*(R+r*cos(v)), r*sin(v) ], u=a..
b, v=c..d,\012style=patch, shading=zhue, grid=[60,30], color=COLO
R(RGB,c1,c2,c3) ):"}}{SEP_R 84 0}{INP_R 85 0 "> "{TEXT 0 203 "dis
play(\{\012tor(3,1.5,1,0,0,0,2*Pi,Pi/2,3*Pi/2),\012tor(3,1,0,1,0,
0,Pi,0,2*Pi),\012tor(3,0.5,0,0,0,0,2*Pi,0,2*Pi) \},\012scaling=co
nstrained, orientation=[-87,73],\012titlefont=[TIMES,ROMAN,18], t
itle=`Clifford Tori`);"}}{SEP_R 86 0}{INP_R 87 0 "> "{TEXT 0 180 
"plot3d([u*cos(v),u*sin(v),v/2], u=0..3, v=-Pi..4*Pi,\012scaling=
constrained,grid=[10,100],style=patch,orientation=[9,46],color=u,
\012titlefont=[TIMES,ROMAN,18],title=`Spiral Staircase`);"}}
{SEP_R 88 0}{INP_R 89 0 "> "{TEXT 0 231 "plot3d(\012[ 5*cos(u)*(2
+v*cos(u/2)), -2+5*sin(u)*(2+v*cos(u/2)), 5*v*sin(u/2) ],\012u=0.
.2*Pi,v=-1..1,\012grid=[50,20], style=patchnogrid, color=u,\012sc
aling=constrained, orientation=[39,63],\012titlefont=[TIMES,ROMAN
,18], title=`Mobius Band`);"}}{SEP_R 90 0}{INP_R 91 0 "> "{TEXT 0
 181 "plot3d(\012[ r*cos(theta), r*sin(theta), r^(1/2)*cos(theta/
2) ], r=0..0.5, theta=0..4*Pi,\012grid=[10,100], style=patch, col
or=r,\012titlefont=[TIMES,ROMAN,18], title=`Complex Square Root`)
;"}}{SEP_R 92 0}{INP_R 93 0 "> "{TEXT 0 201 "plot3d(\012[ r*cos(t
heta), r*sin(theta), r^(1/3)*cos(theta/3) ], r=0..0.4, theta=0..6
*Pi,\012grid=[10,140], style=patch, orientation=[46,62], color=r,
\012titlefont=[TIMES,ROMAN,18], title=`Complex Cubic Root`);"}}
{SEP_R 94 0}{COM_R 95 0{TEXT 1 45 "We now create two models of th
e Klein Bottle:"}}{SEP_R 96 0}{INP_R 97 0 "> "{TEXT 0 60 "kb1 := \+
(2+cos(r/2)*sin(theta)-sin(r/2)*sin(2*theta))*cos(r):"}}{SEP_R 98
 0}{INP_R 99 0 "> "{TEXT 0 60 "kb2 := (2+cos(r/2)*sin(theta)-sin(
r/2)*sin(2*theta))*sin(r):"}}{SEP_R 100 0}{INP_R 101 0 "> "{TEXT 
0 49 "kb3 := sin(r/2)*sin(theta)+cos(r/2)*sin(2*theta):"}}{SEP_R 
102 0}{INP_R 103 0 "> "{TEXT 0 160 "plot3d(\012[kb1, kb2, kb3], r
=0..2*Pi, theta=0..2*Pi,\012grid=[40,40], color=r, style=patch, s
caling=constrained,\012titlefont=[TIMES,ROMAN,18], title=`Klein B
ottle I`);"}}{SEP_R 104 0}{INP_R 105 0 "> "{TEXT 0 122 "kbf1 := p
lot3d(\012[ 2*sin(t), 2*cos(t), u ], t=Pi/2..5*Pi/2, u=-4..0,\012
grid=[20,10], style=patchnogrid, scaling=constrained):"}}{SEP_R 
106 0}{INP_R 107 0 "> "{TEXT 0 174 "kbf2 := plot3d(\012[ (4+2*cos
(Pi*u/14 +4*Pi/14))*sin(t), (4+2*cos(Pi*u/14 +4*Pi/14))*cos(t), u
 ],\012t=Pi/2..5*Pi/2, u=-4..10,\012grid=[100,60], style=wirefram
e, scaling=constrained):"}}{SEP_R 108 0}{INP_R 109 0 "> "{TEXT 0 
137 "kbf3 := plot3d(\012[ cos(t)*(5+2*cos(u))+5, 2*sin(u), sin(t)
*(5+2*cos(u)) ], t=Pi/2..Pi,u=Pi..3*Pi,\012style=patchnogrid, sca
ling=constrained):"}}{SEP_R 110 0}{INP_R 111 0 "> "{TEXT 0 142 "k
bf4 := plot3d(\012[ cos(t)*(5+2*cos(u))+5, 2*sin(u), sin(t)*(5+2*
cos(u))+10 ],\012t=-Pi/2..Pi, u=Pi..3*Pi,\012style=patchnogrid, s
caling=constrained):"}}{SEP_R 112 0}{INP_R 113 0 "> "{TEXT 0 137 
"kbf5 := plot3d(\012[ cos(t)*(4+2*cos(u)), sin(t)*(4+2*cos(u)), 2
*sin(u)-4], t=Pi..3*Pi, u=Pi..2*Pi,\012style=patchnogrid, scaling
=constrained):"}}{SEP_R 114 0}{INP_R 115 0 "> "{TEXT 0 146 "displ
ay3d(\012\{ kbf1, kbf2, kbf3, kbf4, kbf5 \},\012orientation=[-87,
-128],style=patch,shading=zhue,\012titlefont=[TIMES,ROMAN,18],tit
le=`Klein Bottle II`);"}}{SEP_R 116 0}{COM_R 117 0{TEXT 1 46 "Com
bining 3d parametric plots and spacecurves:"}}{SEP_R 118 0}{INP_R
 119 0 "> "{TEXT 0 122 "st1 := plot3d(\012[ cos(v)*cos(u), cos(v)
*sin(u), sin(v) ], u=0..2*Pi, v=-Pi..Pi,\012grid=[15,30], style=w
ireframe, color=cyan):"}}{SEP_R 120 0}{INP_R 121 0 "> "{TEXT 0 
109 "st2 := plot3d(\012[ v*cos(u), v*sin(u), 0], u=0..2*Pi, v=0..
4,\012grid=[30,15], style=wireframe, color=aquamarine):"}}{SEP_R 
122 0}{INP_R 123 0 "> "{TEXT 0 91 "st3 := spacecurve(\012[0, (1-t
)/sqrt(2), t+(1-t)/sqrt(2)], t=0..1,\012thickness=5, color=yellow
):"}}{SEP_R 124 0}{INP_R 125 0 "> "{TEXT 0 103 "st4 := spacecurve
(\012[0, t/sqrt(2)+(1-t)*sqrt(2)/(sqrt(2)-1), t/sqrt(2)],t=0..1,\
012thickness=5, color=red):"}}{SEP_R 126 0}{INP_R 127 0 "> "{TEXT
 0 139 "display3d(\012\{ st1, st2, st3, st4 \},\012scaling=constr
ained, orientation=[34,70], \012titlefont=[TIMES,ROMAN,18],title=
`Stereographic Projection`);"}}{SEP_R 128 0}{COM_R 129 0{TEXT 1 
10 "Tubeplots:"}}{SEP_R 130 0}{INP_R 131 0 "> "{TEXT 0 221 "F := \+
(x,y) ->sin(x):\012tubeplot(\{\012[cos(t), sin(t), 0], [0, sin(t)
-1, cos(t)]\}, t=0..2*Pi,\012radius=1/4,\012numpoints=50, tubepoi
nts=30,\012color=F, style=patch, orientation=[26,76],\012titlefon
t=[TIMES,ROMAN,18], title=`Linked Tori`);"}}{SEP_R 132 0}{INP_R 
133 0 "> "{TEXT 0 15 "k := 3.0^(1/2);"}}{OUT_R 134 0 133{DAG :3n3
\`k`e3j4x001732050808i2x0009}}{SEP_R 135 0}{INP_R 136 0 "> "{TEXT
 0 8 "N := 15;"}}{OUT_R 137 0 136{DAG :3n3\`N`j2x0015}}{SEP_R 138
 0}{INP_R 139 0 "> "{TEXT 0 439 "tubeplot(\{\012[ 1+k*cos(t), k*s
in(t), 0.3*sin(3*t), t=0..2*Pi,\012radius=.3, numpoints=trunc(6.4
*N), tubepoints=N ],\012[ -1/2+k*cos(t), k/2+k*sin(t), 0.3*sin(3*
t), t=0..2*Pi,\012radius=.3, numpoints=trunc(6.4*N), tubepoints=N
 ],\012[ -1/2+k*cos(t), -k/2+k*sin(t), 0.3*sin(3*t), t=0..2*Pi,\0
12radius=.3, numpoints=trunc(6.4*N), tubepoints=N] \},\012scaling
=constrained, orientation=[63,37], color=[0.2,1,1],\012titlefont=
[TIMES,ROMAN,18], title=`Borromian Rings`);"}}{SEP_R 140 0}{INP_R
 141 0 "> "{TEXT 0 184 "tubeplot(\012[ -10*cos(t)-2*cos(5*t)+15*s
in(2*t), \012-15*cos(2*t)+10*sin(t)-2*sin(5*t), \01210*cos(3*t) ]
,\012t= 0..2*Pi,\012numpoints=100, tubepoints=20,\012radius=3, st
yle=patchnogrid, shading=zhue);"}}{SEP_R 142 0}{COM_R 143 0{TEXT 
1 224 "Links and knots. Recall the three golden rectangles that w
ere used  to create the icosahedron. We inscribe in each golden r
ectangle an ellipse.\015Around each ellipse we draw a tube using \+
tubeplot and obtain three linked tori. "}}{SEP_R 144 0}{INP_R 145
 0 "> "{TEXT 0 17 "g:=(1+sqrt(5))/2:"}}{SEP_R 146 0}{INP_R 147 0 
"> "{TEXT 0 113 "goldrec1 := polygonplot3d(\012[ [0,g,1], [0,-g,1
], [0,-g,-1], [0,g,-1] ],\012style=wireframe, color=gold, thickne
ss=3):"}}{SEP_R 148 0}{INP_R 149 0 "> "{TEXT 0 111 "goldrec2 := p
olygonplot3d(\012[ [g,1,0], [-g,1,0], [-g,-1,0], [g,-1,0] ],\012s
tyle=wireframe,color=gold,thickness=3):"}}{SEP_R 150 0}{INP_R 151
 0 "> "{TEXT 0 114 "goldrec3 := polygonplot3d(\012[ [1,0,g], [-1,
0,g], [-1,0,-g], [1,0,-g] ],\012style=wireframe, color=gold,  thi
ckness=3):"}}{SEP_R 152 0}{INP_R 153 0 "> "{TEXT 0 86 "display3d(
\012\{ goldrec1, goldrec2, goldrec3\},\012scaling=constrained, or
ientation=[49,60]);"}}{SEP_R 154 0}{INP_R 155 0 "> "{TEXT 0 77 "e
ll1 := spacecurve([g*cos(t), sin(t), 0], t=0..2*Pi,\012thickness=
3, color=red):"}}{SEP_R 156 0}{INP_R 157 0 "> "{TEXT 0 84 "ell2 :
= spacecurve([0, g*cos(t), sin(t)], t=0..2*Pi,\012thickness=3, co
lor=aquamarine):"}}{SEP_R 158 0}{INP_R 159 0 "> "{TEXT 0 78 "ell3
 := spacecurve([cos(t), 0, g*sin(t)], t=0..2*Pi,\012thickness=3, \+
color=blue):"}}{SEP_R 160 0}{INP_R 161 0 "> "{TEXT 0 105 "display
3d(\012\{ goldrec1, goldrec2, goldrec3, ell1, ell2, ell3 \},\012s
caling=constrained, orientation=[49,60]);"}}{SEP_R 162 0}{INP_R 
163 0 "> "{TEXT 0 75 "display3d(\012\{ ell1, ell2, ell3 \},\012sc
aling=constrained, orientation=[49,60]);"}}{SEP_R 164 0}{INP_R 
165 0 "> "{TEXT 0 97 "tubell1 := tubeplot(\012[g*cos(t), sin(t), \+
0], t=0..2*Pi,\012radius=0.2, style=patchnogrid, color=red):"}}
{SEP_R 166 0}{INP_R 167 0 "> "{TEXT 0 104 "tubell2 := tubeplot(\0
12[0, g*cos(t), sin(t)], t=0..2*Pi,\012radius=0.2, style=patchnog
rid, color=aquamarine):"}}{SEP_R 168 0}{INP_R 169 0 "> "{TEXT 0 
98 "tubell3 := tubeplot(\012[cos(t), 0, g*sin(t)], t=0..2*Pi,\012
radius=0.2, style=patchnogrid, color=blue):"}}{SEP_R 170 0}{INP_R
 171 0 "> "{TEXT 0 139 "display3d(\012\{ tubell1, tubell2, tubell
3 \},\012scaling=constrained,orientation=[49,60],\012titlefont=[T
IMES,ROMAN,18],title=`Three Linked Tori I`);"}}{SEP_R 172 0}
{COM_R 173 0{TEXT 1 26 "We draw curves on a torus."}}{SEP_R 174 0
}{INP_R 175 0 "> "{TEXT 0 131 "torus := plot3d(\012[cos(u)*(3+cos
(v)), sin(u)*(3+cos(v)), sin(v)], u=0..2*Pi, v=0..2*Pi,\012style=
patchnogrid, grid=[50,80], shading=Z):"}}{SEP_R 176 0}{INP_R 177 
0 "> "{TEXT 0 133 "wiretorus := plot3d(\012[cos(u)*(3+cos(v)), si
n(u)*(3+cos(v)), sin(v)], u=0..2*Pi, v=0..2*Pi,\012style=wirefram
e, grid=[50,80], shading=Z):"}}{SEP_R 178 0}{COM_R 179 0{TEXT 1 
34 "The curves will be raised by 0.05."}}{SEP_R 180 0}{INP_R 181 
0 "> "{TEXT 0 8 "s:=1.05:"}}{SEP_R 182 0}{INP_R 183 0 "> "{TEXT 0
 131 "win1 := spacecurve(\012[cos(t)*(3+s*cos(t)), sin(t)*(3+s*co
s(t)), s*sin(t)], t=0..2*Pi,\012numpoints=500, thickness=3, color
=aquamarine):"}}{SEP_R 184 0}{INP_R 185 0 "> "{TEXT 0 69 "display
3d(\{ torus, win1 \}, scaling=constrained, orientation=[25,66]);"
}}{SEP_R 186 0}{INP_R 187 0 "> "{TEXT 0 145 "win2 := spacecurve(\
012[cos(t-2*Pi/3)*(3+s*cos(t)), sin(t-2*Pi/3)*(3+s*cos(t)), s*sin
(t)], t=0..2*Pi,\012numpoints=500, thickness=3, color=aquamarine)
:"}}{SEP_R 188 0}{INP_R 189 0 "> "{TEXT 0 140 "win3 := spacecurve
(\012[cos(t-4*Pi/3)*(3+s*cos(t)), sin(t-4*Pi/3)*(3+s*cos(t)), s*s
in(t)], t=0..2*Pi,\012numpoints=500, thickness=3, color=green):"}
}{SEP_R 190 0}{INP_R 191 0 "> "{TEXT 0 84 "display3d(\012\{ torus
, win1, win2, win3 \}, \012scaling=constrained, orientation=[113,
46]);"}}{SEP_R 192 0}{COM_R 193 0{TEXT 1 49 "For transparency we \+
use wireframe with fine grid."}}{SEP_R 194 0}{INP_R 195 0 "> "
{TEXT 0 85 "display3d(\012\{ wiretorus, win1, win2, win3 \},\012s
caling=constrained,orientation=[63,57]);"}}{SEP_R 196 0}{INP_R 
197 0 "> "{TEXT 0 125 "tub1 := tubeplot(\012[cos(t)*(3+s*cos(t)),
 sin(t)*(3+s*cos(t)), s*sin(t)], t=0..2*Pi,\012radius=0.3, style=
patchnogrid, color=red):"}}{SEP_R 198 0}{INP_R 199 0 "> "{TEXT 0 
145 "tub2 := tubeplot(\012[cos(t-2*Pi/3)*(3+s*cos(t)), sin(t-2*Pi
/3)*(3+s*cos(t)), s*sin(t),t=0..2*Pi],\012radius=0.3, style=patch
nogrid, color=aquamarine):"}}{SEP_R 200 0}{INP_R 201 0 "> "{TEXT 
0 139 "tub3 := tubeplot(\012[cos(t-4*Pi/3)*(3+s*cos(t)), sin(t-4*
Pi/3)*(3+s*cos(t)), s*sin(t),t=0..2*Pi],\012radius=0.3, style=pat
chnogrid, color=blue):"}}{SEP_R 202 0}{INP_R 203 0 "> "{TEXT 0 
145 "display3d(\012\{ tub1, tub2, tub3 \},\012scaling=constrained
, orientation=[113,46], shading=Z,\012titlefont=[TIMES,ROMAN,18],
 title=`Three Linked Tori II`);"}}{SEP_R 204 0}{COM_R 205 0{TEXT 
1 28 "We now consider torus knots."}}{SEP_R 206 0}{INP_R 207 0 ">
 "{TEXT 0 151 "win:=(R,r,w1,w2)->spacecurve(\012[cos(w2*t)*(R+r*c
os(w1*t)), sin(w2*t)*(R+r*cos(w1*t)), r*sin(w1*t)], t=0..2*Pi,\01
2numpoints=500, thickness=3, color=green):"}}{SEP_R 208 0}{INP_R 
209 0 "> "{TEXT 0 229 "tub:=(R,r,w1,w2)->tubeplot(\012[cos(w2*t)*
(R+r*cos(w1*t)), sin(w2*t)*(R+r*cos(w1*t)), r*sin(w1*t)], \012t=0
..2*Pi, radius=r/2, \012style=patchnogrid, numpoints=40*w1, tubep
oints=8*w2,\012scaling=constrained, orientation=[127,64], shading
=Z):"}}{SEP_R 210 0}{INP_R 211 0 "> "{TEXT 0 82 "display3d(\012\{
 wiretorus, win(3,1,3,2) \},\012scaling=constrained,orientation=[
127,64]);"}}{SEP_R 212 0}{INP_R 213 0 "> "{TEXT 0 74 "display3d(t
ub(3,1,3,2), titlefont=[TIMES,ROMAN,18], title=`Torus Knot I`);"}
}{SEP_R 214 0}{INP_R 215 0 "> "{TEXT 0 75 "display3d(tub(3,1,5,2)
, titlefont=[TIMES,ROMAN,18], title=`Torus Knot II`);"}}{SEP_R 
216 0}{INP_R 217 0 "> "{TEXT 0 77 "display3d(tub(3,1,10,1), title
font=[TIMES,ROMAN,18], title=`Torus Knot III`);"}}{SEP_R 218 0}
{INP_R 219 0 "> "{TEXT 0 158 "smalltorus := tubeplot(\012[cos(t)*
(3+(1/5)*cos(t)), sin(t)*(3+(1/5)*cos(t)), (1/5)*sin(t)], t=0..2*
Pi,\012radius=1/2, style=patchnogrid, grid=[50,20], color=cyan):"
}}{SEP_R 220 0}{INP_R 221 0 "> "{TEXT 0 143 "display3d(\{tub(3,1,
10,1),smalltorus\},\012scaling=constrained, orientation=[127,52],
 shading=Z,\012titlefont=[TIMES,ROMAN,18], title=`Torus Knot IV`)
;"}}{SEP_R 222 0}{COM_R 223 0{TEXT 1 21 "Programming in Maple:"}}
{SEP_R 224 0}{INP_R 225 0 "> "{TEXT 0 188 "torus:=proc(R,r,c1,c2,
c3,a,b,c,d) \012plot3d([ cos(u)*(R+r*cos(v)), sin(u)*(R+r*cos(v))
, r*sin(v) ],\012u=a..b, v=c..d,\012style=patch,shading=zhue, gri
d=[60,30], color=COLOR(RGB,c1,c2,c3) ); \012end:"}}{SEP_R 226 0}
{INP_R 227 0 "> "{TEXT 0 46 "torus(3, 1.5, 0, 1, 1, 0, 2*Pi, Pi/2
, 3*Pi/2);"}}{SEP_R 228 0}{INP_R 229 0 "> "{TEXT 0 13 "print(toru
s);"}}{OUT_R 230 0 229{DAG @8,An3\`R`n3\`r`n3\`c1`n3\`c2`n3\`c3`n
3\`a`n3\`b`n3\`c`n3\`d`,1p14p14(3n4\`plot3d`,8[2,4*5(3n3\`cos`,2n
3\`u`j2x0001+5a2x0001p25*5a2x0002p25(3p20,2n3\`v`p25p25p25*5(3n3\
`sin`p22p25p27p25*5p2Cp25(3p39p31p25=3p23~3a2x0006a2x0007=3p32~3a
2x0008a2x0009=3n4\`style`n4\`patch`=3n4\`shading`n4\`zhue`=3n4\`g
rid`[2,3j2x0060j2x0030=3n4\`color`(3n4\`COLOR`,5n3\`RGB`a2x0003a2
x0004a2x0005p14p14}{TEXT 2 207 "\012proc(R,r,c1,c2,c3,a,b,c,d)\01
2    plot3d([cos(u)*(R+r*cos(v)),sin(u)*(R+r*cos(v)),r*sin(v)],u \+
= a .. b,\012        v = c .. d,style = patch,shading = zhue,grid
 = [60,30],\012        color = COLOR(RGB,c1,c2,c3))\012end\012"}}
{SEP_R 231 0}{INP_R 232 0 "> "{TEXT 0 181 "Chebyshev:=proc( n ) \
012local p, k;  \012p[0] := 1; p[1] := x;\012if n<=1 then RETURN(
eval(p)) fi;\012for k from 2 to n do\012p[k] := expand( 2*x*p[k-1
]-p[k-2] )\012od;\012RETURN(eval(p))\012end:         "}}{SEP_R 
233 0}{INP_R 234 0 "> "{TEXT 0 16 "a:=Chebyshev(5):"}}{SEP_R 235 
0}{INP_R 236 0 "> "{TEXT 0 66 "plot(\{ seq(a[i],i=0..5) \}, x=-1.
.1, thickness=3, tickmarks=[0,0]);"}}{SEP_R 237 0}{INP_R 238 0 ">
 "{TEXT 0 281 "curves := proc(n)\012local s, k;\012s[0]:=\{\};\01
2if n<=0 then RETURN(eval(s) ) fi;\012for k from 1  to n do \012s
[k]:=s[k-1] union \{ [cos(t), cos(k*Pi/12)*sin(t), sin(k*Pi/12)*s
in(t)],\012[ cos(t)/(1-sin(t)*sin(k*Pi/12)), (cos(k*Pi/12)*sin(t)
)/(1-sin(t)*sin(k*Pi/12)), 0] \};\012od;\012RETURN(eval(s))\012en
d:"}}{SEP_R 239 0}{INP_R 240 0 "> "{TEXT 0 270 "curves := proc(n)
\012local s, k;\012s:=\{\};\012if n<=0 then RETURN(eval(s) ) fi;\
012for k from 1  to n do \012s:=s union \{ [cos(t), cos(k*Pi/12)*
sin(t), sin(k*Pi/12)*sin(t)],\012[ cos(t)/(1-sin(t)*sin(k*Pi/12))
, (cos(k*Pi/12)*sin(t))/(1-sin(t)*sin(k*Pi/12)), 0] \};\012od;\01
2RETURN(eval(s))\012end:"}}{SEP_R 241 0}{INP_R 242 0 "> "{TEXT 0 
127 "display3d(\012spacecurve(curves(5), t=0..2*Pi, thickness=2, \+
color=cyan, numpoints=200), \012scaling=constrained, orientation=
[1,70]);"}}{SEP_R 243 0}{INP_R 244 0 "> "{TEXT 0 44 "f := proc(x)
 if x<0 then -1 else 1 fi; end; "}}{OUT_R 245 0 244{DAG :3n3\`f`@
8,2n3\`x`,1p7p7?4<3a2x0001j2x0000i2x0001j2x0001p7p7}{TEXT 2 45 "\
012f := proc(x) if x < 0 then -1 else 1 fi end\012"}}{SEP_R 246 0
}{INP_R 247 0 "> "{TEXT 0 57 "plot(f,-1..1, \012thickness=2, colo
r=cyan, tickmarks=[0,0]);"}}{SEP_R 248 0}{INP_R 249 0 "> "{TEXT 0
 109 "f1 := proc(u,t) if u<t then u else t+sin(u-t) fi; end:\012f
2 := proc(u,t) if u<t then 0 else 1-cos(u-t) fi; end:"}}{SEP_R 
250 0}{INP_R 251 0 "> "{TEXT 0 100 "animate([f1,f2,0..2*Pi],0..2*
Pi,\012axes=none, color=red, thickness=3, scaling=constrained, fr
ames=20);"}}{SEP_R 252 0}{INP_R 253 0 "> "{TEXT 0 139 "g1 := proc
(u,v,t) if u<t then u else t+sin(u-t) fi; end:\012g2 := proc(u,v,
t) v; end:\012g3 := proc(u,v,t) if u<t then 0 else 1-cos(u-t) fi;
 end:"}}{SEP_R 254 0}{INP_R 255 0 "> "{TEXT 0 152 "animate3d([g1,
g2,g3],0..2*Pi,0..10,0..2*Pi,\012style=patchnogrid, grid=[40,50],
shading=zhue,\012titlefont=[TIMES,ROMAN,18], title=`Rolling out t
he Cylinder`);"}}}{END}
