I have a plane E in R^3. The points $$p0 = (1,1,1), p1 = (1,0,1), p2 = (0,1,1) $$ are on E. I cannot figure out an affine transformation α : E → R2 that produce the following outcome: $$f(p0) = (0,0), f(p1) = (1,0), f(p2) = (0,1)$$.
Affine transformation from Points from 3d to 2d
1.4k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
BEST ANSWER
- Rotate the points by 180 deg using a line between $p_1$ and $p_2$. That rotation will leave $p_1$ and $p_2$ in the same spot. But p_0 will now be at (0,0,1).
- Translate all 3 points to the x,y plane. That does it.

On
I suggest a systematic approach to problems like this. Break the problem down into two steps: First, lift $\mathbb R^2$ to the $z=0$ plane in $\mathbb R^3$ and find an appropriate affine transformation of $\mathbb R^3$, then drop the $z$-coordinate. Since the transformation you’re looking for might involve translations, I recommend using homogeneous coordinates so that each transformation involved can be represented by a matrix and composition is simple matrix multiplication.
The second step is easily dispensed with: dropping the $z$-coordinate is a matter of left-multiplying by $$\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\end{bmatrix},$$ which deletes the third row of a $4\times4$ matrix. For the first step, we use the common method of mapping to and from the standard basis as an intermediate step. I.e., we find an invertible matrix $A$ that maps the standard basis vectors to our source points and a matrix $B$ that maps to the destination points. The combined mapping that takes the source points to the destination points is then $BA^{-1}$.
The two sets of points determine three of the four columns of each of these matrices: $$A = \begin{bmatrix}1&1&0&*\\1&0&1&*\\1&1&1&*\\1&1&1&*\end{bmatrix} \\ B = \begin{bmatrix}0&1&0&*\\0&0&1&*\\0&0&0&*\\1&1&1&*\end{bmatrix}.$$ It doesn’t matter which columns you use as long as the source/destination point pairs appear in corresponding columns. We need $A$ to be nonsingular, so for the last column of both matrices, choose a convenient nonzero vector that’s not in the span of $A$’s first three columns: $(0,0,0,1)^T$ is a simple choice that’s easily verified to be linearly independent of the other columns. Now compute $$BA^{-1} = \begin{bmatrix}0&-1&1&0\\-1&0&1&0\\0&0&1&0\\0&0&0&1\end{bmatrix}.$$ We know this represents an affine transformation because the last row is $(0,0,0,1)$—affine transformations fix the plane at infinity. The required map to $\mathbb R^2$ is then represented by this matrix with the third row deleted.
An interesting feature of this construction is that neither $A^{-1}$ nor $B$ represents an affine transformation (they are both projective transformations of $\mathbb R^3$), but their composition is affine. The construction guarantees this: the last row of $AA^{-1}$ is $(0,0,0,1)$ and the last rows of $A$ and $B$ are identical, so the last row of $BA^{-1}$ will also be $(0,0,0,1)$.
This transformation is not unique. Other choices for the last column of the matrices can generate other affine transformations that also satisfy the given criteria. This shouldn’t be terribly surprising since we have some freedom in choosing what the transformation does to vectors that aren’t on $E$. Taking for the last column of the two matrices $$\begin{bmatrix}0&1&0&0\\0&0&1&0\\1&1&1&0\\1&1&1&1\end{bmatrix} \begin{bmatrix} a\\b\\c\\d \end{bmatrix} = \begin{bmatrix} b \\ c \\ a+b+c \\ a+b+c+d \end{bmatrix},$$ with $d\ne0$ so that this point is not on $E$, let $\lambda = a/d \in \mathbb R$ to obtain $$BA^{-1} = \begin{bmatrix} 0&-1&1+\lambda&-\lambda \\ -1 & 0 & 1+\lambda & -\lambda \\ 0&0&1&0 \\ 0&0&0&1 \end{bmatrix},$$ a one-parameter family of affine transformations that you can verify perform the desired mappings.
On
First of all, there are many affine transformations that map points the way you want -- you need one more point to define it unambiguously since you are mapping from 3-dimensional space. To retrieve 2D affine transformation you would have to have exactly 3 points not laying on one line. For N-dimensional space there is a simple rule -- to unambiguously recover affine transformation you should know images of N+1 points that form a simplex --- triangle for 2D, pyramid for 3D, etc. A good explanation of why it's the way it should be, you may find in "Beginner's guide to mapping simplexes affinely".
Regarding your problem. If you need any affine transformation there are many ways to achieve the result. Here are the few that come to my mind:
- I can search for linear transformation instead of affine (partial case of affine and needs exactly 3 points),
- I can add some arbitrary point not laying in one plane with this 3 and set it in correspondence with any point you would like,
- I can observe that points and their images lay in parallel planes, thus solve 2D problem and then imperatively add $(0,0,-1)^T$ to translation vector.
Further I will consider case (1) as it sounds meaningful to me, but presented aproach may be useful in many other cases. It is known, linear transformation is an affine transformation that maps zero to zero -- this gives me one more point. Then I use general equation from "Beginner's guide to mapping simplexes affinely" and "Workbook on mapping simplexes affinely" to solve the problem of finding affine transformation by known mappings of points $$ \vec{X}(x_1; x_2; x_3) = (-1) \frac{ \det \begin{pmatrix} 0 & (0,0)^T & (1,0)^T & (0,1)^T & \vec{0} \\ \begin{matrix} x_{1} \vphantom{x_{1}^{(1)}} \\ x_{2} \vphantom{x_{1}^{(1)}} \\ x_{3} \vphantom{x_{1}^{(1)}} \\ \end{matrix} & % \begin{matrix} 1 \\ 1 \\ 1 \\ \end{matrix} & % \begin{matrix} 1 \\ 0 \\ 1 \\ \end{matrix} & % \begin{matrix} 0 \\ 1 \\ 1 \\ \end{matrix} & % \begin{matrix} 0 \\ 0 \\ 0 \\ \end{matrix} \\ % 1 & 1 & 1 & 1 & 1 \end{pmatrix} }{ \det \begin{pmatrix} \begin{matrix} 1 \\ 1 \\ 1 \\ \end{matrix} & % \begin{matrix} 1 \\ 0 \\ 1 \\ \end{matrix} & % \begin{matrix} 0 \\ 1 \\ 1 \\ \end{matrix} & % \begin{matrix} 0 \\ 0 \\ 0 \\ \end{matrix} \\ % 1 & 1 & 1 & 1 \end{pmatrix} }. $$ Doing determinants I get $$ = \left[ \begin{pmatrix} 0 \\ 0 \end{pmatrix} - \begin{pmatrix} 0 \\ 1 \end{pmatrix} \right] x_1 + \left[ \begin{pmatrix} 0 \\ 0 \end{pmatrix} - \begin{pmatrix} 1 \\ 0 \end{pmatrix} \right] x_2 + \left[ \begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} - \begin{pmatrix} 0 \\ 0 \end{pmatrix} \right] x_3 = $$ or simplified $$ \vec{X}(x_1; x_2; x_3) = \begin{pmatrix} 0 \\ -1 \end{pmatrix} x_1 + \begin{pmatrix} -1 \\ 0 \end{pmatrix} x_2 + \begin{pmatrix} 1 \\ 1 \end{pmatrix} x_3 . $$ Of course, you can write that down in a vector form $$ \vec{X}(\vec{x}) = \begin{pmatrix} 0 & -1 & 1 \\ -1 & 0 & 1 \end{pmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \end{pmatrix}. $$ Now you can easily check $$ \begin{pmatrix} 0 & -1 & 1 \\ -1 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix};~ \begin{pmatrix} 0 & -1 & 1 \\ -1 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix};~ \begin{pmatrix} 0 & -1 & 1 \\ -1 & 0 & 1 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}; $$
For more details on the methods used, you can always refer to "Beginner's guide to mapping simplexes affinely" and "Workbook on mapping simplexes affinely". The latter contains many problems similar to this one as explained by the authors of the method presented.