1
$\begingroup$

I have two unit-length vectors $\vec{v_1}$ and $\vec{v_2}$ and I would like to find a unit-length vector that's perpendicular to them, so basically $\vec{v_3} = \vec{v_1} \times \vec{v_2}$.

However the vectors are not expressed as numbers, but as rotations around axes. so $\vec{v} = (\alpha_x, \alpha_y, \alpha_z)$ where $\alpha_x$ is rotation of a $(1,0,0)$ vector around x-axis, $\alpha_y$ around y-axis, etc.

I know it's easy to work this out by converting angular representation to more typical coordinates, then computing cross products and then converting back to angles. But is there an easier way to do it that only relies on angles?

$\endgroup$

1 Answer 1

1
$\begingroup$

But is there an easier way to do it that only relies on angles?

No, not really. Also, note that the order of the rotations also matters, because it affects the conversion to/from Cartesian coordinates.

Let's look at the expressions you get by converting your angular coordinates to Cartesian coordinates.

Using spherical coordinates ($r$ being distance from origin, $\varphi$ latitude, and $\theta$ longitude with zero at equator, positive north, negative south), we have $$\vec{v}_1 = (r_1, \theta_1, \varphi_1) = \left[\begin{matrix} r_1 \cos(\varphi_1) \cos(\theta_1) \\ r_1 \sin(\varphi_1) \cos(\theta_1) \\ r_1 \sin(\theta_1) \\ \end{matrix} \right], \quad \vec{v}_2 = (r_2, \theta_2, \varphi_2) = \left[\begin{matrix} r_2 \cos(\varphi_2) \cos(\theta_2) \\ r_2 \sin(\varphi_2) \cos(\theta_2) \\ r_2 \sin(\theta_2) \\ \end{matrix} \right]$$ and therefore their vector cross product is $$\vec{v}_1 \times \vec{v}_2 = \left[\begin{matrix} r_1 r_2 \sin(\varphi_1) \cos(\theta_1) \sin(\theta_2) - r_1 r_2 \sin(\theta_1) \sin(\varphi_2) \cos(\theta_2) \\ - r_1 r_2 \cos(\varphi_1) \cos(\theta_1) \sin(\theta_2) + r_1 r_2 \cos(\varphi_2) \sin(\theta_1) \cos(\theta_2) ~ \, ~ \\ r_1 r_2 \cos(\varphi_1) \cos(\theta_1) \sin(\varphi_2) \cos(\theta_2) - r_1 r_2 \sin(\varphi_1) \cos(\theta_1) \cos(\varphi_2) \cos(\theta_2) \\ \end{matrix}\right]$$ Now, because $$\begin{aligned} 2 \cos(\theta_1) \cos(\theta_2) &= \cos(\theta_1 + \theta_2) + \cos(\theta_1 - \theta_2) \\ 2 \sin(\theta_1) \cos(\theta_2) &= \sin(\theta_1 + \theta_2) + \sin(\theta_1 - \theta_2) \\ 2 \cos(\theta_1) \sin(\theta_2) &= \sin(\theta_1 + \theta_2) - \sin(\theta_1 - \theta_2) \\ 2 \sin(\theta_1) \sin(\theta_2) &= \cos(\theta_1 - \theta_2) - \cos(\theta_1 + \theta_2) \\ \cos(\varphi_1)\sin(\varphi_2) - \sin(\varphi_1)\cos(\varphi_2) &= -\sin(\varphi_1 - \varphi_2) \\ \end{aligned}$$ we can write the cross product as $$\vec{v}_1 \times \vec{v}_2 = \displaystyle \frac{r_1 r_2}{2} \left[ \begin{matrix} ~ \, ~ \sin(\varphi_1)\bigl( \sin(\theta_1 + \theta_2) - \sin(\theta_1 - \theta_2) \bigr) - \sin(\varphi_2)\bigl( \sin(\theta_1 + \theta_2) + \sin(\theta_1 - \theta_2) \bigr) \\ -\cos(\varphi_1)\bigl( \sin(\theta_1 + \theta_2) - \sin(\theta_1 - \theta_2) \bigr) + \cos(\varphi2)\bigl( \sin(\theta_1 + \theta_2) + \sin(\theta_1 - \theta_2) \bigr) \\ -\sin(\varphi_1 - \varphi_2)\bigl( \cos(\theta_1 + \theta_2) + \cos(\theta_1 - \theta_2) \bigr) \\ \end{matrix} \right]$$ which shows that the final rotation angle (here, $\theta$) does simplify – that is, we do get expressions where we use the sum of and the difference in the final angles, $\theta_1+\theta_2$ and $\theta_1-\theta_2$ – but the other rotation angles cannot be separated: the above becomes way more complicated if we try to use only $\varphi_1+\varphi_2$ and $\varphi_1-\varphi_2$ instead of $\varphi_1$ and $\varphi_2$ alone. In other words, see how we use $\varphi_1$ and $\varphi_2$ alone, but only $(\theta_1+\theta_2)$ and $(\theta_1-\theta2)$, never $\theta_1$ or $\theta_2$ alone? That indicates that we can only really separate the last rotation in this expression in an useful manner.

$\endgroup$
1
  • $\begingroup$ This is great, thank you! The rephrasing in form of theta1 +/- theta2 is helpful. It will save me a lot of computing cycles! $\endgroup$
    – Marcin
    Commented Mar 2, 2021 at 20:54

You must log in to answer this question.

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