I'm trying to figure out how to rotate a 4d vector to another 4d vector, for example, $(0.5, 0.5, 0.5, 0.5)$ to $(0, 0, 0, 1)$. I first thought just like $3d$ space, using a dot product to find the angle and cross product to find the axis would do, but there was no cross product in $4d$, so I've got confused. I tried searching but all I figured out was my lack of knowledge and understanding about linear algebra.
I first tried to do like this:
- Store angles from each plane in 6-sized array. $(XY : 30, XZ : 50 , XW : 20...)$
- Build a traditional plane-rotation $4\times4$ matrix for each of the plane.
- Multiply these 6 matrices.
But multiplying 6 $4\times4$ matrix every time would be pretty performance-consuming, so what I want to do is:
- Set the base vector to $V (1, 0, 0, 0)$.
- Store the rotation destination vector, like $W (0, 0, 1, 0)$
- Build a matrix (or formula, anything) to rotate from $V$ to $W$, and apply this to it's children.
What would be the efficient method?
I wanted to utilize something like this answer, but it was beyond my understanding :(