Get the 4-d rotation matrix given two planes There are two 2-d planes in 4-d space (both passing through the origin). They intersect in a line. We are given the coordinates of three points for the first plane (a $3 \times 4$ matrix, $V_1$ where each row is one of the three points) and the coordinates of three points for the second one ($V_2$).
Imagine translating both planes so the origin passes through both of them. Now, they will also have an intersecting line (even if they didn't before).
I'd like to rotate the second plane with respect to the first along the common line between them. This will involve shifting the origin somewhere along the common line and then the rotation can be represented by a rotation matrix ($R$, a $4 \times 4$ matrix). How do I get this rotation matrix?

Find the normal vectors $U$ and $V$ of the two planes. Let $\theta$ be the angle between $U$ and $V$, and let $W$ be their cross product. The rotation you’re looking for is a rotation around $W$ by the angle $\theta$. If you want it in matrix form, use Rodrigues’ formula.
