# Computing the transformation of a plane $\eta_1$ to another plane $\eta_2$

Lets suppose we have two planes given by the parametric equations

\begin{align} &\eta_1~:~\vec{x}_1~=~\vec{o}_1+\vec{R}_{11}t_{11}+\vec{R}_{12}t_{12}\\ &\eta_2~:~\vec{x}_2~=~\vec{o}_2+\vec{R}_{21}t_{21}+\vec{R}_{22}t_{22} \end{align}

where all occuring vectors are elements of the euclidean space $\mathbb{R}^3$. We can also describe these planes by the following equations

\begin{align} &\eta_1~:~(\vec{x}_1-\vec{o}_1)\cdot(\vec{R}_{11}\times\vec{R}_{12})\\ &\eta_2~:~(\vec{x}_2-\vec{o}_2)\cdot(\vec{R}_{21}\times\vec{R}_{22}) \end{align}

The main target I attempt to fulfill is to transform $\eta_1$ to $\eta_2$. I want to this in two steps $(1)$ Making both planes parallel $(2)$ Shift $\eta_1$ to be equal to $\eta_2$.

I tried to approach by using the normal vectors of the both planes and so to solve the equation

$$\textbf{T}\vec{n}_1=\vec{n}_2$$

for $\textbf{T}\in \mathbb{R}^{3\times3}$. To be honest I have to clue from hereon and I guess this is not even the right attempt. What I can say about the matrix-vector equation is that the eigenvalues, or atleast one of the eigenvalues, of the matrix $\textbf{T}$ has to $1$ and therefore $\vec{n}_2$ would be an eigenvector of $\textbf{T}$. I am familiar with the concept of rotation matrices around the different axis for an angle $\alpha$ which are given by

\begin{align} \small{\textbf{T}_x=\begin{pmatrix}1&0&0\\0&\cos(\alpha)&-\sin(\alpha)\\0&\sin(\alpha)&\cos(\alpha)\end{pmatrix}~ \textbf{T}_y=\begin{pmatrix}\cos(\alpha)&0&-\sin(\alpha)\\0&1&0\\\sin(\alpha)&0&\cos(\alpha)\end{pmatrix}~ \textbf{T}_z=\begin{pmatrix}\cos(\alpha)&-\sin(\alpha)&0\\\sin(\alpha)&\cos(\alpha)&0\\0&0&1\end{pmatrix}} \end{align}

but since I do not know the angle $\alpha$ this does not help me at all. Another attempt would be to compute all angles alone and then jsut multiply the matrices $\textbf{T}_x$, $\textbf{T}_y$ and $\textbf{T}_z$ but hence this does not seem that efficient I am not sure about this.

Mainly I want to know I there is a way to construct $\textbf{T}$ out of $\vec{n}_1$ and $\vec{n}_2$ or atleast out of the given defintion of $\eta_1$ and $\eta_2$. If it is not possible could you please explain to me why this is so. Furthermore could maybe someone provide an example transform of a plane $\eta_1$ to plane $\eta_2$ by using a general algorithm if there exist such as thing.

If you don’t care about preserving shapes and areas—i.e., you don’t need a rigid motion—it’s very easy to construct a transformation that will perform this mapping. Working in homogeneous coordinates since a translation is involved, the matrix $$M_1 = \begin{bmatrix}\vec R_{11} & \vec R_{12} & \vec R_{11}\times\vec R_{12} & \vec o_1 \\ 0&0&0&1 \end{bmatrix}$$ maps the $x$-$y$ plane to $\eta_1$. Similarly, $$M_2 = \begin{bmatrix}\vec R_{21} & \vec R_{22} & \vec R_{21}\times\vec R_{22} & \vec o_2 \\ 0&0&0&1 \end{bmatrix}$$ maps to $\eta_2$. (For the third column, you can use any vector that’s not parallel to $\eta_1$ or $\eta_2$, respectively. The cross products are an easy way to generate them.) The matrix $M_2M_1^{-1}$ then maps from $\eta_1$ to $\eta_2$.
If you need a rigid motion, a slight modification of the above will do the trick. The first and third columns of the two matrices are the same, but normalized. For the second columns, use $(\vec R_{i1}\times\vec R_{i2})\times\vec R_{i1}$, also normalized, so that the linear parts of the resulting transformation matrices are orthogonal with determinant $1$, in other words, rotations.
The above combines the rotation and translation into a single transformation matrix, but you can of course proceed in steps as you proposed. You can construct the appropriate pure rotation exactly the same way as above: generate an orthonormal set of vectors for each plane consisting of a unit normal for the plane and a pair of orthogonal unit vectors parallel to it and use them as the columns of two $3\times3$ matrices $M_1$ and $M_2$. $M_2M_1^{-1}$ is a rotation that aligns the two planes. Since $A^{-1}=A^T$ for an orthogonal matrix, you don’t even need to perform a matrix inversion. The three vectors that you generated for $\eta_1$ are the rows of $M_1^{-1}$. The order in which they appear in the matrices doesn’t matter, either, as long as it’s consistent.