Example 6.1.4

This notebook contains two manipulations to expand on example 6.1.4 of the textbook, which talks about the graphical interpretation of linear combinations of vectors.

The first manipulation allows you to enter in two vectors (OverVector[v]) and (OverVector[w]) along with scalars a and b, and then creates the linear combination a(OverVector[v])+b(OverVector[w]).  The original vectors (OverVector[v]) and (OverVector[w]) will always be displayed transparently for comparison, as well as the intermediate vectors a(OverVector[v]) and b(OverVector[w]).

The second version of the manipulation lets you drag the heads of the vectors for  (OverVector[v]) and (OverVector[w]) as well as move sliders to give the values of a and b.

ShowArrows2[ pt1_, pt2_, a_, b_]:=Block[ {graphics},
graphics=Graphics[{Opacity[.3],Blue, Arrow[{{0,0},pt1}], Red, Arrow[ {{0,0},pt2}],Green, Opacity[1],Arrow[ {{0,0}, a pt1+b pt2}],Blue, Arrow[{{0,0},a pt1}], Red,Opacity[.3], Arrow[ {{0,0},b pt2}], Black, Opacity[1],Text["v",pt1/2,{1,1}],Text["w", pt2/2,{1,1}], Text["a*v+b*w", (a pt1+b pt2)/2], Text["a*v", a pt1,{-1,-1}], Text["b*w",b  pt2,{-1,1}], Line[ {a pt1, a pt1+b pt2, b pt2}]}];
Return[ Show[graphics,PlotRange->{{-30,30},{-30,30}}, AxesOrigin->{0,0}, Axes->True]]
]

Manipulate[ ShowArrows2[pt1,pt2,a,b], {{a,3,"Scalar for v:"}}, {{pt1,{-5,5},"The vector v:"}},{{b,1,"Scalar for w:"}}, {{pt2,{7,3},"The vector w:"}}, SaveDefinitions->True]

Manipulate[ ShowArrows2[pt1,pt2,a,b], {{a,3,"Scalar for v:"}, -5,5,.1, ControlType->Slider, Appearance->"Labeled"}, {{pt1,{-5,5}},Locator,Appearance->None},{{b,1,"Scalar for w:"} ,-5,5,.1, ControlType->Slider, Appearance->"Labeled"}, {{pt2,{7,3}},Locator, Appearance->None}, SaveDefinitions->True]