Laboratory 3
Projections, Lines, and Planes

Code

comp[b_,a_]:=a.b/Sqrt[a.a]

proj[b_,a_]:=comp[b,a]a/Sqrt[a.a]

vector[a_,b_,c_:0]:=If[c==0,Return[Graphics[{Arrowheads[Medium],Arrow[{a,b}]}]],Return[Graphics[{Hue[c],Arrowheads[Medium],Arrow[{a,b}]}]]]
vector3d[a_,b_,c_:0]:=Module[{d},
d=Norm[b-a];
If[c==0,Return[Graphics3D[{Thick,Black,Line[{a,b}],Translate[Rotate[Scale[Table[{EdgeForm[],Polygon[{{.25Cos[j(Pi/6)],.25Sin[j(Pi/6)],0},{.25Cos[(j+1)(Pi/6)],.25Sin[(j+1)(Pi/6)],0},{0,0,1}}]},{j,0,11}],d/10,{0,0,0}],{{0,0,1},b-a}],(9b+a)/10]}]],
Return[Graphics3D[{Thick,Hue[c],Line[{a,b}],Translate[Rotate[Scale[Table[{EdgeForm[],Polygon[{{.25Cos[j(Pi/6)],.25Sin[j(Pi/6)],0},{.25Cos[(j+1)(Pi/6)],.25Sin[(j+1)(Pi/6)],0},{0,0,1}}]},{j,0,11}],d/10,{0,0,0}],{{0,0,1},b-a}],(9b+a)/10]}]]
]
]

Experiment 3.1a

1.  Let (OverVector[a])=(5,2)  and (OverVector[b])=(2,3). Find the projection of (OverVector[b]) in the direction of (OverVector[a]), as well as the component of (OverVector[b]) in the direction of (OverVector[a]). Graph (OverVector[a]), (OverVector[b]), and the projection of (OverVector[b]) in the (OverVector[a]) direction, and label the results.

Experiment 3.1b

2. Let (OverVector[a])=(5,2,-4)  and (OverVector[b])=(2,3,-2). Find the projection of (OverVector[b]) in the direction of (OverVector[a]), as well as the component of (OverVector[b]) in the direction of (OverVector[a]). Graph (OverVector[a]), (OverVector[b]), and the projection of (OverVector[b]) in the (OverVector[a]) direction, and label the results.

Experiment 3.2

1. Find the equation of the plane passing through the point P(-5,-3,-2) and perpendicular to the line through P and the point Q(-7,-4,6). Then find the equation of the line through P and Q, and plot both the plane and the line on the same graph.

Experiment 3.3

1. Find an equation for the line of intersection of two planes given by 3x-y+z=2 and 2x+y-2z=0. Check your work by graphing both planes and the line of intersection.

Experiment 3.4

1.Find the distance between the point P(1,0,5) and the plane given by 2x+y-z=3.