> # hw 5\ # 11.5\ with(linalg): Warning: new definition for norm Warning: new definition for trace -------------------------------------------------------------------------------- > # 45 These planes are parallel since the angle is 180 degrees -- you can also check with crossprod\ n1:=[2,4,-2];n2:=[-3,-6,3];\ costheta:=dotprod(n1,n2)/(norm(n1,2)*norm(n2,2));\ theta:=arccos(costheta); n1 := [2, 4, -2] n2 := [-3, -6, 3] costheta := -1 theta := Pi -------------------------------------------------------------------------------- > # 49 add z=z to the list below\ solve({z=x+y,2*x-5*y-z=1},{x,y}); {y = 1/7 z - 1/7, x = 6/7 z + 1/7} -------------------------------------------------------------------------------- > # or\ solve({z=x+y,2*x-5*y-z=1},{x,y,z}); {z = 7 y + 1, x = 6 y + 1, y = y} -------------------------------------------------------------------------------- > # 53\ directionofline:=crossprod([1,1,-1],[2,-1,3]);\ pointonline:=solve({x+y-z=2,2*x-y+3*z=1,z=0}); directionofline := [ 2, -5, -3 ] pointonline := {z = 0, y = 1, x = 1} -------------------------------------------------------------------------------- > n:=crossprod(directionofline,add([1,1,0],[-1,2,1],1,-1));\ eqn:=dotprod(n,add([x,y,z],[-1,2,1],1,-1))=0; n := [ 2, -4, 8 ] eqn := 2 x + 2 - 4 y + 8 z = 0 -------------------------------------------------------------------------------- > #57\ direction:=crossprod([1,1,1],[1,-1,2]);\ eqn:=[x,y,z]=add([0,1,2],scalarmul(direction,t)); direction := [ 3, -1, -2 ] eqn := [x, y, z] = [ 3 t, 1 - t, 2 - 2 t ] -------------------------------------------------------------------------------- > #61\ p:=[1,2,3];q:=[2,2,0];r:=[3,-1,5];\ a:=add(r,q,1,-1); b:=add(p,q,1,-1);\ norm(crossprod(a,b),2)/norm(a,2); p := [1, 2, 3] q := [2, 2, 0] r := [3, -1, 5] a := [ 1, -3, 5 ] b := [ -1, 0, 3 ] 1/2 1/2 1/35 154 35 -------------------------------------------------------------------------------- > #65 find point on plane1 and then use distance formula\ solve({z=x+2*y+1,x=0,y=0},{x,y,z});\ {x = 0, y = 0, z = 1} -------------------------------------------------------------------------------- > abs( 3*0+6*0-3*1-4)/sqrt(3^2+6^2+3^2); 1/2 7/18 6