How to find the angle between 2 3D vectors, using basic trigonometry and geometry

161 Views Asked by At

Using spherical coordinates, I was trying to prove the following dot product formula for 2 3D vectors:

$\vec{u}\cdot\vec{v}=uv\cos(\psi)$

where $\psi$ is the angle between the vectors

My approach was:

$ \vec{u}=<u\sin(\theta_1)\cos(\phi_1), u\sin(\theta_1)\sin(\phi_1), u\cos(\theta_1)> $

$ \vec{v}=<v\sin(\theta_2)\cos(\phi_2), v\sin(\theta_2)\sin(\phi_2), v\cos(\theta_2)> $

$ \vec{u}\cdot\vec{v}=uv\bigg[\sin(\theta_1)\cos(\phi_1)\sin(\theta_2)\cos(\phi_2)+\sin(\theta_1)\sin(\phi_1)\sin(\theta_2)\sin(\phi_2)+\cos(\theta_1)\cos(\theta_2)\bigg] $

$ \vec{u}\cdot\vec{v}=uv\bigg[\sin(\theta_1)\sin(\theta_2)\Big(\cos(\phi_1)\cos(\phi_2)+\sin(\phi_1)\sin(\phi_2)\Big)+\cos(\theta_1)\cos(\theta_2)\bigg] $

$ \vec{u}\cdot\vec{v}=uv\bigg[\sin(\theta_1)\sin(\theta_2)\cos(\phi_1-\phi_2)+\cos(\theta_1)\cos(\theta_2)\bigg] $

$ \vec{u}\cdot\vec{v}=uv\bigg[\sin(\theta_1)\sin(\theta_2)\cos(\Delta\phi)+\cos(\theta_1)\cos(\theta_2)\bigg] $

Upon reaching this stage, I was unsure what to do. The expression in the square brackets should evaluate to the cos of the angle between the two vectors. I decided that I needed to evaluate an expression for this angle (in terms of $\phi_1, \phi_2, \theta_1$ and $\theta_2$) to continue with this proof. How could this be done without dot/cross product?

Alternatively, how would the trigonometric expression in the brackets be reduced to a single cosine function?

1

There are 1 best solutions below

1
On BEST ANSWER

Thank you everyone for your input in the comments and thank you especially to @Somos.

The current result was given as:

$\vec{u}\cdot\vec{v}=uv\Bigg[\sin(\theta_1)\sin(\theta_2)\cos(\phi_1−\phi_2)+\cos(\theta_1)\cos(\theta_2)\Bigg]$

As given by @Somos, the spherical law of cosines (https://en.wikipedia.org/wiki/Spherical_law_of_cosines) can be used to further simplify this trigonometric expression.

Spherical Law of Cosines

$\cos(c)=\cos(a)\cos(b)+\sin(a)\sin(b)\cos(C)$

Spherical Law of Cosines

2 random vectors were plotted on https://www.math3d.org/, with their tails at the centre of a sphere.

Here is how they came out (with hand drawing above it):

Two random vectors

By comparing both images, it can be seen that the angle C is analogous to $\Delta\phi$:

$\cos(c)=\cos(a)\cos(b)+\sin(a)\sin(b)\cos(\Delta\phi)$

a, b and c are analogous to $\theta_1$, $\theta_2$ and $\psi$. This is assuming that the angles are in radians so the length of the arc on the unit sphere is the same as the angle subtending that arc.

$\cos(\psi)=\cos(\theta_1)\cos(\theta_2)+\sin(\theta_1)\sin(\theta_2)\cos(\Delta\phi)$

Therefore it can be proved that, indeed:

$\vec{u}\cdot\vec{v}=uv\cos(\psi)$

where $\psi$ is the angle between the vectors, on the same plane.