This question already has an answer here:

Geometrically the dot product of two vectors gives the angle between them (or the cosine of the angle to be precise). Algebraically, the dot product is a sum of products of the vector components between the two vectors.

However, both formulae look quite different but compute the same result. What is an easy/intuitive proof showing the equivalence between the two definitions?

I.e., demonstrate that $a_x b_x + a_y b_y + a_z b_z = \lvert a \rvert \lvert b \rvert \cos{\theta}$


marked as duplicate by rschwieb, Travis, RghtHndSd, tomasz, Semiclassical Sep 26 '14 at 14:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ This is also mostly a duplicate, although not as well written as the other one $\endgroup$ – rschwieb Sep 26 '14 at 12:55

It's quite simple after spending some time with it :)

The equivalence is derivable as below:

Geometric definition: (assuming that this is proved and we accept the intuition behind it)

$\vec{a} \cdot \vec{b} = |a|\cdot|b| \space cos\theta$

Decomposing the vector into its 'unit' vectors (assuming 2D for simplicity):

$\vec{a} = a_x \cdot \vec{i} + a_y \cdot \vec{j}$

$\vec{b} = b_x \cdot \vec{i} + b_y \cdot \vec{j}$

Multiplying the two vectors (loosely using the term 'multiplication') i.e., taking their dot product literally:

$ \vec{a} \cdot \vec{b} = a_x \cdot \vec{i} * b_x \cdot \vec{i} + a_x \cdot \vec{i} * b_y \cdot \vec{j} + a_y \cdot \vec{j} * b_x \cdot \vec{i} + a_y \cdot \vec{j} * b_y \cdot \vec{j}$


$\vec{i} \cdot \vec{i} = 1$ and $\vec{i} \cdot \vec{j} = 0$ (i.e., angle between $\vec{i}$ and $\vec{j}$, $\theta = 90 ^\circ) $ and that $a_x, a_y, b_x, b_y$ are scalars, we can simplify the above equation as:

The algebraic dot product is given by:

$ \vec{a} \cdot \vec{b} = a_x * b_x + a_y * b_y$


  • 6
    $\begingroup$ where's the equivalence? It doesn't seem you're starting from the geometric definition - except from stating it. $\endgroup$ – Giuseppe Crinò Jun 19 '17 at 21:27
  • $\begingroup$ Although I fully understand what you've done, there's still an underlying assumption that $\vec{i} \cdot \vec{i} = 1$, $\vec{i} \cdot \vec{j} = 0$. Now when I think about it I've never got a real explanation as to why this assumption is true. $\endgroup$ – Shookie Jul 1 '17 at 9:17
  • 3
    $\begingroup$ When you "multiply the two vectors", you presume the dot product distributes over vector addition (i.e., is bilinear). That's not an obvious consequence of $$a \cdot b = \|a\|\, \|b\| \cos\theta.$$On the other hand, if you assume the dot product is bilinear, this argument does little more that restate its hypotheses (the non-trivial content is in the unproven "geometric definition", as giuscri says), and particularly does not explain the equivalence of the geometric and algebraic formulas for the dot product. $\endgroup$ – Andrew D. Hwang Jul 1 '17 at 10:56

TL;DR: So, in reality, while they do look different they actually do the exact same thing, thus outputting the same result. It's just that one is in regular coordinates and the other is in polar coordinates, that's all.

Let us consider the 2D case for simplicity.

Imagine we have a vector $\mathbf{r} = (x,y)$. We can represent this vector in polar coordinates as: \begin{align} \mathbf{r} = (||\mathbf{r}||\cos(\theta), ||\mathbf{r}||\sin(\theta)) \end{align}

Consider two vectors $\mathbf{r_1}$, $\mathbf{r_2}$ with components $x_1$, $x_2$, $y_1$, $y_2$, $\theta_1$, $\theta_2$, then

$\mathbf{r_1} \cdot \mathbf{r_2} = (x_1, y_1) \cdot (x_2, y_2) = x_1x_2 + y_1 y_2$

and (in polar)

\begin{align} \mathbf{r_1} \cdot \mathbf{r_2} &= (||\mathbf{r_1}||\cos(\theta_1), ||\mathbf{r_1}||\sin(\theta_1)) \cdot (||\mathbf{r_2}||\cos(\theta_2), ||\mathbf{r_2}||\sin(\theta_2))\\ &= (||\mathbf{r_1}||)(||\mathbf{r_2}||) \cos(\theta_1) \cos(\theta_2) + (||\mathbf{r_1}||)(||\mathbf{r_2}||) \sin(\theta_1) \sin(\theta_2)\\ &= (||\mathbf{r_1}||)(||\mathbf{r_2}||) [\cos(\theta_1) \cos(\theta_2) + \sin(\theta_1) \sin(\theta_2)] \end{align}

Using the trigonmetric identity $\cos(\alpha - \beta) = \cos(\alpha) \cos(\beta) + sin(\alpha) \sin(\beta)$ yields:

\begin{align} \mathbf{r_1} \cdot \mathbf{r_2} = (||\mathbf{r_1}||)(||\mathbf{r_2}||) \cos(\theta_1 - \theta_2) \end{align} The difference in angle between both vectors is $\Delta \theta = \theta_1 - \theta_2 $. Therefore, \begin{align} \mathbf{r_1} \cdot \mathbf{r_2} = x_1x_2 + y_1y_2 = (||\mathbf{r_1}||)(||\mathbf{r_2}||)\cos(\Delta\theta) \end{align}.

  • 1
    $\begingroup$ Yes. I'm aware of that. Your proof of equivalence is by definition. I might as well say $r1 \cdot r2 = x1*y1 + x2*y2$ and show the equivalence with geometric dot product, and it'll be wrong. WHY is that? Saying that 'it is the definition of dot product' doesn't cut it, IMHO. $\endgroup$ – PhD Sep 30 '13 at 17:38
  • $\begingroup$ Basically, how does the dot product in rectangular coordinates result in calculation of the angle. THAT's the proof I'm looking for. $\endgroup$ – PhD Sep 30 '13 at 17:40
  • $\begingroup$ Well, it's hard to come up with a why. I don't know if mathematics works this way, this are or they aren't. But that's kinda mean and not very convincing. So, I've bumped into this good article that gives a good intution, i believe, on why the dot product has this equivalence: link The author of the article discusses it in terms of "directional growth". As in, you have a vector and you want to grow that vector (in its direction) by some other vector that might not be parallel. $\endgroup$ – TheSeamau5 Sep 30 '13 at 19:17
  • $\begingroup$ In the end, the author reduces it to the two techniques being equivalent. I like how he uses the physics analogies and how he shows that trying to multiply the y component of one vector by the x component of the other vector results in 0 implying that the dot product is like a big FOIL (first out in last) multiplication. He calls it component-by-component overlap. Honestly, I can't do better than this, sorry. I hope this helps. I know it kinda feels weird as a concept but I feel it's hard for me to describe the intuition of a concept. $\endgroup$ – TheSeamau5 Sep 30 '13 at 19:27
  • $\begingroup$ Yes, I have read that link before. It's quite neat but not what I was looking for. It seems you can derive one from the other. I just posted it as an answer. $\endgroup$ – PhD Oct 1 '13 at 6:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.