Dot Product Intuition

27.1k Views Asked by At

I'm searching to develop the intuition (rather than memorization) in relating the two forms of a dot product (by an angle theta between the vectors and by the components of the vector ).

For example, suppose I have vector $\mathbf{a} = (a_1,a_2)$ and vector $\mathbf{b}=(b_1,b_2)$. What's the physical or geometrical meaning that

$$a_1b_1 + a_2b_2 = |\mathbf{a}||\mathbf{b}|\cos(\theta)\;?$$

Why is multiplying $|\mathbf{b}|$ times $|\mathbf{a}|$ in direction of $\mathbf{b}$ the same as multiplying the first and second components of $\mathbf{a}$ and $\mathbf{b}$ and summing ?

I know this relationship comes out when we use the law of cosines to prove, but even then i cant get a intuition in this relationship.

This image clarifies my doubt:

enter image description here

Thanks

4

There are 4 best solutions below

2
On

I found a reasonable proof using polar coordinates. Lets suppose the point "$a$" points is $(|a|\cos(r)$ , $|a|\sin(r) )$ and the point vector "$b$" points is ($|b|\cos(s),|b|\sin(s) $). Then doing the definition of the scalar product we get :

$a\cdot b = |a||b|\cos(r)\cos(s) + |b||a|\sin(r)\sin(s) = |a||b|\cos(r - s)$. But $\cos(r-s) = \cos(\theta)$ where theta is the angle between the vectors.

So, $a\cdot b = |a||b|\cos(\theta)$.

2
On

The equivalence between the two definitions comes directly from the pythagorean theorem, for which the length of a vector is $$|v|=\sqrt{v_1^2+v_2^2+v_3^2},$$ where $v_i$ are the coordinates respect to some orthonormal basis (the word “some” here is important).

To see this, let $\cal V^3$ be the space of geometric vectors and $\cal B=${$e_1,e_2,e_3$}, $\cal B'$={$e'_1,e'_2,e'_3$} be two orthonormal bases of $\cal V^3$. Take $u,v\in \cal V ^3$. To show the equivalence beetween the two definitions, I'll first show that the expression $$u\cdot v=\sum u_iv_i$$ does not depend on the choice of a basis. Since the length of a vector does not depend on which set coordinates we use to evaluate it, we have:$$v _1 ^2+v _2 ^2+v _3 ^2=|v|^2=v _1' ^2+v _2' ^2+v _3' ^2,$$ where $v_i,v_i'$ are the coordinates with respect to $\cal B$ and $\cal B'$, and the same result holds for $u$. Now:$$\sum (u_i^2 +v_i^2)+\sum 2u_iv_i=\sum (u_i+v_i)^2=|u+v|^2$$

so $$\sum (u_i^2 +v_i^2)+\sum 2u_iv_i=\sum (u_i'^2 +v_i'^2)+\sum 2u_i'v_i',$$ and finally $$\sum u_iv_i=\sum u_i'v_i'.$$ So we can freely choose $\cal B$ to evaluate $u\cdot v$ and take $e_1=\frac{v}{|v|}$. This completes the proof.


If you are comfortable with some linear algebra, you can observe that the function that maps the coordinates $y$ of $u$ and $x$ of $v$ respect to $\cal B$ in the ones respect to $\cal B'$ is linear and given by an orthogonal matrix. So $$y^Tx=y^T (A^T A)x=(y^T A^T)(Ax)=y'^Tx'.$$

2
On

Say you have a triangle with an hypotenuse of length $c$ in the plane. The hypotenuse starts at (0,0) and goes into the plane at some angle $\alpha$.

Triangle

Your x-coordinate $b$, is equal to $||c||\cos(\alpha)$. Remember that $\cos(\alpha)\in[-1,1]$, so you can think about $||c||\cos(\alpha)$ as the fraction of the length of $c$ that points in the horizontal direction.

Now take the dot product $c\cdot b=(\,\,||c||\cos(\alpha)\,\,)||b||$. You are taking the part of $||c||$ that is pointing in the same direction as $||b||$ and using that for multiplying with $||b||$.

To see that this also works when $b$ isn't coinciding with the x-axis, stick a pin in the $\alpha$-corner and rotate the triangle.

I (at least) think this makes sense, two vectors have their own length and their own different directions, which means the vectors' lengths are "distributed" differently in each direction. If you want to multiply two vectors as is they were numbers, multiply the length they have in common.

So why should this equal $c_1b_1+c_2b_2$? Because of the Pythagorean theorem.

Let's say you have two vectors, $v$ and $v'$. In the case where $v=v'$, we have that $v_1v'_1+v_2v_2'=||v|| \,||v'||\cos(0)\,\,\Leftrightarrow\,\, v_1^2+v_2^2=||v||^2$, this is the familiar squares of the sides equal the square of the hypotenuse.

If you want to be a bit rude, you can think of $a_1b_1+a_2b_2=||a|| \,||b||\cos(\theta)$ as the Pythagorean theorem for when you split up the hypotenuse into different vectors, $\cos(\theta)$ then becomes a discount factor for the loss of 'shared direction' of your 'two hypotenuses'.

0
On

cos(α−β) = cos(α)cos(β) + sin(α)sin(β)

I hope the picture shows the basic intuition underlying the definition itself of dot products.

I wished to develop the picture by Processing, by processing.org, which I consider a very interesting tool, although not so apt to develop a picture like this one.

Comments welcome