Ch-1-prob-10-final-오충헌

1927 days ago by matrix

x=vector([2, -1, 3]) y=vector([4, -1, 2]) xy=x.inner_product(y) xx=x.inner_product(x) p=xy/xx*x;w=y-p print "p=", p print "w=", w 
       
p= (15/7, -15/14, 45/14)
w= (13/7, 1/14, -17/14)
p= (15/7, -15/14, 45/14)
w= (13/7, 1/14, -17/14)