Given a unit vector $u$ and another unit vector $v$, I want to rotate $u$ into $v$ in two stages. In the first stage, I rotate $u$ about a given axis $a_1$ (by an unknown angle) to produce a vector $u'$, and in the second stage I rotate $u'$ about the second given axis $a_2$ (by an unknown angle) to produce the vector $v$. Devise a method to find the two angles of rotation about the two given axes $a_1$ and $a_2$. Both axes $a_1$ and $a_2$ pass through the origin.
-
$\begingroup$ Are the vectors all in 3-dimensional space? $\endgroup$coffeemath– coffeemath2025-11-25 15:48:16 +00:00Commented Nov 25 at 15:48
-
$\begingroup$ Yes. All vectors are three dimensional. $\endgroup$user1711873– user17118732025-11-25 16:14:16 +00:00Commented Nov 25 at 16:14
-
$\begingroup$ Note that if $a_1=a_2$ this may be impossible. Draw a great circle through the point $v$ and around axis $a_2$. You must now rotate to anywhere on that great circle using $a_1$ to solve the problem. The point you hit is $u'$. Can you see why that helps? $\endgroup$CyclotomicField– CyclotomicField2025-11-25 16:35:11 +00:00Commented Nov 25 at 16:35
-
$\begingroup$ I don't think what you said is valid. There is no great circle here. $\endgroup$user1711873– user17118732025-11-25 17:46:52 +00:00Commented Nov 25 at 17:46
-
$\begingroup$ However, you make a good point to establish bounds on the angle between the two axes based on the angles between the given vectors and the respective axis. $\endgroup$user1711873– user17118732025-11-25 18:14:48 +00:00Commented Nov 25 at 18:14
1 Answer
When you use all possible rotations of $u$ around axis $a_1$, you describe a cone with $a_1$ as the axis and the half angle equal to the angle between $u$ and $a_1$. Similarly, a rotation of a vector $v'$ around axis $a_2$ will describe a cone with $a_2$ axis, and half angle equal to the angle between $v'$ and $a_2$. But you know that the final vector $v$ is on this cone, so the half angle is equal to the angle between $a_2$ and $v$. Two cones, with the same origin can have zero intersections (based on the conditions you describe) one line (they are tangent) or two lines.
So, the difficult step, you need is to find out the intersection lines (or vectors along these intersection lines). The easy way is to write a vector $x$ as components along three non coplanar directions (don't have to be an orthonormal system). To simplify calculations, use $a_1$, $a_2$, and $a_1\times a_2$.
$$x=\alpha a_1+\beta a_2+\gamma a_1\times a_2$$
You know $x\cdot a_1=u\cdot a_1$ and $x\cdot a_2=v\cdot a_2$. The last condition is $\alpha^2+\beta^2+\gamma^2=1$. $$\alpha+\beta a_1\cdot a_2=u\cdot a_1\\\alpha a_1\cdot a_2+\beta=v\cdot a_2$$
Solve this system to get $\alpha$ and $\beta$. If $\alpha^2+\beta^2<1$ you have two solutions for $\gamma$. If $\alpha^2+\beta^2=1$ you only have $\gamma=0$. Otherwise there is no solution.
EDIT: As pointed out in the comment, the last equation for $\gamma$ is $x\cdot x=1$. With $a_1, a_2$ unit vectors, this yields: $$1=\alpha^2+\beta^2 +2\alpha\beta a_1\cdot a_2+\gamma^2(1-(a_1\cdot a_2)^2)$$
EDIT2: A short note about the rotation angles: assuming $|a_1|=1$, we get the component of $u$ along $a_1$ to be $a_1(a_1\cdot u)$, so the component perpendicular to $a_1$ is $u-a_1(a_1\cdot u)$. You can write similarly the component of $u'$ perpendicular to $a_1$ as $u'-a_1(a_1\cdot u)$. Note that the parallel components are the same $a_1\cdot u=a_1\cdot u'$. Then all you need to do is find the angle between two vectors in the plane using cosine formula.
-
1$\begingroup$ It seems you want $x$ to be a unit vector. Then the equations $x=\alpha a_1+\beta a_2+\gamma a_1\times a_2$ and $\alpha^2+\beta^2+\gamma^2=1$ are correct to use together only if $a_1\cdot a_2=0.$ Otherwise I think you need to introduce a constant factor somewhere to account for the fact that $a_1\times a_2$ is not generally a unit vector. $\endgroup$David K– David K2025-11-25 21:18:07 +00:00Commented Nov 25 at 21:18
-
$\begingroup$ Correct. It should be $x\cdot x=1$ $\endgroup$Andrei– Andrei2025-11-25 22:01:06 +00:00Commented Nov 25 at 22:01
-
$\begingroup$ Your solution describes how to obtain $u'$, can you add details on how to obtain the rotation angles from that? $\endgroup$user1711873– user17118732025-11-26 02:17:39 +00:00Commented Nov 26 at 2:17
-
$\begingroup$ @user1711873 I've added that edit $\endgroup$Andrei– Andrei2025-11-26 14:03:41 +00:00Commented Nov 26 at 14:03