# SPACE CURVES Math II, 11 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 the twisted cubic, and set rd to be its derivative > r:=vector([t,t**2,t**3]); 2 3 r := [ t, t , t ] > rd:=map(diff,r,t); 2 rd := [ 1, 2 t, 3 t ] -------------------------------------------------------------------------------- # We need to convert r and rd to forms that are usable by plot3d > v:=convert(r,list); 2 3 v := [t, t , t ] > plot3d(v,t=-2..2,s=0..1,grid=[500,2]); # In the plot3d command, s is a dummy parameter and the grid option # tells MAPLE to plot using 500 subintervals in t and 2 in s. # > vdiff:=convert(rd,list); 2 vdiff := [1, 2 t, 3 t ] -------------------------------------------------------------------------------- # # Set curve to hold the plot of the space curve > curve := plot3d(v,t=-2..2,s=0..1,grid=[500,2]): -------------------------------------------------------------------------------- # # Find the value of the curve and its derivative when t=1 > subs(t=1,v); [1, 1, 1] > subs(t=1,vdiff); [1, 2, 3] -------------------------------------------------------------------------------- # # We can now plot the derivative when t=1 # The derivative is a vector at [1,1,1] in the direction [1,2,3] > deriv:=plot3d([1+u,1+2*u,1+3*u],u=0..1,w=0..1,grid=[20,2]): -------------------------------------------------------------------------------- # # and we display the curve and its derivative on the same plot. > display({curve,deriv}): -------------------------------------------------------------------------------- >