# Introduction to Projective Geometry Solutions 5.10

## Affine Transformations

A 11 minute read, posted on 20 Sep 2019

Tags computer vision, projective geometry, problem solution

Please read this introduction first before looking through the solutions. Here’s a quick index to all the problems in this section.

#### 1. Prove Corollary 1, Theorem 3.

If $P’$, $Q’$, and $R’$ are, respectively, the images of three collinear points, $P$, $Q$ and $R$, under an affine transformation, then as the directions, and hence the slopes, of the segments $\overline{PQ}$ and $\overline{PR}$ are the same, using Theorem 3, we get

$$\frac{\overline{P’Q’}}{PQ} = \frac{\overline{Q’R’}}{QR}$$ $$\implies \frac{\overline{P’Q’}}{Q’R’} = \frac{\overline{PQ}}{QR}$$

Hence, the ratio in which $Q$ divides the segment $\overline{PR}$ is equal to the ratio in which $Q’$ divides the segment $\overline{P’R’}$.

#### 2. Prove that an affine transformation always transforms an ellipse into an ellipse, a parabola into a parabola, and a hyperbola into a hyperbola.

From Exercise 6 Sec 2.3, we know that a conic in the euclidean plane is a hyperbola, a parabola, or an ellipse according as its representation in $E_2^+$ intersects the ideal line in two points, one point, or no (real) points.

As the ideal line is invariant under an affine transformation and incidence is preserved under any collineation, the number of intersections of a conic section with the ideal line also remains unchanged. Hence the classification of the transformed conic section in the euclidean plane is the same as its preimage.

#### 3. Is the group of affine transformations a commutative group?

Multiplying two matrices representing two different affine transformations clearly demonstrates that the group of affine transformations is not a commutative group.

#### 4. Give an example of an affine transformation of each of the six possible types.

##### Type I

$\begin{pmatrix} 3 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{pmatrix}$

##### Type II

$\begin{pmatrix} 2 & 3 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{pmatrix}$

##### Type III

$\begin{pmatrix} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 1 \end{pmatrix}$

##### Type IV

$\begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{pmatrix}$

##### Type V

$\begin{pmatrix} 1 & 0 & 2 \\ 0 & 1 & 3 \\ 0 & 0 & 1 \end{pmatrix}$

##### Type VI

$\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$

#### 5. Give a proof of Theorem 3 based on the invariance of the cross ratio under an arbitrary collineation.

Let $\Omega$ be the ideal point on line $PQR$. Then its image, $\Omega’$, will be another point on the ideal line as the ideal line is invariant under an affine transformation.

By the invariance of the cross ratio under a collineation, we have

$$℞(P, R, Q, \Omega) = ℞(P’, R’, Q’, \Omega’)$$

From the Exercise 11, Sec 4.7, we know that

$$℞(P, R, Q, \Omega) = -\frac{(PQ)}{(RQ)}$$

where $(AB)$ denotes the length of the segment $\overline{AB}$.

Combining the two results above, we get $$\frac{(PQ)}{(RQ)} = \frac{(P’Q’)}{(R’Q’)}$$ $$\implies \frac{(PQ)}{(P’Q’)} = \frac{(RQ)}{(R’Q’)}$$

Hence the length of each segment on a line is scaled by the same factor under an affine transformation.

This is as far as I could go with the proof; I couldn’t prove that the scaling factor depends only on the direction of the line and the transformation. Maybe I’ll get back to it someday when I have the time.

#### 6. Prove that the images of all circles under a given affine transformation are similar ellipses whose major axes are all parallel.

This one is the most unconventional use of Theorem 1 in my opinion.

We already know from #2 that the image of an ellipse will be an ellipse under an affine transformation. As a circle is an ellipse, its image will also be an ellipse under an affine transformation.

Consider a general circle $\Gamma$ that gets transformed into an ellipse $\Gamma’$. The diameter of $\Gamma$ that gets transformed into the major axis of $\Gamma’$ is also the direction in which scaling factor of the affine transformation is the largest (by the definition of the major axis of an ellipse).

Using Theorem 1, under a given affine transformation this scaling factor only depends on the direction of the diameter. Hence the diameter of any other circle in the same direction will also get transformed to be the major axis of its image ellipse. Finally, as affine transformations preserve parallelism, the major axes of the image ellipses will be parallel (in the same direction).

#### 7. Find the most general affine transformation of period 2.

Consider a general affine transformation $$A = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ 0 & 0 & 1 \end{pmatrix}$$

$$A^2 = \begin{pmatrix} a_{11}^2 + a_{12}a_{21} & a_{12}a_{22} + a_{11}a_{12} & a_{12}a_{23} + a_{11}a_{13} + a_{13} \\ a_{21}a_{22} + a_{11}a_{21} & a_{22}^2 + a_{12}a_{21} & a_{22}a_{23} + a_{23} + a_{21}a_{13} \\ 0 & 0 & 1 \end{pmatrix}$$

For $A$ to be periodic, the following must hold. $$a_{11}^2 + a_{12}a_{21} = 1$$ $$a_{12}a_{22} + a_{11}a_{12} = 0$$ $$a_{12}a_{23} + a_{11}a_{13} + a_{13} = 0$$ $$a_{21}a_{22} + a_{11}a_{21} = 0$$ $$a_{22}^2 + a_{12}a_{21} = 1$$ $$a_{22}a_{23} + a_{23} + a_{21}a_{13} = 0$$

This implies $$a_{11} = -a_{22}$$ $$a_{21} = \frac{1 - a_{11}^2}{a_{12}}$$ $$a_{13} = \frac{-a_{12}a_{23}}{1 + a_{11}}$$

Writing $\frac{a_{23}}{1 + a_{11}}$ as $k$, for $A$ to be period it must have the form

$$A = \begin{pmatrix} a_{11} & a_{12} & -ka_{12} \\ \frac{1 - a_{11}^2}{a_{12}} & -a_{11} & k(1 + a_{11}) \\ 0 & 0 & 1 \end{pmatrix}$$

#### 8. Are there any directions such that the length of segments in these directions are unaltered by a given affine transformation?

Setting the scaling factor to 1 we get

$$(a_{12}^2 + a_{22}^2)m^2 + 2(a_{11}a_{12} + a_{21}a_{22})m + a_{11}^2 + a_{21}^2 = 1 + m^2$$ $$\implies(a_{12}^2 + a_{22}^2 - 1)m^2 + 2(a_{11}a_{12} + a_{21}a_{22})m + a_{11}^2 + a_{21}^2 - 1 = 0$$

The roots of this quadratic equation in $m$ are the two directions in which length of segments are unaltered for a given affine transformation.

#### 9. Show that there is a maximum and minimum to the value of the factor by which an affine transformation multiplies the length of an arbitrary segment.

Consider the scaling factor $$\frac{(a_{12}^2 + a_{22}^2)m^2 + 2(a_{11}a_{12} + a_{21}a_{22})m + a_{11}^2 + a_{21}^2}{1 + m^2}$$

Dividing both numerator and denominator by $m^2$, we get $$\frac{(a_{12}^2 + a_{22}^2) + \frac{2(a_{11}a_{12}}{m} + a_{21}a_{22})m + \frac{a_{11}^2 + a_{21}^2}{m^2}}{\frac{1}{m^2} + 1}$$

When $m \rightarrow \pm \infty$, this value is still a scalar. Hence, the scaling factor is bounded and has a maximum and minimum value.

Another way to look at this is that under any affine transformation, a circle is transformed into an ellipse. This means there exist directions corresponding to the maximum and minimum scaling factors which are the preimages of the major and minor axes of the ellipse respectively. If one of the extrema didn’t exist, the image would be a parabola and if both didn’t exist, it would be a hyperbola which is not the case.

#### 10. Prove that the directions in which an affine transformation multiplies lengths by the greatest and least factors are perpendicular.

This is similar to the proof above.

Under any affine transformation a circle is transformed into an ellipse with the major and minor axes being the directions of most and least scaling respectively. We know that the major and minor axes of an ellipse are perpendicular to each other. Hence, the directions in which an affine transformation multiplies lengths by the greatest and least factors are perpendicular.

#### 11. Let $\Gamma’: a’(x’_1)^2 + 2b’x’_1x’_2 + c’(x’_2)^2 + 2d’x’_1x’_3 + 2e’x’_2x’_3 + f’(x’_3)^2 = 0$ be the image of the conic $\Gamma: a(x_1)^2 + 2bx_1x_2 + c(x_2)^2 + 2dx_1x_3 + 2ex_2x_3 + f(x_3)^2 = 0$ under an arbitrary affine transformation. What relation, if any, exists between the quantities $b’^2 - a’c’$ and $b^2 - ac$? What relation, if any, exists between the discriminants of $\Gamma$ and $\Gamma’$?

This is pretty straightforward; it’s not even related to affine transformations specifically.

Under the collineation $X’ = AX$, a general conic $X^TBX = 0$ gets transformed to $(A^{-1}X’)^TB(A^{-1}X’) = 0$ or $X’^TA^{-T}BA^{-1}X = 0$. So the new matrix of quadratic form is $B’ = A^{-T}BA^{-1}$. This means $B = A^TB’A$.

$b^2 - ac$ and $b’^2 - a’c’$ are the $2\times2$ subdeterminants of $B$ and $B’$ respectively. Expanding $B = A^TB’A$ and calculating the value of these subdeterminants, it’s easy to see that

$$b^2 - ac = (a_{11}a_{22} - a_{12}a_{21})^2(b’^2 - a’c’)$$

As the first term is a square, the signs of both $b^2 - ac$ and $b’^2 - a’c’$ terms are the same. This once again proves that an affine transformation maintains the euclidean classification of conics.

The discriminant of a conic is the determinant of its quadratic form. From $B = A^TB’A$ using the multiplication rule of determinants, we get $$|B| = |A^T||B’||A|$$ As the determinant of the transpose is equal to determinant of the matrix, we get $$|B| = |A|^2|B’|$$

This shows that nonsingular conics remain nonsingular under an affine transformation.

#### 12. Let $\bigtriangleup PQR$ and $\bigtriangleup P’Q’R’$ be two finite triangles. Prove that there is a unique affine transformation which maps $P$ into $P’$, $Q$ into $Q’$, and $R$ into $R’$.

As we have four sets of lines and their images, no three of which are concurrent, $PQ \rightarrow P’Q’$, $QR \rightarrow Q’R’$, $PR \rightarrow P’R’$ and the invariant ideal line, by the dual of Theorem 4, Sec 5.8, we can uniquely determine an affine transformation to perform this mapping.

#### 13. Using the fact that the diagonals of a parallelogram bisect each other, give a geometric proof of the fact that if $P’$, $Q’$ and $R’$ are, respectively, the images of three collinear points $P$, $Q$, $R$ under an affine transformation, and if $Q$ is the midpoint of the segment $\overline{PR}$, then $Q’$ is the midpoint of the segment $\overline{P’R’}$.

As an affine transformation preserves parallelism between lines, a parallelogram will transform into a parallelogram under an affine transformation. Also, as a general collineation preserves incidence, the point of intersection of the two diagonals of the original parallogram will be transformed into the point of intersection of the two diagonals of the transformed parallelogram.

Hence, if we consider two diagonally opposite vertices of the original parallelogram to be $P$ and $R$ with the point of intersection of its diagonals being $Q$, it follows that $Q’$ will be the midpoint of $P’R’$ as it will be the point of intersection of $P’R’$ and the other diagonal of the transformed parallelogram.

#### 14. Using the appropriate property of a general parallelogram, prove that if $P’$, $Q’$, $R’$ are, respectively the images of three collinear points $P$, $Q$, $R$ under an affine transformation, and if $Q$ divides the segment $\overline{PR}$ in the ratio $\frac{1}{3}$ then $Q’$ divides the segment $\overline{P’R’}$ in the ratio $\frac{1}{3}$.

Let $P$ and $R$ be diagonally opposite sides of a parallelogram $PSRT$ with $Q$ dividing $\overline{PR}$ in the ratio $1:3$. Let $B$ be the point where the two diagonals intersect.

Consider $\bigtriangleup PTS$. $PB$ is one of the medians of the triangle and as $Q$ divides it in the ratio $2:1$, $TA$ must also be a median of the triangle and $A$ must be the midpoint of $PS$.

As we have already proven in #13 that the midpoint of a segment will be transformed to the midpoint of the image of that segment under an affine transformation, $T’A’$ and $P’B’$ will remain medians of $\bigtriangleup P’T’S’$. This means the intersection of the medians, $Q’$, will divide $P’B’$ in the ratio $2:1$. Hence $Q’$ will divide $P’R’$ in the ration $1:3$.

#### 15. Can Exercise 14 be generalized to provide a proof of the fact that if $P’$, $Q’$, $R’$ are respectively the images of three collinear points $P$, $Q$, $R$ under an affine transformation, and if $Q$ divides the segment $\overline{PR}$ in the ratio $\frac{1}{n}$ then $Q’$ divides the segment $\overline{P’R’}$ in the ratio $\frac{1}{n}$?

From the solution to the previous exercise, we know that the line connecting one of the vertices of the parallelogram to the midpoint of the opposite vertex intersects the opposite diagonal in a point that divides the diagonal in the ratio $1:3$. This statement can be generalized to the following statement.

The line joining a vertex of the parallelogram to the point that divides the opposite side in the ratio $1: n-1$ intersects the diagonal opposite to the vertex at a point that divides the diagonal in the ratio $1:n$.

I didn’t prove this statement but had a hunch and tried it out in geogebra to find, to my pleasant surprise, that it’s correct. Geogebra is so useful. I also want to acknowledge my engineering background that gave me the nudge to just “try it out”. Maybe when I get more time I’ll come back to figure out the proof.

In this parallelogram,

$BC:BC = 1:1 \implies BG:GD = 1:2$

$BE:EC = 1:2 \implies BL:LD = 1:3$

$BJ:JC = 1:3 \implies BH:HD = 1:4$

$BF:FC = 1:4 \implies BI:ID = 1:5$

Using the general statement above we can generalize the proof of exercise 14 to prove that if $P’$, $Q’$, $R’$ are respectively the images of three collinear points $P$, $Q$, $R$ under an affine transformation, and if $Q$ divides the segment $\overline{PR}$ in the ratio $\frac{1}{n}$ then $Q’$ divides the segment $\overline{P’R’}$ in the ratio $\frac{1}{n}$