Problem statement
Given 2 vectors and with angle , how to compute the rotation matrix that rotates to along the 2d subspace generated by and ?
Idea
In high dimensional space, the rotation happens:
- along the 2D plane generated by and
- around the complemented (n-2)-dimensional subspace , which means this stays the same
Thus the idea is
- Project onto
- Rotate in
- Project onto Q
- Sum the projections onto Q with the rotated vector in
Here are the steps:
- In the 2D plane generated by and :
- project to the 2D plane generated by and
- find 2 orthonormal vectors from and to represent that space then and are 2 bases of a plane and is the projection matrix to that plane. ()
- do the rotation with angle in that space ()
where
- then projected back to n-dimensional ()
- The projection in to this space is given by
- project to the 2D plane generated by and
- In complemented (n - 2)-dimensional subspace:
- Which is the complemented (n-2)-dimensional subspace of the 2D plane mentioned above
- The projection on to this can be computed by subtracting the projection matrix onto the space generated by and from the identity matrix
- The final rotation matrix is