{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Helvetica" 1 11 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE " R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 11 255 255 255 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 10 255 255 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 423 "This worksheet contains s ome basic applications of MAPLE to the differential geometry of curves . In particular, there is are procedures for computing the curvature a nd torsion of curves. The first set of procedures are for dot product, the length (or norm) of a vector and for the cross product. Although \+ these procedures were necessary in earlier versions of Maple, now they simply serve as warm-ups for procedure writing." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "dp := proc(X,Y) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 " X[1]*Y[1]+X[2]*Y[2]+X[3]*Y[3] " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 " end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "nrm := proc(X) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " \+ sqrt(dp(X,X)) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " end: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "xp := proc(X,Y)" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 " local a,b,c;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " a := X[2]*Y[3]-X[3]*Y[2];" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 35 " b := X[3]*Y[1]-X[1]*Y[3];" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 " c := X[1]*Y[2]-X[2]*Y[1]; " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " [a,b,c]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 355 "These procedures compute curvature and torsion. These function s assume that the curve is given parametrically in three coordinates. \+ If the curve is a plane curve in the xy-plane, say, then make the thir d coordinate zero. (Note that Maple's dotprod and crossprod are used i nstead of the procedures above. To use them, however, declare with(lin alg): first.)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linal g):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "curv:=proc(alpha)" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " local alphap,alphapp,cr oss,top,bottom;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 32 " alphap :=diff(alpha,t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 196 " alph app:=diff(alphap,t);\n cross:=crossprod(alphap,alphapp);\n \+ top:=sqrt(cross[1]^2+cross[2]^2+cross[3]^2);\n bottom: =sqrt(alphap[1]^2+alphap[2]^2+alphap[3]^2)^3;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " RETURN(kappa=simplify(top/bottom,symbolic)) ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 " end:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "tor:= proc(alpha)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 " local alphap,alphapp,alphappp,cross,to p,bottom;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 " alphap:=diff( alpha,t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 " alphapp:=diff (alphap,t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 220 " alphappp:= diff(alphapp,t);\n cross:=crossprod(alphap,alphapp);\n \+ top:=dotprod(cross,alphappp);\n bottom:=cross[1]^2+cross[2]^2 +cross[3]^2;\n RETURN(tau=simplify(top/bottom,symbolic));" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 " end:" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 32 "Here's an example. Take a helix." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "hel:=[a*cos(t),a*sin(t),b*t];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "curv(hel);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "tor(hel);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "hel1:=subs(\{a=4,b=2\},hel);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "curv(hel1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "tor(hel1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "hyphel: =[cosh(t),sinh(t),t];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "cu rv(hyphel);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "tor(hyphel); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "circ:=[a*cos(t),a*sin(t ),0];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "curv(circ);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "tor(circ);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "Before special types of plots can be made, the \+ following command must be issued." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "The following plot command graphs the helix in 3-space and colors it red." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "spacecurve(hel1,t=0..10*Pi,scaling=constr ained,thickness=3,color=red);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 " To plot plane curves, we can use the plot command. For example, take t he " }}{PARA 0 "" 0 "" {TEXT -1 16 "witch of Agnesi." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "witch:=[2*tan(t),2*cos(t)^2,0];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "curv(witch);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "You cannot say plot(witch ...) since you've used thr ee coordinates here. " }}{PARA 0 "" 0 "" {TEXT -1 27 "You must say (in THIS form)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 82 "plot([2*tan(t),2*cos (t)^2,t=-1.3..1.3],scaling=constrained,axes=framed,color=red);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 56 "or use the first two coordinates o f the witch as follows" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "plot([wit ch[1],witch[2],t=-1.3..1.3],scaling=constrained,axes=framed,color=red) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 162 "Notice that the square brac kets must go around the t=... as well as the parametrization. Try usin g options like `constrained` or `color` or `axes` or `thickness`." }} {PARA 0 "" 0 "" {TEXT -1 291 "Now let's use Exercise I.5.10 to try to \+ recreate a plane curve from its curvature alone. While the formula inv olves integrals which can only rarely be solved, we can still plot th e resulting curve. The Exercise referred to shows that a plane curve i s determined by its curvature as follows:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "beta(s)=[Int(cos(theta(u)),u=0..s),Int(sin(theta(u)), u=0..s)];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 5 "where" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "theta(u)=Int(kappa(t),t=0..u);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 250 "By the Fundamental Theorem of Calculus, \+ we can transform these integrals into a system of differential equatio ns to be solved numerically and plotted. The result will be the unit s peed curve with the specified curvature. First, let's take K=s itself. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 82 "sys:=diff(theta(s),s)=s, diff(b 1(s),s)=cos(theta(s)), diff(b2(s),s)=sin(theta(s));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "p:=dsolve(\{sys,theta(0)=0,b1(0)=0,b2(0)= 0\},\{theta(s),b1(s),b2(s)\},type=numeric):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 51 "test:=odeplot(p,[b1(s),b2(s)],-5..5,numpoints=200) :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "display(test,view=[-2. .2,-2..2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "?plots[odepl ot]" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "?plot[options]" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "?plot[color]" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "As a second example, take curvature=1/(1+ s^2). " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "sys:=diff(theta(s),s)=1/( 1+s^2), diff(b1(s),s)=cos(theta(s)), diff(b2(s),s)=sin(theta(s));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "p:=dsolve(\{sys,theta(0)=0,b 1(0)=0,b2(0)=0\},\{theta(s),b1(s),b2(s)\},type=numeric):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "odeplot(p,[b1(s),b2(s)],-8..8,numpo ints=200,scaling=constrained);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "What is this curve? Can you prove it?" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 175 "Now let's write a procedure to take \+ an input curvature and output the curve. Other inputs give a bound on \+ the curves parameter(a,b) and bounds on the viewing region (c,d,f,g). " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "recreate:=proc(kap,a,b,c,d,f,g) " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 " local sys,b1,b2,p,the ta,pl;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 112 " sys:=diff(thet a(s),s)=kap(s), diff(b1(s),s)=cos(theta(s)), diff(b2(s) ,s)=sin(theta(s));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 91 " p:= dsolve(\{sys,theta(0)=0,b1(0)=0,b2(0)=0\},\{theta(s),b1(s),b2(s)\},typ e=numeric): " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 69 " pl:=odepl ot(p,[b1(s),b2(s)],a..b,numpoints=200,thickness=1," }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 55 " axes=framed, color=r ed):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 " display(pl,view=[ c..d,f..g]); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 " end:" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 156 "To specify a curvature function, \+ give the parameter (t say) and use the hyphen and greater than sign to construct an arrow -> to the effect on t. Try these." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "kap1:=t->t;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "kap2:=t->t^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "kap3:=t->exp(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "kap4:=t->sin(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "kap5:= t->sin(t)*t;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "kap6:=t->si n(t)*t^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "kap7:=t->1/(1+ t^2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "recreate(kap5,-8,8 ,-2,2,0,3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "recreate(kap 7,-10,10,-4,4,0,10);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 366 "We can a lso recreate curves in space from their curvature and torsion via the \+ Frenet (differential) equations. The following procedure solves the ni ne Frenet equations together with the three equations defining the uni t tangent vector of the curve and allows you to zoom in by defining a \+ viewing region. The inputs c,d,e,f,g,h give ranges for x,y and z respe ctively." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "recreate3dview:=proc(ka p,ta,a,b,c,d,e,f,g,h)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 76 " \+ local sys,p,alph1,alph2,alph3,T1,T2,T3,N1,N2,N3,B1,B2,B3,pl;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 " sys:=diff(alph1(s), s)=T1(s),diff(alph2(s),s)=T2(s)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 53 " diff(alph3(s),s)=T3(s)," }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 80 " diff(T1(s),s)=kap(s)*N 1(s), diff(T2(s),s)=kap(s)*N2(s), " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 54 " diff(T3(s),s)=kap(s)*N3(s), " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " diff(N1(s),s)=-kap( s)*T1(s)+ta(s)*B1(s), " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " \+ diff(N2(s),s)=-kap(s)*T2(s)+ta(s)*B2(s)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 70 " diff(N3(s),s) =-kap(s)*T3(s)+ta(s)*B3(s)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 81 " \+ diff(B1(s),s)=-ta(s)*N1(s), diff(B2(s),s)=-ta(s)* N2(s), " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 " \+ diff(B3(s),s)=-ta(s)*N3(s); print(sys);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 " p:=dsolve(\{sys, alph1(0)=0,alph2(0)= 0,alph3(0)=0,T1(0)=1,T2(0)=0,T3(0)=0, " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 79 " N1(0)=0,N2(0)=1,N3(0)=0,B1(0)=0, B2(0)=0,B3(0)=1\}," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 " \+ \{alph1(s),alph2(s),alph3(s),T1(s),T2(s),T3(s),N1(s),N2(s), N3(s)," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 63 " \+ B1(s),B2(s),B3(s)\},type=numeric): " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 " pl:=odeplot(p,[alph1(s),alph2(s),alph3(s)],a.. b,numpoints=200,thickness=1," }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 " \+ axes=framed, color=red):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 " display(pl,scaling=constrained,v iew=[c..d,e..f,g..h]); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " \+ end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "Here are some exa mples. What is the first curve?" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 " recreate3dview(1/5,1/10,0,100,0,18,0,8,0,30);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "recreate3dview(1/5,1/10,-20,100,0,18,0,8,0,30); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "kap3d1:=t->t;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "recreate3dview(kap3d1,1/10,0 ,10,0.4,1.4,0.4,1.4,0.2,0.4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "tau3d1:=t->t/10;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "r ecreate3dview(kap3d1,tau3d1,0,10,0.4,1.4,0.4,1.4,0,2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "Here is the general formula for a hypotro choid:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "hypogen:=[(a-b)*c os(t)+h*cos((a-b)*t/b),(a-b)*sin(t)-h*sin((a-b)*t/b),0];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "curv(subs(\{a=1,b=1/3,h=2/3\},hypog en));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 103 "hypocurv:=t->-3/2 *(-7-6*cos(t)+8*cos(t)^3)/((-5+16*cos(t)^3-12*cos(t))*sqrt(5-16*cos(t) ^3\n+12*cos(t))):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "plot([ subs(\{a=1,b=1/3,h=2/3\},hypogen)[1],\nsubs(\{a=1,b=1/3,h=2/3\},hypoge n)[2],t=0..2*Pi]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "recre ate(hypocurv,0,2*Pi,-1,1,-1.5,0.2);" }}}}{MARK "60" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }