The dot product of two vectors, denoted by “a dot b”, is a scalar value that is calculated by taking the sum of the product of the corresponding components of the two vectors. The dot product can also be written in terms of the magnitudes of the vectors and the angle between them. One important property of the dot product is that it is commutative, meaning that “a dot b” is the same as “b dot a”. Another important property is that the dot product is distributive over vector addition. There are also several geometric interpretations of the dot product. If the dot product of two non-zero vectors is zero, then the vectors are orthogonal, or perpendicular to each other. If the dot product of two vectors is positive, then the angle between them is acute, and if the dot product is negative, the angle is obtuse. Understanding dot products is important in multivariable calculus.
- Video lecture
- Proof of Law of cosines
- The dot product and the angle between vectors
- Projection
- Notes
- Practice before homework
- Instructions: Right after being exposed to a new concept, you may not want to immediately start working on your homework without additional reading and practice. This is meant to strengthen your understanding of the ideas you were just exposed to.
- In-class activities
- Homework to be submitted on Gradescope
- Instructions: You are expected to work the problems above fully by hand. Please do not rely on the solutions when solving problems, but do use the answers to check your work and read them carefully once you are done to ensure that you are on track before submitting Gradescope. Watch the following tutorial to ensure that you are uploading your work correctly on Gradescope.
- Solutions
We will exhibit below, how to use Mathematica to compute the dot product between two vectors as shown by the codes below. In the codes below, v = {2, 3, 4}; assigns the list {2, 3, 4} to the variable v.
w = {-8, 1/2, 3/7}; assigns the list {-8, 1/2, 3/7} to the variable w.
v . w takes the dot product of the two lists v and w. The dot product of two lists of numbers is calculated by multiplying the corresponding elements of the two lists and then summing the results. In this case, the dot product of v and w is 2(-8) + 3(1/2) + 4*(3/7). This is equivalent to -16 + 3/2 + 12/7.
v = {2, 3, 4};
w = {-8, 1/2, 3/7};
v . w
Next, how would we compute the angle between these two vectors in Mathematica?
angle = ArcCos[v . w/(Sqrt[v . v] Sqrt[w . w])]
Let us for fun try to compute the angle between two pictures modeled as matrices