Proof of equivalence of algebraic and geometric dot product? [duplicate]
Solution 1:
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}.
Solution 2:
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}$
Using:
$\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$
$Q.E.D.$