GraphingCalculator 4; Window 45 21 839 927; PaneDivider 386; FontSizes 18; BackgroundType 0; 2D.BottomLeft -1.984375 -2.640625; 2D.GraphPaper 0; 2Dp.Scale 0.5 0.5 2 2; 2Dp.BottomLeft -4.78125 -1.75; 2Dp.GraphPaper 0; Text "Scalar product of two vectors. Version 0.35 [2-6-14] Note at some point along the line, GC decided it did not like the use of A,B as both subscripts labelling the lengths and angles L_a,b and T_a,b and also as names for the corresponding vectors. For now it seems ok with using a,b, as labels, tbough. To do: (i) 3D? (no – begin with file 2vectors) Tip of the vectors A, B and their components"; Color 7; Expr a=2.8125+0.53125*i; Color 5; Expr b=-0.28125-(1.171875*i); Expr L_a=abs(a),L_b=abs(b),C=abs(a)*abs(b); Color 3; Expr T_a=branch(if(atan([Im([a])/Re([a])]),Re([a])>0),if(atan([Im([a])/Re([a])])+pi,Re([a])<0)); Color 2; Expr T_b=branch(if(atan([Im([b])/Re([b])]),Re([b])>0),if(atan([Im([b])/Re([b])])+pi,Re([b])<0)); Color 6; Expr A_1=L_a*cos(T_a),A_2=L_a*sin(T_a),B_1=L_b*cos(T_b),B_2=L_b*sin(T_b); Color 3; Expr A=vector(A_1,A_2); Color 4; Expr B=vector(B_1,B_2); Color 7; Expr A; Color 7; Expr B; Color 2; Expr O,A; Color 3; Expr O,B; Text "Unit vectors and origin:"; Color 4; Expr A_h=A/L_a,B_h=B/L_b,O=vector(0,0); Color 17; Expr O,A_h; Color 17; Expr O,B_h; Text "Scalar product plotted with vectors:"; Color 17; Expr O,[dot(A,B)/L_b]*A_h; Color 17; Expr O,[dot(A,B)/L_a]*B_h; Text "Perpendiculars:"; Color 17; Expr dot(A,B)/L_b*B_h,A; Color 17; Expr dot(A,B)/L_a*A_h,B; Color 8; Expr vector(prime(x),prime(y))=vector(0,dot(A,B)); Color 8; Expr abs(prime(y))=abs(a)*abs(b); Text "Angle between A and B:"; Expr P=acos([dot(A_h,B_h)]); Color 17; Expr vector(prime(x),prime(y))=vector(P,dot(A,B)); Color 7; Expr vector(prime(x),prime(y))=vector(P,dot(A,B)/(L_a*L_b)); Color 3; Expr cos(prime(x)); Text "Shade angle between the vectors. (Need to fix in 4th quadrant; something to do with definitions of angles Ta, Tb.)"; Color 7; Expr min([T_a,T_b])Author: David A. Craig <"; Text "";