# Projective Geometry/Classic/Projective Transformations/Transformations of projective 3-space

Three-dimensional transformations can be defined synthetically as follows: point X on a "subjective" 3-space must be transformed to a point T also on the subjective space. The transformations uses these elements: a pair of "observation points" P and Q, and an "objective" 3-space. The subjective and objective spaces and the two points all lie in four-dimensional space, and the two 3-spaces can intersect at some plane.
Draw line l$_1$ through points X and P. This line intersects the objective space at point R. Draw line l$_2$ through points R and Q. Line l$_2$ intersects the projective plane at point T. Then T is the transform of X.

## Analysis

Let
    $X:(x,y,z,0),$
    $T:(T_{x},T_{y},T_{z},0),$
    $P:(P_{x},P_{y},P_{z},P_{t}),$
    $Q:(Q_{x},Q_{y},Q_{z},Q_{t}).$
Let there be an "objective" 3-space described by
    $t=f(x,y,z)=mx+ny+kz+b$
Draw line l$_1$ through points P and X. This line intersects the objective plane at R. This intersection can be described parametrically as follows:
    $(1-\lambda _{1})X+\lambda _{1}P=(R_{x},R_{y},R_{z},mR_{x}+nR_{y}+kR_{z}+b).$
This implies the following four equations:
    $R_{x}=x+\lambda _{1}(P_{x}-x)$
    $R_{y}=y+\lambda _{1}(P_{y}-y)$
    $R_{z}=z+\lambda _{1}(P_{z}-z)$
    $R_{t}=\lambda _{1}P_{t}=mR_{x}+nR_{y}+kR_{z}+b$
Substitute the first three equations into the last one:
    $(mx+ny+kz)+\lambda _{1}(mP_{x}+nP_{y}+kP_{z}-mx-ny-kz-P_{t})+b=0$
Solve for λ$_1$,
    $\lambda _{1}={-(b+mx+ny+kz) \over m(P_{x}-x)+n(P_{y}-y)+k(P_{z}-z)-P_{t}}={\lambda _{1N} \over \lambda _{1D}}.$
Draw line l$_2$ through points R and Q. This line intersects the subjective 3-space at T. This intersection can be represented parametrically as follows:
    $(1-\lambda _{2})R+\lambda _{2}Q=(T_{x},T_{y},T_{z},0)$
This implies the following four equations:
    $T_{x}=R_{x}+\lambda _{2}(Q_{x}-R_{x}),$
    $T_{y}=R_{y}+\lambda _{2}(Q_{y}-R_{y}),$
    $T_{z}=R_{z}+\lambda _{2}(Q_{z}-R_{z}),$
    $R_{t}+\lambda _{2}(Q_{t}-R_{t})=0.$
The last equation can be solved for λ$_2$,
    $\lambda _{2}={R_{t} \over R_{t}-Q_{t}}$
which can then be substituted into the other three equations:
    $T_{x}=R_{x}+R_{t}{Q_{x}-R_{x} \over R_{t}-Q_{t}}={R_{t}Q_{x}-R_{x}Q_{t} \over R_{t}-Q_{t}},$
    $T_{y}=R_{y}+R_{t}{Q_{y}-R_{y} \over R_{t}-Q_{t}}={R_{t}Q_{y}-R_{y}Q_{t} \over R_{t}-Q_{t}},$
    $T_{z}=R_{z}+R_{t}{Q_{z}-R_{z} \over R_{t}-Q_{t}}={R_{t}Q_{z}-R_{z}Q_{t} \over R_{t}-Q_{t}}.$
Substitute the values for R$_x$, R$_y$, R$_z$, and R$_t$ obtained from the first intersection into the above equations for T$_x$, T$_y$, and T$_z$,
    $T_{x}={\lambda _{1}P_{t}Q_{x}-[x+\lambda _{1}(P_{x}-x)]Q_{t} \over \lambda _{1}P_{t}-Q_{t}}={\lambda _{1}[P_{t}Q_{x}-Q_{t}(P_{x}-x)]-xQ_{t} \over \lambda _{1}P_{t}-Q_{t}},$
    $T_{y}={\lambda _{1}P_{t}Q_{y}-[y+\lambda _{1}(P_{y}-y)]Q_{t} \over \lambda _{1}P_{t}-Q_{t}}={\lambda _{1}[P_{t}Q_{y}-Q_{t}(P_{y}-y)]-yQ_{t} \over \lambda _{1}P_{t}-Q_{t}},$
    $T_{z}={\lambda _{1}P_{t}Q_{z}-[z+\lambda _{1}(P_{z}-z)]Q_{t} \over \lambda _{1}P_{t}-Q_{t}}={\lambda _{1}[P_{t}Q_{z}-Q_{t}(P_{z}-z)]-zQ_{t} \over \lambda _{1}P_{t}-Q_{t}}.$
Multiply both numerators and denominators of the above three equations by the denominator of lambda$_1$: λ$_{1D}$,
    $T_{x}={\lambda _{1N}[P_{t}Q_{x}-Q_{t}(P_{x}-x)]-xQ_{t}\lambda _{1D} \over P_{t}\lambda _{1N}-Q_{t}\lambda _{1D}},$
    $T_{y}={\lambda _{1N}[P_{t}Q_{y}-Q_{t}(P_{y}-y)]-yQ_{t}\lambda _{1D} \over P_{t}\lambda _{1N}-Q_{t}\lambda _{1D}},$
    $T_{z}={\lambda _{1N}[P_{t}Q_{z}-Q_{t}(P_{z}-z)]-zQ_{t}\lambda _{1D} \over P_{t}\lambda _{1N}-Q_{t}\lambda _{1D}},$
Plug in the values of the numerator and denominator of lambda$_1$:
    $\lambda _{1N}=b+mx+ny+kz$
    $\lambda _{1D}=P_{t}+m(x-P_{x})+n(y-P_{y})+k(z-P_{z})$
to obtain
    $T_{x}={T_{xN} \over T_{xD}}={(b+mx+ny+kz)[P_{t}Q_{x}-Q_{t}(P_{x}-x)]-xQ_{t}[P_{t}+m(x-P_{x})+n(y-P_{y})+k(z-P_{z})] \over P_{t}(b+mx+ny+kz)-Q_{t}[P_{t}+m(x-P_{x})+n(y-P_{y})+k(z-P_{z})]}.$
    $T_{y}={T_{yN} \over T_{xD}}$,
    $T_{yN}=(b+mx+ny+kz)[P_{t}Q_{y}-Q_{t}(P_{y}-y)]-yQ_{t}[P_{t}+m(x-P_{x})+n(y-P_{y})+k(z-P_{z})],$
    $T_{z}={T_{zN} \over T_{xD}}$.
The numerator T$_{xN}$ can be expanded. It will be found that second-degree terms of x, y, and z will cancel each other out. Then collecting terms with common x, y, and z yields
    $T_{xN}=x(mP_{t}Q_{x}+nP_{y}Q_{t}+kP_{z}Q_{t}+Q_{t}(b-P_{t}))+yn(P_{t}Q_{x}-P_{x}Q_{t})+zk(P_{t}Q_{x}-P_{x}Q_{t})+b(P_{t}Q_{x}-P_{x}Q_{t})$
Likewise, the denominator becomes
    $T_{xD}=(mx+ny+kz)(P_{t}-Q_{t})+(mP_{x}+nP_{y}+kP_{z})Q_{t}+P_{t}(b-Q_{t}).$
The numerator T$_{yN}$, when expanded and then simplified, becomes
    $T_{yN}=xm(P_{t}Q_{y}-P_{y}Q_{t})+y(mP_{x}Q_{t}+nP_{t}Q_{y}+kP_{z}Q_{t}+Q_{t}(b-P_{t}))+zk(P_{t}Q_{y}-P_{y}Q_{t})+b(P_{t}Q_{y}-P_{y}Q_{t}).$
Likewise, the numerator T$_{zN}$ becomes
    $T_{zN}=xm(P_{t}Q_{z}-P_{z}Q_{t})+yn(P_{t}Q_{z}-P_{z}Q_{t})+z(mP_{x}Q_{t}+nP_{y}Q_{t}+kP_{t}Q_{z}+Q_{t}(b-P_{t}))+b(P_{t}Q_{z}-P_{z}Q_{t}).$

## Quadrilinear fractional transformations

Let
    $\alpha =mP_{t}Q_{x}+nP_{y}Q_{t}+kP_{z}Q_{t}+Q_{t}(b-P_{t}),$
    $\beta =n(P_{t}Q_{x}-P_{x}Q_{t}),$
    $\gamma =k(P_{t}Q_{x}-P_{x}Q_{t}),$
    $\delta =b(P_{t}Q_{x}-P_{x}Q_{t}),$
    $\epsilon =m(P_{t}-Q_{t}),$
    $\zeta =n(P_{t}-Q_{t}),$
    $\eta =k(P_{t}-Q_{t}),$
    $\theta =(mP_{x}+nP_{y}+kP_{z})Q_{t}+P_{t}(b-Q_{t}),$
    $\iota =m(P_{t}Q_{y}-P_{y}Q_{t}),$
    $\kappa =mP_{x}Q_{t}+nP_{t}Q_{y}+kP_{z}Q_{t}+Q_{t}(b-P_{t}),$
    $\lambda =k(P_{t}Q_{y}-P_{y}Q_{t}),$
    $\mu =b(P_{t}Q_{y}-P_{y}Q_{t}),$
    $\nu =m(P_{t}Q_{z}-P_{z}Q_{t}),$
    $\xi =n(P_{t}Q_{z}-P_{z}Q_{t}),$
    $o=mP_{x}Q_{t}+nP_{y}Q_{t}+kP_{t}Q_{z}+Q_{t}(b-P_{t}),$
    $\rho =b(P_{t}Q_{z}-P_{z}Q_{t}).$
Then the transformation in 3-space can be expressed as follows,
    $T_{x}={\alpha x+\beta y+\gamma z+\delta \over \epsilon x+\zeta y+\eta z+\theta },$
    $T_{y}={\iota x+\kappa y+\lambda z+\mu \over \epsilon x+\zeta y+\eta z+\theta },$
    $T_{z}={\nu x+\xi y+oz+\rho \over \epsilon x+\zeta y+\eta z+\theta }.$
The sixteen coefficients of this transformation can be arranged in a coefficient matrix
    $M_{T}={\begin{bmatrix}\alpha &\beta &\gamma &\delta \\\iota &\kappa &\lambda &\mu \\\nu &\xi &o&\rho \\\epsilon &\zeta &\eta &\theta \end{bmatrix}}.$
Whenever this matrix is invertible, its coefficients will describe a quadrilinear fractional transformation.
Transformation T in 3-space can also be represented in terms of homogeneous coordinates as
    $T:[x:y:z:1]\rightarrow [\alpha x+\beta y+\gamma z+\delta :\iota x+\kappa y+\lambda z+\mu :\nu x+\xi y+oz+\rho :\epsilon x+\zeta y+\eta z+\theta ].$
This means that the coefficient matrix of T can operate directly on 4-component vectors of homogeneous coordinates. Transformation of a point can be effected simply by multiplying the coefficient matrix with the position vector of the point in homogeneous coordinates. Therefore, if T transforms a point on the plane at infinity, the result will be
    $T:[x:y:z:0]\rightarrow [\alpha x+\beta y+\gamma z:\iota x+\kappa y+\lambda z:\nu x+\xi y+oz:\epsilon x+\zeta y+\eta z].$
If ε, ζ, and η are not all equal to zero, then T will transform the plane at infinity into a locus of points which lie mostly in affine space. If ε, ζ, and η are all zero, then T will be a special kind of projective transformation called an affine transformation, which transforms affine points into affine points and ideal points (i.e. points at infinity) into ideal points.
The group of affine transformations has a subgroup of affine rotations whose matrices have the form
    $M_{AR}={\begin{bmatrix}\alpha &\beta &\gamma &0\\\iota &\kappa &\lambda &0\\\nu &\xi &o&0\\0&0&0&1\end{bmatrix}}$
such that the submatrix
    ${\begin{bmatrix}\alpha &\beta &\gamma \\\iota &\kappa &\lambda \\\nu &\xi &o\end{bmatrix}}$
is orthogonal.

## Properties of quadrilinear fractional transformations

Given a pair of quadrilinear fractional transformations T$_1$ and T$_2$, whose coefficient matrices are $M_{T_{1}}$ and $M_{T_{2}}$, then the composition of these pair of transformations is another quadrilinear transformation T$_3$ whose coefficient matrix $M_{T_{3}}$ is equal to the product of the first and second coefficient matrices,
    $(T_{3}=T_{2}\circ T_{1})\leftrightarrow (M_{T_{3}}=M_{T_{2}}M_{T_{1}}).$
The identity quadrilinear fractional transformation T$_I$ is the transformation whose coefficient matrix is the identity matrix.
Given a spatial projectivity T$_1$ whose coefficient matrix is $M_{T_{1}}$, the inverse of this projectivity is another projectivity T$_{−1}$ whose coefficient matrix $M_{T_{-1}}$ is the inverse of T$_1$′s coefficient matrix,
    $(T_{-1}\circ T_{1}=T_{I})\leftrightarrow (M_{T_{-1}}M_{T_{1}}=I)$.
Composition of quadrilinear transformations is associative, therefore the set of all quadrilinear transformations, together with the operation of composition, form a group.
This group of quadrilinear transformations contains subgroups of trilinear transformations. For example, the subgroup of all quadrilinear transformations whose coefficient matrices have the form
    ${\begin{bmatrix}\alpha &\beta &0&\delta \\\iota &\kappa &0&\mu \\0&0&0&0\\\epsilon &\zeta &0&\theta \end{bmatrix}}$
is isomorphic to the group of all trilinear transformations whose coefficient matrices are
    ${\begin{bmatrix}\alpha &\beta &\delta \\\iota &\kappa &\mu \\\epsilon &\zeta &\theta \end{bmatrix}}.$
This subgroup of quadrilinear transformations all have the form
    $T:(x,y,z)\rightarrow \left({\alpha x+\beta y+\delta \over \epsilon x+\zeta y+\theta },{\iota x+\kappa y+\mu \over \epsilon x+\zeta y+\theta },0\right).$
This means that this subgroup of transformations will act on the plane z = 0 just like a group of trilinear transformations.

## Spatial transformations of planes

Projective transformations in 3-space transform planes into planes. This can be demonstrated more easily using homogeneous coordinates.
Let
    $z=mx+ny+b$
be the equation of a plane. This is equivalent to
    $mx+ny-z+b=0.\qquad \qquad (21)$
Equation (21) can be expressed as a matrix product:
    $[m\ n\ -1\ b]{\begin{bmatrix}x\\.\ .\\y\\.\ .\\z\\.\ .\\1\end{bmatrix}}=0.$
A permutation matrix can be interposed between the two vectors, in order to make the plane vector have homogeneous coordinates:
    $[m:n:b:1]{\begin{bmatrix}1&0&0&0\\\ &\ &\ &\ \\0&1&0&0\\\ &\ &\ &\ \\0&0&0&1\\\ &\ &\ &\ \\0&0&-1&0\end{bmatrix}}{\begin{bmatrix}x\\.\ .\\y\\.\ .\\z\\.\ .\\1\end{bmatrix}}=0.\qquad \qquad (22)$
A quadrilinear transformation should convert this to
    $[T_{m}:T_{n}:T_{b}:1]{\begin{bmatrix}1&0&0&0\\\ &\ &\ &\ \\0&1&0&0\\\ &\ &\ &\ \\0&0&0&1\\\ &\ &\ &\ \\0&0&-1&0\end{bmatrix}}{\begin{bmatrix}T_{x}\\.\ .\\T_{y}\\.\ .\\T_{z}\\.\ .\\1\end{bmatrix}}=0\qquad \qquad (23)$
where
    ${\begin{bmatrix}T_{x}\\.\ .\\T_{y}\\.\ .\\T_{z}\\.\ .\\1\end{bmatrix}}={\begin{bmatrix}\alpha &\beta &\gamma &\delta \\\ &\ &\ &\ \\\iota &\kappa &\lambda &\mu \\\ &\ &\ &\ \\\nu &\xi &o&\rho \\\ &\ &\ &\ \\\epsilon &\zeta &\eta &\theta \end{bmatrix}}{\begin{bmatrix}x\\.\ .\\y\\.\ .\\z\\.\ .\\1\end{bmatrix}}.\qquad \qquad (24)$
Equation (22) is equivalent to $[m:n:b:1]{\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&-1&0\end{bmatrix}}{\begin{bmatrix}{\bar {\alpha }}&{\bar {\iota }}&{\bar {\nu }}&{\bar {\epsilon }}\\{\bar {\beta }}&{\bar {\kappa }}&{\bar {\xi }}&{\bar {\zeta }}\\{\bar {\gamma }}&{\bar {\lambda }}&{\bar {o}}&{\bar {\eta }}\\{\bar {\delta }}&{\bar {\mu }}&{\bar {\rho }}&{\bar {\theta }}\end{bmatrix}}{\begin{bmatrix}\alpha &\beta &\gamma &\delta \\\iota &\kappa &\lambda &\mu \\\nu &\xi &o&\rho \\\epsilon &\zeta &\eta &\theta \end{bmatrix}}{\begin{bmatrix}x\\.\ .\\y\\.\ .\\z\\.\ .\\1\end{bmatrix}}=0\qquad \qquad (25)$ where
    ${\bar {\alpha }}=\left|{\begin{matrix}\kappa &\lambda &\mu \\\xi &o&\rho \\\zeta &\eta &\theta \end{matrix}}\right|;\qquad {\bar {\beta }}=\left|{\begin{matrix}\lambda &\mu &\iota \\o&\rho &\nu \\\eta &\theta &\epsilon \end{matrix}}\right|,$ etc.
Applying equation (24) to equation (25) yields
    $[m:n:b:1]{\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&-1&0\end{bmatrix}}{\begin{bmatrix}{\bar {\alpha }}&{\bar {\iota }}&{\bar {\nu }}&{\bar {\epsilon }}\\{\bar {\beta }}&{\bar {\kappa }}&{\bar {\xi }}&{\bar {\zeta }}\\{\bar {\gamma }}&{\bar {\lambda }}&{\bar {o}}&{\bar {\eta }}\\{\bar {\delta }}&{\bar {\mu }}&{\bar {\rho }}&{\bar {\theta }}\end{bmatrix}}{\begin{bmatrix}T_{x}\\.\ .\\T_{y}\\.\ .\\T_{z}\\.\ .\\1\end{bmatrix}}=0.\qquad \qquad (26)$
Combining equations (26) and (23) produces
    ${\begin{bmatrix}{\bar {\alpha }}&{\bar {\beta }}&{\bar {\gamma }}&{\bar {\delta }}\\{\bar {\iota }}&{\bar {\kappa }}&{\bar {\lambda }}&{\bar {\mu }}\\{\bar {\nu }}&{\bar {\xi }}&{\bar {o}}&{\bar {\rho }}\\{\bar {\epsilon }}&{\bar {\zeta }}&{\bar {\eta }}&{\bar {\theta }}\end{bmatrix}}{\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&-1\\0&0&1&0\end{bmatrix}}{\begin{bmatrix}m\\.\ .\\n\\.\ .\\b\\.\ .\\1\end{bmatrix}}={\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&-1\\0&0&1&0\end{bmatrix}}{\begin{bmatrix}T_{m}\\.\ .\\T_{n}\\.\ .\\T_{b}\\.\ .\\1\end{bmatrix}}.$
Solve for $[T_{m}:T_{n}:T_{b}:1]^{T}$,
    ${\begin{bmatrix}T_{m}\\.\ .\\T_{n}\\.\ .\\T_{b}\\.\ .\\1\end{bmatrix}}={\begin{bmatrix}{\bar {\alpha }}&{\bar {\beta }}&{\bar {\delta }}&-{\bar {\gamma }}\\{\bar {\iota }}&{\bar {\kappa }}&{\bar {\mu }}&-{\bar {\lambda }}\\{\bar {\epsilon }}&{\bar {\zeta }}&{\bar {\theta }}&-{\bar {\eta }}\\-{\bar {\nu }}&-{\bar {\xi }}&-{\bar {\rho }}&{\bar {o}}\end{bmatrix}}{\begin{bmatrix}m\\.\ .\\n\\.\ .\\b\\.\ .\\1\end{bmatrix}}.\qquad \qquad (27)$
Equation (27) describes how 3-space transformations convert a plane (m, n, b) into another plane (T$_m$, T$_n$, T$_b$) where
    $T_{m}={{\bar {\alpha }}m+{\bar {\beta }}n+{\bar {\delta }}b-{\bar {\gamma }} \over -{\bar {\nu }}m-{\bar {\xi }}n-{\bar {\rho }}b+{\bar {o}}},$
    $T_{n}={{\bar {\iota }}m+{\bar {\kappa }}n+{\bar {\mu }}b-{\bar {\lambda }} \over -{\bar {\nu }}m-{\bar {\xi }}n-{\bar {\rho }}b+{\bar {o}}},$
    $T_{b}={{\bar {\epsilon }}m+{\bar {\zeta }}n+{\bar {\theta }}b-{\bar {\eta }} \over -{\bar {\nu }}m-{\bar {\xi }}n-{\bar {\rho }}b+{\bar {o}}}.$