Question: Vector products a * b = i = 1 n ( a i * b i ) Here a i and b i are the

Vector products
a*b=i=1n(ai*bi)
Here ai and bi are the ?th element of the vector and n being the dimension of the vector.
Use the function to verify that [2,6,2]*[2,1,-1] returns 8.
(b) Now, create a function that takes two vectors of dimension three in list or tuple form and returns the cross product. The cross product for two three length vectors, a=axi+ayj+azk, and b=bxi+byj+bzk is given by:
ab=(aybz-azby)i+(azbx-axbz)j+(axby-aybx)k
Verify the two lists from above return the list -8,6,-10 and show the formatted string -8i+6j-10k on the screen.
Aij=aibj
Here ai and bj are the ith and jth elements of the vectors vec(a) and vec(b), while Aij is the element of the resulting matrix in row i and column ).
For the vectors in the previous two examples, the outer product in a nested list form will be:
[[4,2,-2]
[12,6,-6]
[4,2,-2]]
Vector products a * b = i = 1 n ( a i * b i )

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 Programming Questions!