Example 6.2.2

This notebook contains manipulations for Example 6.2.2 of the text, which details how to find the area of a tringle in terms of the vectors which are two sides.  We assume that the 2 vectors (OverVector[v]) and (OverVector[w]) start at the origin so that the third side is given by the vector v-w. The formula for the area is then A=(Sqrt[(((|(OverVector[v])|))^2)(((|(OverVector[w])|))^2)-((((OverVector[v])·(OverVector[w])))^2)]).

In the first manipulation you may drag the vectors (OverVector[v]) and (OverVector[w]) about by moving their heads.  In the second, you may enter in precise coordinates for the heads of the vectors.

TriangleDiagram[ pt1_, pt2_]:=
Block[ {proj,norm1,norm2, dotproduct,angle,graphics,height,v,w,i},
norm1=Norm[pt1];
norm2=Norm[pt2];
proj=(pt1.pt2)/norm2^2 pt2;
dotproduct=pt1.pt2;
height=Norm[ pt1-proj];
angle= 180./Pi ArcCos[ pt1.pt2/(norm1 norm2)];
graphics={Red, Arrow[{ {0,0}, pt1}], Green, Arrow[{ {0,0}, pt2}],Blue, Arrow[ { pt2, pt1}], Black,Line[ {proj, pt1}], Text[ "(OverVector[v])",pt1/2,{0,1.5}], Text[ "θ", (pt1+pt2)/Norm[pt1+pt2]*1/2],
 Text[ "(OverVector[w])",pt2/2,{0,1.5}], Text[ "(OverVector[v])-(OverVector[w])",(pt1+pt2)/2,{0,-1.5}],Text["H", (proj+pt1)/2,{0,-1}]};
Return[Column[{Show[ Graphics[graphics], ImageSize->300, Axes->True, Ticks->{ Table[i,{i,-5,5}],Table[i,{i,-5,15}]}, PlotRange->{{-5,5},{-5,5}}], Row[{"(OverVector[v]) is the vector ",pt1}],
Row[{"(OverVector[w]) is the vector ",pt2}],Row[{"The norm of (OverVector[v]) is ",Norm[pt1]}],
Row[{"The norm of (OverVector[w]) is ",Norm[pt2]}],
Row[{"The dot product of (OverVector[v]) and (OverVector[w]) is ",dotproduct}],Row[{"The area is",  √(((TraditionalForm[Norm[(OverVector[v])]])^2) ((TraditionalForm[Norm[(OverVector[w])]])^2)-((((OverVector[v])·(OverVector[w])))^2))," = ",Sqrt[Norm[pt1]^2Norm[pt2]^2-dotproduct^2]}]}]
]
]

Manipulate[TriangleDiagram[p1,p2],{{p1,{1,4}},Locator, Appearance->None},{{p2,{4,4}},Locator, Appearance->None}, SaveDefinitions->True]

Manipulate[TriangleDiagram[p1,p2],{{p1,{1,4},"The vector v"}},{{p2,{4,4},"The vector v"}}, SaveDefinitions->True]