Let $\mathbf{x}\in\mathbb{R}^n$ be an arbitrary $n$-dimensional real vector. I would like to rotate it so as it be aligned to given axis.
Should I project it first to the given axis in order to calculate its angle wrt to this axis? How should I construct the $n$-dimensional rotation matrix then? I suspect that I might have a matrix with $n-2$ ones at its main diagonal?
I'm really stuck just at the very beginning of this. Can you please help?