0
$\begingroup$

With three unit vectors $\vec{u}$, $\vec{v}$ and $\vec{w}$, where:

  • $\vec{v}$ and $\vec{w}$ are strictly on the orthogonal plane of $\vec{u}$;
  • in a left-handed coordinate system around $\vec{u}$.

How to get the angle from $\vec{v}$ to $\vec{w}$?

I know about the dot-product angle:

$$\cos \theta = \frac{\vec{v} \cdot \vec{w}}{\left|\left|\vec{v}\right|\right|\left|\left|\vec{w}\right|\right|}$$

but that gives the shortest angle despite the left-handed coordinate system.

enter image description here

$\endgroup$
2
  • $\begingroup$ Why should the coordinate system have any effect on the angle? $\endgroup$ Jan 10, 2023 at 19:54
  • 4
    $\begingroup$ The cross product has a $\sin(\theta)$ in it and gives you actually a sign if you rotate $v$ to $w$ over more than $\pi$ or not. If you combine that with the dot-product you can sort out the exact angle. $\endgroup$ Jan 10, 2023 at 20:05

1 Answer 1

1
$\begingroup$

A late answer per request of @ronno (comment above). Hope the following is a correct working-out of my hasty comment above...

You may translate all vectors so that they all go through the origin. Assuming that has been done already, we have the following (cross- and dot-product) $$ v \times w = -|v||w| \sin(\theta) \frac{u}{|u|}\\ (v,w) = |v||w| \cos(\theta) $$ Getting $\sin(\theta)$ can be done with the component of $u$ which has the largest absolute value (we could take any non-zero component though...). Assuming, as an example, that it is $u_x$ we get $$ \sin(\theta) = -\frac{|u|}{|v||w|}\frac{(v \times w)_x}{u_x}\\ \cos(\theta) = \frac{(v,w)}{|v||w|} $$ For a vector with a certain angle $\theta$ with the x-axis, we have $$ y=\sin(\theta)\\ x=\cos(\theta) $$ and we can find the angle by $$ \theta = \text{atan2}(y,x)=\text{atan2}(-\frac{|u|}{|v||w|}\frac{(v \times w)_x}{u_x},\frac{(v,w)}{|v||w|}) $$ which can be simplified to $$ \theta = -\text{atan2}(|u|\frac{(v \times w)_x}{u_x},(v,w)) $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .