p1_mrg_vector1

352 days ago by calcpage123

#initialize vectors in R^3 a=vector([1,2,3]) a 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left(1,2,3\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(1,2,3\right)
b=vector([-1,0,5]) b 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-1,0,5\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-1,0,5\right)
#vector sums c=a+b show(c) d=a-b show(d) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\left(0,2,8\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(2,2,-2\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(0,2,8\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(2,2,-2\right)
#vector plots a.plot(rgbcolor='red')+b.plot(rgbcolor='blue')+c.plot(rgbcolor='green') 
       
#vector magnitudes lenA=norm(a) lenB=norm(b) lenC=norm(c) lenD=norm(d) show(lenA) show(lenB) show(lenC) show(lenD) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{14}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{26}
\newcommand{\Bold}[1]{\mathbf{#1}}2 \, \sqrt{17}
\newcommand{\Bold}[1]{\mathbf{#1}}2 \, \sqrt{3}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{14}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{26}
\newcommand{\Bold}[1]{\mathbf{#1}}2 \, \sqrt{17}
\newcommand{\Bold}[1]{\mathbf{#1}}2 \, \sqrt{3}
#scalar product e=a*b e 
       
\newcommand{\Bold}[1]{\mathbf{#1}}14
\newcommand{\Bold}[1]{\mathbf{#1}}14
f=sum(ai*bi for ai,bi in zip(a,b)) f 
       
\newcommand{\Bold}[1]{\mathbf{#1}}14
\newcommand{\Bold}[1]{\mathbf{#1}}14
g=a.dot_product(b) g 
       
\newcommand{\Bold}[1]{\mathbf{#1}}14
\newcommand{\Bold}[1]{\mathbf{#1}}14
#find theta between vector a and b using dot product theta1=arccos(e/(lenA*lenB)) show(n(theta1)) theta2=theta1*180/pi show(n(theta2)) 
       
\newcommand{\Bold}[1]{\mathbf{#1}}0.746898593069036
\newcommand{\Bold}[1]{\mathbf{#1}}42.7941371071149
\newcommand{\Bold}[1]{\mathbf{#1}}0.746898593069036
\newcommand{\Bold}[1]{\mathbf{#1}}42.7941371071149