# NORMAL PLANE Math II, 13 Sep 96 # # -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- # We need to include linalg and plots > with(linalg): Warning: new definition for norm Warning: new definition for trace > with(plots): -------------------------------------------------------------------------------- # Set r to be an elliptical helix, and set rd to be its derivative > r:=vector([cos(t),2*sin(t),t]); r := [ cos(t), 2 sin(t), t ] > rd:=map(diff,r,t); rd := [ - sin(t), 2 cos(t), 1 ] -------------------------------------------------------------------------------- # We need to convert r and rd to forms that are usable by plot3d. # LISTS and VECTORS are two different data structures in MAPLE. # They may look the same, but MAPLE handles them differently. # If you have a list, you can use many of the commands you use with # scalars, eg, diff, evalf, subs, etc. # If you have a vector, you can calculate dot products and cross # products, and add using evalm. > v:=convert(r,list); v := [cos(t), 2 sin(t), t] > plot3d(v,t=0..4*Pi,s=0..1,grid=[50,2]): # > vdiff:=convert(rd,list); vdiff := [- sin(t), 2 cos(t), 1] -------------------------------------------------------------------------------- # # Set curve to hold the plot of the space curve > curve := plot3d(v,t=0..4*Pi,s=0..1,grid=[500,2]): # plot3d is designed for plotting surfaces. Alternatively, we can use # the SPACECURVE command to plot and store the curve. > curve2 := spacecurve(v,t=0..4*Pi): -------------------------------------------------------------------------------- # # Find the value of the curve and its derivative when t=Pi/4 # > point := evalf(subs(t=Pi/4,v)); point := [.7071067811, 1.414213563, .7853981635] > tangent := evalf(subs(t=Pi/4,vdiff)); tangent := [-.7071067813, 1.414213562, 1.] -------------------------------------------------------------------------------- # # We can now plot the derivative when t=Pi/4 # The derivative is a vector at "point" in the direction "tangent" > line := evalm(point + u*tangent); line := [ .7071067811 - .7071067813 u, 1.414213563 + 1.414213562 u, .7853981635 + 1. u ] > tanline := convert(line,list); tanline := [.7071067811 - .7071067813 u, 1.414213563 + 1.414213562 u, .7853981635 + 1. u] > plottan := spacecurve(tanline,u=-3..3): -------------------------------------------------------------------------------- # # Let's calculate the normal plane. Rather than calculating the # normal and binormal vectors, we note that the normal to the normal # plane is the tangent vector, so the normal plane is given by # # dotprod(tangent,[x,y,z]) = dotprod(tangent,point), or # # dotprod(tangent,[x,y,z]-point)=0 # # > z := 'z'; z := z > rr := vector([x,y,z]); rr := [x, y, z] > plane := dotprod(tangent,evalm(rr-point))=0; plane := - .7071067813 x - 2.285398164 + 1.414213562 y + 1. z = 0 -------------------------------------------------------------------------------- # # MAPLE plots functions z = f(x,y), so we need to solve the plane # equation for z. > z := solve(plane,z); z := .7071067813 x + 2.285398164 - 1.414213562 y -------------------------------------------------------------------------------- > planeplot := plot3d(z,x=-2..2,y=-2..2): -------------------------------------------------------------------------------- # # We display the helix, the tangent and the normal plane on the same # plot. > display3d({curve,plottan,planeplot}): --------------------------------------------------------------------------------