Projection

322 days ago by Mohammed

a=vector([4, -2, 3]) b=vector([2, -1, 4]) ab=a.inner_product(b) aa=a.inner_product(a) p=ab/aa*a;w=b-p print "p=", p print "w=", w 
       
p= (88/29, -44/29, 66/29)
w= (-30/29, 15/29, 50/29)
p= (88/29, -44/29, 66/29)
w= (-30/29, 15/29, 50/29)