Ch-1.3-Prob-10-New-박종우

1895 days ago by matrix

a=vector([2, -1, 0,-2]) b=vector([4, -7, 2,-6]) ab=a.inner_product(b) aa=a.inner_product(a) p=ab/aa*a w=b-p print "p=", p print "w=", w 
       
p= (6, -3, 0, -6)
w= (-2, -4, 2, 0)
p= (6, -3, 0, -6)
w= (-2, -4, 2, 0)