> # INTERSECTION OF TWO PLANES Math II Fall 1996, 9/9/96 > # > # We represent the planes parametrically and then > # plot them on the same graph. > # > with(linalg): # we want to use the crossprod function Warning: new definition for norm Warning: new definition for trace > with(plots): # we want to use the display command -------------------------------------------------------------------------------- > # > # First plane: x-3y+2z=4 > # > x1 := 1+3*r-2*s; y1 := -1+r; z1 := s; x1 := 1 + 3 r - 2 s y1 := - 1 + r z1 := s -------------------------------------------------------------------------------- > # > # Second plane: 2x-y-z=3 > # > x2 := t+u; y2 := 2*t; z2 := -3 + 2*u; x2 := t + u y2 := 2 t z2 := - 3 + 2 u -------------------------------------------------------------------------------- > # > # Call the plot of the first plane P1 > # > P1 := plot3d([x1,y1,z1],r=-2..5,s=-2..5): -------------------------------------------------------------------------------- > # > # Call the plot of the second plane P2 > # > P2 := plot3d([x2,y2,z2],t=-2..5,u=-2..5): -------------------------------------------------------------------------------- > # > # Use the display command to plot the planes on the same axes: > # > display({P1,P2},title=`Two planes`); > # > # Call the normals n1 and n2: -------------------------------------------------------------------------------- > # > n1 := vector([1,-3,2]); n2:= vector([2,-1,-1]); n1 := [ 1, -3, 2 ] n2 := [ 2, -1, -1 ] > # -------------------------------------------------------------------------------- > # Find the line of intersection of the planes: > # > L := crossprod(n1,n2); L := [ 5, 5, 5 ] -------------------------------------------------------------------------------- > # -------------------------------------------------------------------------------- > # Plot the line > # > Lplot := plot3d([1+5*v,-1+5*v,5*v],v=-1..1,w=0..1): > # > # Stick it on the same plot as the planes: > # > display({P1,P2,Lplot},title=`Planes + intersection`): -------------------------------------------------------------------------------- >