Question: 3.21 Vector inner product Write a python program to input two vectors and compute and print their inner product as follows: given v1=(x1,71,z1) and v2=(x2,y2,z2),

 3.21 Vector inner product Write a python program to input two

3.21 Vector inner product Write a python program to input two vectors and compute and print their inner product as follows: given v1=(x1,71,z1) and v2=(x2,y2,z2), inner_product(v1,v2)=x1 * x2 + y1* y2 + z1 * 22. Input each vector using a single input statement (details in template), e.g. enter x1, yl, z1 :: 1,2,3 enter x2,y2, 22 :: 4,5,6 output a single line formatted to print the two input vectors and the inner product value. e.g.: inner product of vl=[1.0, 2.0, 3.0], v2=[4.0, 5.0, 6.0] is 32.0 what data structure is best suited to store each vector? why? note that for computing the inner product, python's numpy package can be used: import numpy inner_product=numpy.inner (v1,v2) print (inner_product) we will see more of numpy in later sections

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!