# Why do you calculate the dot product that way?

I am learning dot product these days. I understand the geometric meaning of one vector's interpretation in the same direction of the other to calculate the work in terms of force and distance in the designated direction in physics.

However, I don't understand why this calculation is same as the dot product of two vectors. I only understand the dot product of two vectors should be 0 when orthogonal because it's obvious that the two vectors slopes are perpendicular.

My question is why and how do you connect the calculation of dot product to the geometric meaning?

• When you say "that way", do you mean $u\cdot v= |u|\,|v|\cos \theta$ or do you mean $u\cdot v=u_xv_x + u_yv_y$?
– MJD
Dec 20, 2021 at 13:33
• To show us what you mean, I think you'll want to write some math formulas. This should help: math.stackexchange.com/help/notation Dec 20, 2021 at 13:35
• It would help if you explain the two different ways of calculating the dot product which you think are in conflict. When you say "one vector's interpretation" - do you mean the length of the component of $\mathbf{x}$ in the direction of $\mathbf{y}$? Dec 20, 2021 at 13:36
• @MJD I meant the second way: u⋅v=ux vx+uyvy Dec 20, 2021 at 19:00
• Other questions about what I think this question is about (although it's not quite clear, to be honest): math.stackexchange.com/questions/777531/…, math.stackexchange.com/questions/509719/…, math.stackexchange.com/questions/116133/…, math.stackexchange.com/questions/2380217/…, etc. Dec 20, 2021 at 21:14

If you are familiar with how to represent a vector in the polar coordinate system and with trigonometric identities, you can easily get some insight.

Consider the two vectors $$a = (a_1, a_2)$$ and $$b = (b_1, b_2)$$. Then, $$a_1 = |a|\cos \alpha$$, $$a_2 = |a|\sin \alpha$$, $$b_1 = |b|\cos \beta$$, and $$b_2 = |b|\sin \beta$$, where $$\alpha$$ and $$\beta$$ are angles of $$a$$ and $$b$$ with respect to the $$x$$-axis, respectively. Then, the signed angle between $$a$$ and $$b$$ is $$\theta = \beta - \alpha$$.

From the trigonometric identity, $$\cos\theta = \cos (\beta - \alpha) = \cos\beta\cos\alpha + \sin\beta\sin\alpha = \frac{1}{|a||b|}(a_1 b_1 + a_2 b_2)$$

Therefore, we have $$|a||b|\cos\theta = a_1 b_1 + a_2 b_2$$, which is $$a\cdot b$$.

We can extend the notion to general $$n$$-dimensional vectors.

Let $$v,w$$ be two vectors. Together with their sum $$v+w$$ the form a triangle. The cosine law states that the angle $$\alpha$$ between the sides $$v$$ and $$w$$ now satisfies

$$\vert v+w\vert^2=\vert v\vert^2+\vert w\vert^2-2\vert v\vert\vert w\vert\cos\alpha.$$

Since the usual angle between the vectors $$v$$ and $$w$$ is $$\beta=90^\circ-\alpha$$, this yields

$$\vert v+w\vert^2=\vert v\vert^2+\vert w\vert^2+2\vert v\vert\vert w\vert\cos\beta.$$

We get

$$\vert v\vert\vert w\vert\cos\beta=\frac12(\vert v+w\vert^2-\vert v\vert^2-\vert w\vert^2)=v_1w_1+v_2w_2+v_3w_3.$$

This means that the two usual ways of defining the inner product - one geometric, one in coordinates - are equal. The last step just requires doing the slightly tedious calculation of evaluating all the moduli.

Sorry for the lack of pictures. You should probably try sketching along with the explanation.