905 MrG How to Dot Product?

2581 days ago by MATH4R2013

#v.dot_product(w)=vx*wx+vy*wy v=vector([2,-3]) w=vector([5,3]) d=v.dot_product(w) show(v) show(w) show(d) 
       


#w.dot_product(v)=wx*vx+wy*vy d=w.dot_product(v) show(d) 
       
#abs(v)=sqrt(v.dot_product(v)) d=v.dot_product(v) show(d) show(abs(v)) 
       

#abs(w)=sqrt(w.dot_product(w)) d=w.dot_product(w) show(d) show(abs(w)) 
       

#v.dot_product(w)=abs(v)*abs(w)*cos(theta), find theta! v=vector([4,-3]) w=vector([2,5]) d=v.dot_product(w) show(d) show(d/abs(v)/abs(w)) show((arccos(d/abs(v)/abs(w))).n()) show((arccos(d/abs(v)/abs(w))*180/pi).n()) v1=plot(v) w1=plot(w) show(v1+w1,aspect_ratio=1)