10

When we do vector products, we use two different methods. One is the vector dot product, another is vector cross product. The equation of the vector dot product is $$\textbf A \cdot \textbf B =|\textbf A| | \textbf B| \cos\theta,$$ where $\theta$ is the angle between the vectors $\textbf A$ and $\textbf B$.

Why do we use cosine as the expression?

8 Answers8

26

To illustrate, consider two-dimensional space, $\mathbb{R}^2$.

Let $\vec{\mathbf a} = (x_1, y_1) = (a \cos \alpha, a \sin \alpha)$, which is a vector with magnitude $a$ and angle $\alpha$ from the $x$-axis.

Let $\vec{\mathbf b} = (x_2, y_2) = (b \cos \beta, b \sin \beta)$ which is a vector with magnitude $b$ and angle $\beta$ from the $x$-axis.

Then, define $\theta = |\beta - \alpha|$, the absolute difference between the angles.

By definition,

\begin{align} \vec{\mathbf a} \circ \vec{\mathbf b} &= x_1x_2 + y_1y_2 \\ &= ab(\cos \alpha \cos \beta + \sin \alpha \sin \beta) \\ &= ab \cos(\beta - \alpha)\\ &= ab \cos \theta \end{align}

(Note $\cos(\theta) = \cos(-\theta)$)

  • 1
    I'm not fully sure how $abcos(\theta)$ relates to $|a||b|$, because I think it should be $|a||b|cos(\theta)$. I am seeing the right symbols though. For the mathematically challenged like me, I've googled a few things. Here's a proof for $abcos(\beta+\alpha)$ which is almost the same as $abcos(\beta-\alpha)$. https://www.khanacademy.org/math/precalculus/x9e81a4f98389efdf:trig/x9e81a4f98389efdf:angle-addition/v/proof-angle-addition-cosine Moreover, here's a Desmos graph to play around with to get some intuition: https://www.desmos.com/calculator/kz0b7jsnm7 – Melvin Roest Mar 30 '22 at 18:42
  • 2
    @MelvinRoest: I have always used $a = |\vec{\mathbf a}|$ and $b = |\vec{\mathbf b}|$. I'm so used to doing it that way that I didn't even think it would be misinterpreted. I was wrong, – Steven Alexis Gregory Sep 11 '22 at 03:52
  • 1
    How might we generalize this explanation to 3D and higher dimensions? –  Oct 01 '23 at 02:58
  • I wonder why this explanations is missing from things like Wikipedia or textbooks? Do authors assume that every single reader is automatically aware of this? – ScienceDiscoverer Nov 30 '23 at 13:38
  • 1
    @ScienceDiscoverer : I suppose because the dot product is more fundamental than trigonometry. Also because the dot product can be similarly defined in n-dimensional spaces while the trigonometry "trick" only works in two-dimensional spaces. – Steven Alexis Gregory Dec 02 '23 at 06:19
16

enter image description here

The dot product of two vectors $A$ and $B$ is just the product of the magnitude of one vector with the scalar projection of the other one on itself. Hence the $cos$ term. Also, note that the $cos$ function is greater for smaller angles, and lesser for larger ones, just like the length of the projection. (both are the same thing, actually.)

  • "with the scalar projection of the other one on itself" I did not understand this part. It took me a few hours to understand it. Here's how I would explain this quote: "with the magnitude of $A$ its shadow onto $B$". If you rearrange $B$ to be the x-axis, then it's easy to see from basic trig knowledge why the magnitude $A$ its shadow onto $B$ would be $|A|*cos(\theta)$. Also note, the image is not fully understandable IMO (as a math layman). This is because the magnitude of $B$ ($|B|$) is not depicted. $|B|$ is the length/magnitude of vector $B$. – Melvin Roest Mar 31 '22 at 06:30
2

The dot product is defined in that way. Note that $cos\theta$ is a suitable function; since by the Schwarz inequality: $$|\mathbf{A} \cdot \mathbf{B}| \leq |\mathbf{A}| |\mathbf{B}|$$ and thus the dot product ranges continuosly between -1 and 1, as $cos \theta$ for $\theta \in [0,\pi] $.

rubik
  • 9,344
NNec
  • 407
  • Usually, I see dot products defined as $x \cdot y := x_1 y_1 + \cdots + x_n y_n$, with $x \cdot y = |x| |y| \cos \theta$ given as a result. – Paul Wintz Jan 31 '24 at 08:04
2

This is entirely determined by what we consider a rotation in the plane.

Let $u, v$ be two unit vectors. Let the angle between them be $\theta$, and we can naturally write $v$ as

$$v = u \cos \theta + u_\perp \sin \theta$$

where $u_\perp$ is a unit vector perpendicular to $u$. Then clearly, the dot product is $u \cdot v = \cos \theta$.

But, if you're not in a Euclidean plane anymore, this relationship no longer holds. For example, in a Lorentzian space, instead of cosine and sine, we get hyperbolic functions instead:

$$v = u \cosh \theta + u_\perp \sinh \theta$$

And the dot product is $u \cdot v = \cosh \theta$. A physicist should recognize that this $\theta$ is the "rapidity", and that the form of $v$ given here is exactly that of any Lorentz boost.

So the reason we use sine and cosine in Euclidean space is because they are dictated by the use of sine and cosine in rotations. In other spaces, with different rotation operators, you use the functions that are associated with those rotations instead.

Muphrid
  • 19,902
  • What does this have to do with rotations? This just looks like decomposition of $v$ into $v_{|}$ and $v_{\bot}$ parts. – got it--thanks Feb 22 '15 at 20:22
  • 1
    Whether you use cosine or hyperbolic cosine depends on what the rotation operations are, on which set of vectors is the set of unit vectors. – Muphrid Feb 22 '15 at 21:17
0

In dot product we use cos theta because in this type of product 1.) One vector is the projection over the other. 2.) The distance is covered along one axis or in the direction of force and there is no need of perpendicular axis or sin theta. In cross product the angle between must be greater than 0 and less than 180 degree it is max at 90 degree. let take the example of torque if the angle between applied force and moment arm is 90 degree than torque will be max. That's why we use cos theta for dot product and sin theta for cross product.

0

Because here cosine is responsible for doing any type of work e.g work done cosine is use . Here one axis is use for work done I.e x -axis and for x -axis we are using cosine

0

Cosine is used to make both the vectors point in same direction. For dot product we require both the vectors to point in same direction and cosine does so by projecting one vector in the same direction as other.

-2

It is actually the definition of the dot product of two vectors.

rainman
  • 801
  • 11
    The point of this question is to ask why one would want to express the dot product as something involving the cosine, not what the definition is. – Danu Feb 15 '15 at 11:31
  • 6
    Besides, it is more commonly seen the other way around - the angle $\theta$ is defined by this formula, while the dot product is defined by a symmetric matrix. – ACuriousMind Feb 15 '15 at 13:57