Given two points on a sphere centred on the origin, $(x_1, y_1, z_1)^T$ and $(x_2, y_2, z_2)^T$, how can you determine the rotation matrices between them?
2026-04-26 07:10:44.1777187444
Rotation matrices between two points on a sphere
1.4k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
Let $$\vec{u} = \left [ \begin{matrix} x_1 \\ y_1 \\ z_1 \end{matrix} \right ], \quad \vec{v} = \left [ \begin{matrix} x_2 \\ y_2 \\ z_2 \end{matrix} \right ]$$ and the two vectors have the same length, i.e. $$\left\lVert\vec{u}\right\rVert = \left\lVert\vec{v}\right\rVert$$ (If they are not the same length, then you'd need to scale as well as rotate to transform one to the other. However, the approach below will work for $\left\lVert\vec{u}\right\rVert \ne \left\lVert\vec{v}\right\rVert$, in the sense that one vector will be rotated to match the direction of the other vector, but retain its original length.)
If you want to rotate one to the other, the axis unit vector $\hat{a}$ is perpendicular to both vectors, and the angle between the two vectors is $\varphi$:
$$\begin{aligned} \vec{a} &= \vec{u} \times \vec{v} \\ \hat{a} &= \frac{\vec{a}}{\left\lVert\vec{a}\right\rVert} \\ \sin \varphi &= \frac{\left\rVert \vec{u} \times \vec{v}\right\rVert}{\left\lVert\vec{u}\right\rVert \, \left\lVert\vec{v}\right\rVert} = \frac{\left\rVert \vec{a} \right\rVert}{\left\lVert\vec{u}\right\rVert \, \left\lVert\vec{v}\right\rVert} \\ \cos \varphi &= \frac{\vec{u} \cdot \vec{v}}{\left\lVert\vec{u}\right\lVert \; \left\lVert\vec{v}\right\rVert} \\ \end{aligned}$$
You can construct the rotation matrix $\mathbf{R}$ from the unit axis vector $\hat{a}$, $\cos\varphi$, and $\sin\varphi$.
Note that if $\mathbf{R}$ rotates $\vec{u}$ to $\vec{v}$, i.e. $$\mathbf{R}\vec{u} = \vec{v}$$ the inverse is $$\mathbf{R}^{-1} \vec{v} = \mathbf{R}^T \vec{v} = \vec{u}$$ because $\mathbf{R}$ is orthonormal, and its inverse is its transpose.