Given normalized vectors $U=(u_1,u_2,u_3)$ and $V=(v_1,v_2,v_3)$, find a rotation matrix $R$ such that $RV=U$.
I've read these topics: Find a rotation matrix that sends $v$ to $u$
Finding a specific Rotation matrix given a known vector
And many other links but didnt find them very useful.
I'd be glad for help.
The easiest way, in my opinion, is to use Householder reflection. It is a unitary transformation with the following matrix $$H = I_n - 2\nu\nu^T$$ where $H \in R^n$, $\|\nu\| = 1$ and $n$ is the dimension of the vectors that you deal with. Now, the question is to find the matrix $H$ such that $y = Hx$, with $x,y \in R^n$. Sufficient condition is $\|y\| = \|x\|$ (H is unitary, it does not change the norm) which is provided. So: $$Hx = x - 2\nu\nu^Tx = y$$ $$\nu = \frac{x-y}{2\nu^Tx}$$ since $\nu$ is unit vector: $$\nu = \frac{x-y}{\|x-y\|}$$ If you apply $H$ to any vector in $R^n$, it does not rotate them in the exact same angles as it rotates $x$. Instead, It reflects them with respect to the same plane that $x$ is reflected.