What does the dot product of two vectors represent?

The dot product tells you what amount of one vector goes in the direction of another. For instance, if you pulled a box 10 meters at an inclined angle, there is a horizontal component and a vertical component to your force vector. So the dot product in this case would give you the amount of force going in the direction of the displacement, or in the direction that the box moved. This is important because work is defined to be force multiplied by displacement, but the force here is defined to be the force in the direction of the displacement.

http://youtu.be/KDHuWxy53uM


Geometric Meaning

As other answers have pointed out, the dot product $\vec{a} \cdot \vec{b}$ is related to the angle $\theta$ between $\vec{a}$ and $\vec{b}$ through:

$$\vec a \cdot \vec b = \Vert\vec a\Vert_2 \, \Vert\vec b\Vert_2 \, \cos \theta$$

Assuming that $a$ and $b$ point into similar directions, i.e., $\theta \leq 90°$, we can visualize what this relationship means (skipping the vector arrows and Euclidean norm subscript from now on):

enter image description here

$p$ is the vector resulting from an orthogonal projection of $a$ onto $b$. As the $\cos$ is the ratio between the adjacent leg ($p$) and the hypotenuse ($a$) in the right triangle, i.e.,

$$\cos \theta = \frac{\Vert p \Vert}{\Vert a \Vert},$$

we get for the inner product:

$$a \cdot b = \Vert a \Vert \, \Vert b \Vert \, \frac{\Vert p \Vert}{\Vert a \Vert} = \Vert p \Vert \Vert b \Vert$$

So, the inner product is the length of the vector $p$, the projection of $a$ onto $b$, multiplied by the length of $b$. If $a$ and $b$ point into opposite directions, i.e., $90° < \theta \leq 180°$, the dot product will be the negative: $a \cdot b = - \Vert p \Vert \Vert b \Vert$

Derivation

The problem is that the relationship between the dot product and the angle $\theta$ is not inherently given. By definition:

$$a \cdot b = \sum_i a_i b_i$$

So, we need to find a link between this and the cosine. From the definition of the dot product, we can see that it scales proportionally with the input vectors, so for non-unit vectors $u$ and $v$ with the corresponding unit vectors $\hat{u}$ and $\hat{v}$:

$$u \cdot v = \Vert u \Vert \cdot \Vert v \Vert \cdot \hat{u} \cdot \hat{v}$$

For simplicity, we will assume $a$ and $b$ to be unit vectors. Thus, we only need to show

$$a \cdot b = \cos \theta$$

or, by the definition of $\cos$, we need to show:

$$a \cdot b = \Vert p \Vert $$

Let's calculate the length of the projection $p$ using $a$ and $b$. We can start by using the Pythagorean theorem:

$$ \Vert p \Vert ^2 = \Vert a \Vert ^2 - \Vert c \Vert ^2$$

Because $a$ is a unit vector:

$$ \Vert p \Vert ^2 = 1 - \Vert c \Vert ^2$$

Now, we need to calculate the length of $c$ using the other rectangular triangle. Again, we use the fact that $b$ is a unit vector, i.e., $ \Vert b \Vert = 1$.

$$ \begin{align} \Vert c \Vert ^2 &= \Vert d \Vert ^2 - (\Vert b \Vert - \Vert p \Vert)^2 \\ &= \Vert d \Vert ^2 - (1 - \Vert p \Vert)^2 \\ &= \Vert d \Vert ^2 - 1 + 2 \Vert p \Vert - \Vert p \Vert^2 \end{align} $$

Now, we can insert this term for $\Vert c \Vert ^2$ in the equation above:

$$ \begin{align} \Vert p \Vert ^2 &= 1 - \Vert d \Vert ^2 + 1 - 2 \Vert p \Vert + \Vert p \Vert^2 \\ 0 &= 2 - \Vert d \Vert ^2 - 2 \Vert p \Vert \\ 2 \Vert p \Vert &= 2 - \Vert d \Vert ^2 \end{align} $$

In the figure, we see that $\vec a + \vec d = \vec b$. Therefore, $\vec d = \vec b - \vec a$, or:

$$d_i = b_i - a_i$$

Thus, we can express $\Vert d \Vert^2$ as:

$$ \begin{align} \Vert d \Vert ^2 &= \sum_i d_i^2 \\ &= \sum_i (b_i - a_i)^2 \\ &= \sum_i b_i^2 - 2 b_i a_i + a_i^2 \\ &= \sum_i b_i^2 - \sum_i 2 b_i a_i + \sum_i a_i^2 \\ &= \Vert b \Vert^2 - \sum_i 2 b_i a_i + \Vert a \Vert^2 \\ &= 1 - \sum_i 2 b_i a_i + 1 \\ &= 2 - 2 \sum_i b_i a_i \end{align} $$

Finally:

$$ \begin{align} 2 \Vert p \Vert &= 2 - \Vert d \Vert ^2 \\ &= 2 - (2 - 2 \sum_i b_i a_i) \\ &= 2 \sum_i b_i a_i \\ \Vert p \Vert &= \sum_i b_i a_i \end{align} $$

q.e.d.


It might help to think of multiplication of real numbers in a more geometric fashion. $2$ times $3$ is the length of the interval you get starting with an interval of length $3$ and then stretching the line by a factor of $2$.

For dot product, in addition to this stretching idea, you need another geometric idea, namely projection. Imagine the line $L$ parallel to $\vec b$ through the origin $O$. Now imagine projecting from the tip of the vector $\vec a$, along a line perpendicular to $L$, until hitting $L$ at a point $P$. The dot product $\vec a \cdot \vec b$ is the length of the line segment you get by starting with the line segment $OP$ and then stretching the plane by a factor equal to the length of $\vec b$.

I'm being a little careless about plus and minus signs, but those can be incorporated into this picture too.


I think of dot product as the "same-ness" of two vectors. If two vectors are orthogonal (90 degrees on one another) they are 'not at all the same' (dot product =0), and if they are parallel they are 'very much the same'. If you divide their dot product by the product of their magnitude, that is the argument for an arccosine function to find the angle between them. My application for the dot product is finding the angle between two vectors for calculating the force required to pull a cable through two or more pipes with a bend. It's hard to do this in a three dimensional world without knowing how to calculate the dot product. Math makes life really easy :)


First of all, if we write $\vec{a} = a \vec{u}$ and $\vec{b} = b \vec{v}$, where $a$ and $b$ are the length of $\vec{a}$ and $\vec{b}$ respectively, then $$\vec{a} \cdot \vec{b} = (a \vec{u})\cdot (b \vec{v}) = ab \,\, \vec{u} \cdot \vec{v};$$ this is a pretty natural property for a product to have.

Now as for $\vec{u} \cdot \vec{v}$, this is equal to $\cos \theta,$ where $\theta$ is the angle between $\vec{u}$ and $\vec{v}$.

As King Squirrel notes, this is also the length of the projection of $\vec{u}$ onto the line through $\vec{v}$, and also the length of the projection of $\vec{v}$ onto the line through $\vec{u}$.

So altogether we get

$$\vec{a} \cdot \vec{b} = a b \, \cos \theta,$$ and it has the interpretation in terms of projecting one vector onto another that King Squirrel discusses.