# I Looking for deductions to find the angle between vectors

#### opus

Gold Member
I have a question in my text (Intro Mechanics by Kleppner) and a question is to find the cosine and sine between two vectors.
It gives me the cosine piece: $$\cos(\vec A, \vec B) = \frac{\vec A ⋅\vec B}{|A||B|}$$ which I assume is just from the dot product, but it has no derivation of this, and doesnt mention it for sine.

I've looked around Google for derivations of this, but only find worked examples of problems like the one I have given. Could anyone reference me to the derivations for these?

#### Christopher Grayce

In what form do you know the definitions of the dot and cross product of two vectors? If you know them in terms of the angle between the vectors, use that. If you know them only in terms of multiplication of the components (e.g. A.B = AxBx + AyBy + AzBz) then you can draw some triangles and use trigonometry to rewrite A.B in terms of |A|, |B| and the angle between A and B. I would start with 2D vectors because the trig is much simpler, and an answer that works in 2D that doesn't specifically involve the components or Cartesian angles must look the same in 3D (or any D).

#### opus

Gold Member
In terms of dot product, I know we can use either $\vec A⋅\vec B = |A||B|\cos(\theta)$ or also $\vec A ⋅ \vec B = A_1B_1+A_2B_2+A_3B_3$
For the cross product, I derive this by crossing $\vec A_xi$ with $\vec B$ and then cyclically permuting through x,y,z i,j,k to find the other terms.
Not entirely sure of what you mean with the triangles, but I'll try to work something out with that and see what I get.

#### PeroK

Homework Helper
Gold Member
2018 Award
So, you want to go from:

In terms of dot product, I know we can use either $\vec A⋅\vec B = |A||B|\cos(\theta)$
To:

It gives me the cosine piece: $$\cos(\vec A, \vec B) = \frac{\vec A ⋅\vec B}{|A||B|}$$ which I assume is just from the dot product, but it has no derivation of this, and doesnt mention it for sine.

#### opus

Gold Member
So, you want to go from:

To:
Yes, just came up with this. Got tripped up for a second on how the book has it labeled as $\cos(\vec A, \vec B)$

Still working on the sine piece. Currently trying to derive it by using the fact that the magnitude of the cross product of A and B is the area of a parallelogram and go from there.

#### Orodruin

Staff Emeritus
Homework Helper
Gold Member
2018 Award
Although you have the possibility of using the cross product and it to some extent may be easier. If you just want the sine and you have the cosine there is a nice trigonometric identity to use ...

In more general vector spaces equipped with an inner product, the angle is defined through the relation you gave in #1.

#### opus

Gold Member
Although you have the possibility of using the cross product and it to some extent may be easier. If you just want the sine and you have the cosine there is a nice trigonometric identity to use ...

In more general vector spaces equipped with an inner product, the angle is defined through the relation you gave in #1.
I think I may be following.
$\sin^2(\theta)+\cos^2(\theta)=1$
$\implies \sin(\vec A,\vec B) = \sqrt{1-\cos^2(\vec A, \vec B)}$

#### Mark44

Mentor
I think I may be following.
$\sin^2(\theta)+\cos^2(\theta)=1$
$\implies \sin(\vec A,\vec B) = \sqrt{1-\cos^2(\vec A, \vec B)}$
The right side should be $\pm \sqrt{1-\cos^2(\vec A, \vec B)}$, where you choose the appropriate sign according to the angle between the two vectors. I.e., if $0 \le \theta \le \pi$ then $\sin(\theta) \ge 0$, and if $\pi \le \theta \le 2\pi$, then $\sin(\theta) \le 0$. And similar for other ranges of angles.

Also, the notation can be appreciably simplified if you simply define $\theta$ as the angle between the two vectors.

#### Orodruin

Staff Emeritus
Homework Helper
Gold Member
2018 Award
The right side should be $\pm \sqrt{1-\cos^2(\vec A, \vec B)}$, where you choose the appropriate sign according to the angle between the two vectors. I.e., if $0 \le \theta \le \pi$ then $\sin(\theta) \ge 0$, and if $\pi \le \theta \le 2\pi$, then $\sin(\theta) \le 0$. And similar for other ranges of angles.

Also, the notation can be appreciably simplified if you simply define $\theta$ as the angle between the two vectors.
Typically ”the angle between two vectors” refers to the minimal angle of rotation necessary to rotate one to be parallel to the other. This angle is always between zero and pi and therefore the $\pm$ is not necessary in this case.

#### robphy

Homework Helper
Gold Member
Yes, there is an ambiguity in the notation $\sin(\vec A,\vec B)$ since $\sin\theta$ is an odd-function of $\theta$. Of course, $\cos\theta$ is an even function.

Given two vectors $\vec A$ and $\vec B$,
one might interested in "the [non-negative] angle-between-the-vectors" $|\theta_B-\theta_A|$
or the "[signed] angle from $\vec A$ to $\vec B$" $(\theta_B-\theta_A)$ , for example when talking about torque (and wanting the sense, directly) or when writing a computer program.

Since you are following Kleppner's text (and potentially higher-level textbooks),
I suggest you use the signed-angle as a definition [and make that clear],
dropping back into its magnitude as you need to.
This is similar to using displacement as a definition, and [say] distance as a special case (as needed).

Gold Member

#### Ray Vickson

Homework Helper
In terms of dot product, I know we can use either $\vec A⋅\vec B = |A||B|\cos(\theta)$ or also $\vec A ⋅ \vec B = A_1B_1+A_2B_2+A_3B_3$
For the cross product, I derive this by crossing $\vec A_xi$ with $\vec B$ and then cyclically permuting through x,y,z i,j,k to find the other terms.
Not entirely sure of what you mean with the triangles, but I'll try to work something out with that and see what I get.
Is your question one of wanting to know how to go from (1) to (2) below, or vice-versa?
$$\begin{array}{cclr} {\bf A} \cdot {\bf B} &=& A_1 B_1 + A_2 B_2 + A_3 B_3& \hspace{3ex}(1)\\ {\bf A} \cdot {\bf B} & =& |{\bf A}| | {\bf B}| \cos \theta & \hspace{3ex}(2) \end{array}$$

Well, both forms are unchanged under a rotation, so that if ${\bf A}' = R {\bf A}$ and ${\bf B}' = R {\bf B}$ for a rotation $R$, we have $|{\bf A}'| = |{\bf A}|$, etc, and
$${\bf A}' \cdot {\bf B}' = {\bf A} \cdot {\bf B}$$ for either way (1) or (2) of defining the dot product.

So, if we rotate the vectors until ${\bf A}'$ points along the $x_1 -$ axis and ${\bf B}'$ lies in the $x_1\; x_2 -$ plane, and letting $A = |{\bf A}|, B = |{\bf B}|$ we have
$${\bf A}' = (A,0,0), \: {\bf B}' = (B \cos \theta, B \sin \theta, 0),$$ so that $\sum_i A_i B_1 = \sum_i A'_i B'_i = AB \cos \theta.$

#### opus

Gold Member
Is your question one of wanting to know how to go from (1) to (2) below, or vice-versa?
$$\begin{array}{cclr} {\bf A} \cdot {\bf B} &=& A_1 B_1 + A_2 B_2 + A_3 B_3& \hspace{3ex}(1)\\ {\bf A} \cdot {\bf B} & =& |{\bf A}| | {\bf B}| \cos \theta & \hspace{3ex}(2) \end{array}$$

Well, both forms are unchanged under a rotation, so that if ${\bf A}' = R {\bf A}$ and ${\bf B}' = R {\bf B}$ for a rotation $R$, we have $|{\bf A}'| = |{\bf A}|$, etc, and
$${\bf A}' \cdot {\bf B}' = {\bf A} \cdot {\bf B}$$ for either way (1) or (2) of defining the dot product.

So, if we rotate the vectors until ${\bf A}'$ points along the $x_1 -$ axis and ${\bf B}'$ lies in the $x_1\; x_2 -$ plane, and letting $A = |{\bf A}|, B = |{\bf B}|$ we have
$${\bf A}' = (A,0,0), \: {\bf B}' = (B \cos \theta, B \sin \theta, 0),$$ so that $\sum_i A_i B_1 = \sum_i A'_i B'_i = AB \cos \theta.$
The cosine forms were clear, it was the sin form that confused me at first, but I've got them now. But now that you mention it, I'm not sure what you mean on "change under rotation". Are you referring to how when the derivative of a vector is taken and the magnitude remains constant, that it can only rotate?

"Looking for deductions to find the angle between vectors"

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving