Intuitive Explanation of Dot Product ,Pythagorean Theorem and The Law of Cosines

Engin Deniz Alpman
4 min readSep 23, 2019

--

What is the dot product ? It is the element-wise multiplication and then addition of the elements of the vectors. So what ? It sounds boring… But hold on, that is not the whole story. With the light of the intuition It can become funny and it will. Shall we start ?

Dot product can be interpreted as the giving reward to the similarities of the vectors.

When we dot product two vectors and say a.b = a_x . b_x + a_y . b_y, what we are actually doing is to interpret rewarding of their similarities according to x-y axis.

But there are infinitely many base for this space, and x and y axis pair is just one of them. We can choose the unit vector in the direction of vector a and the vector perpendicular to that as a base (we can do that for b too). In this case our interpretation of their similarity shifted to:

So what can we learn from this? The underlying reason is the same, when we dot product we are rewarding similarities, it is the matter of perspective that changes notations.

We can see that:

This is no surprise to see cosine function when we are talking about similarities. Cosine is directly related to the similarity of two vectors.

  • When two vectors are in the same direction angle between them is 0 and cos(0) = +1 (since the maximum value of cosine is +1, it maximizes dot product of the vector when they are in the same direction).
  • when they are perpendicular to each other and do not share any single component angle between them is 90⁰ and cos(90) = 0.
  • When two vectors are in the opposite direction angle between them is 180⁰ and cos(180) = -1 .

Pythagorean Theorem:

We can derive Pythagorean Theorem using dot product.

Let’s say we have two vectors a and b that are perpendicular to each other.

We want to find the length of the c. So we will dot product both sides with c.

a and b are perpendicular to each other so cos(90⁰) = 0

Pythagorean Theorem

That is it! We have derived Pythagorean Theorem using dot product.

But what if the angle between a and b was not a 90⁰ ? Following same steps as in the Pythagorean Theorem’s derivation but not writing 90⁰ for theta will lead to:

That is The Law Of Cosine !

(In the commonly used formula the 2.|a||b|cos(theta) term is negative, but in that form theta is defined as in the following figure )

--

--

Engin Deniz Alpman

I am teaching AI. But I guess I just love teaching, so the topic may change in the future too.