The Dot Product

Example 12.3.8

v={(1/(Sqrt[2])),(1/(Sqrt[3]))}
u={(1/(Sqrt[2])),-(1/(Sqrt[3]))}

Part a

v.u

(Sqrt[v.v])

(Sqrt[u.u])

Part b

((u.v)/((Sqrt[u.u])(Sqrt[v.v])))

Part c

((u.v)/(Sqrt[v.v]))

Part d

(((u.v)/(v.v)))*v

Example 12.3.18

i={1,0,0};
j={0,1,0};
k={0,0,1};

u=j+k
v=i+j

Vector that is parallel to v:

parallel=(((u.v)/((((Sqrt[v.v])))^2)))*v

Vector that is orthogonal to v:

orthogonal=u-(((u.v)/((((Sqrt[v.v])))^2)))*v

Here is a plot, using the vector module from class:

plotvector3D[{x_,y_,z_},color_,opts_]:=Module[{line,head,headsize},
headsize=0.015*(Sqrt[(x^2)+(y^2)+(z^2)]);
head=Sphere[{x,y,z},headsize];
line=Line[{{0,0,0},{x,y,z}}];
Return[Graphics3D[{color,opts,line,head}]];
]

plot1=Show[plotvector3D[u,Red,Thick],plotvector3D[v,Blue,Thick],Axes->True,AxesLabel->{"x","y","z"}]

plot2=Show[plotvector3D[parallel,Darker[Green],Thickness[0.015]],plotvector3D[orthogonal,Darker[Green],Thickness[0.015]],Axes->True,AxesLabel->{"x","y","z"}]

Show[plot1,plot2]

Example 12.3.32

u={u1,u2,u3}
v1={a,b,c}
v2={d,e,f}

Here is the equation that must be satsified:

eq=u.v1==u.v2

If the only solution is v1=v2, then we should find a=d, b=e, and c=f (obviously this won't happen since the equation is underdetermined).

Solve[eq,{a,b,c}]

Here is a numerical example, where v1 is not the same as v2, and the equation is satisfied.

u1=u2=u3=3;
b=1;
c=3;
d=3;
e=4;
f=5;
a=-((b u2)/u1)-((c u3)/u1)-((-d u1-e u2-f u3)/u1);

u
v1
v2
eq

Example 12.3.48

plot1=Plot[{(Sqrt[3])x-1,-(Sqrt[3])x+2},{x,0,3},AxesLabel->{"x","y"},AspectRatio->2,PlotRange->{{0,3},{-3,3}}]

Note that's inportant to get the aspect ratio set right if you want to verify visually that lines are perpendicular later on!

Intersection:

Solve[{y==(Sqrt[3])x-1,y==-(Sqrt[3])x+2},{x,y}]
intersection={x,y}/.Flatten[%]

Parallel

v1={1,(Sqrt[3])};
v2={-1,(Sqrt[3])};

perplines=Show[Graphics[{Red,Thick,Line[{intersection,intersection+v1}],Line[{intersection,intersection+v2}]}]];
Show[plot1,perplines]

The angle between the lines is given by:

ArcCos[((v1.v2)/((Sqrt[v1.v1])(Sqrt[v2.v2])))]

Perpendicular

v1={(Sqrt[3]),-1};
v2={(Sqrt[3]),1};

perplines=Show[Graphics[{Red,Thick,Line[{intersection,intersection+v1}],Line[{intersection,intersection+v2}]}]];
Show[plot1,perplines]

Note that if you don't get the aspect ratio set correctly here, your lines will not appear to be perpendicular.

The angle between the lines is given by:

ArcCos[((v1.v2)/((Sqrt[v1.v1])(Sqrt[v2.v2])))]