\( \definecolor{colordef}{RGB}{249,49,84} \definecolor{colorprop}{RGB}{18,102,241} \)

Transformations affines

Les transformations affines sont des opérations géométriques fondamentales qui transforment des points en points, des droites en droites et des plans en plans tout en conservant le parallélisme. Elles sont largement utilisées en infographie, en physique et en robotique pour décrire des mouvements et des déformations. Une transformation affine combine une transformation linéaire (telle qu'une rotation, une homothétie ou une réflexion) avec une translation. Dans ce chapitre, nous explorons comment les matrices peuvent être utilisées pour représenter et effectuer ces transformations efficacement dans l'espace 2D.
Nous étudions comment un point objet \((x, y)\), défini par son vecteur position \(X = \begin{pmatrix} x \\ y \end{pmatrix}\), est transformé en un point image \((x', y')\), défini par son vecteur position \(X' = \begin{pmatrix} x' \\ y' \end{pmatrix}\), à l'aide de matrices.

Transformations linéaires

Définition Transformation linéaire en 2D
Une transformation \(T\) du plan est dite linéaire si elle transforme un point \(P(x, y)\) en un point image \(P'(x', y')\) tel que les coordonnées satisfont un système d'équations linéaires :$$\begin{cases}x' = ax + by \\ y' = cx + dy\end{cases}$$Ceci peut s'écrire sous forme matricielle :$$\begin{pmatrix} x' \\ y' \end{pmatrix} = A \begin{pmatrix} x \\ y \end{pmatrix} \quad \text{où} \quad A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}.$$La matrice \(A\) est appelée la matrice de transformation.
Une propriété clé des transformations linéaires est que l'origine est transformée en elle-même : \(T(0,0) = (0,0)\). De plus, les colonnes de la matrice \(A\) révèlent où atterrissent les vecteurs de base \(\vec{i}=\begin{pmatrix} 1 \\ 0 \end{pmatrix}\) et \(\vec{j}=\begin{pmatrix} 0 \\ 1 \end{pmatrix}\).$$ A\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} a \\ c \end{pmatrix} \quad \text{et} \quad A\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} b \\ d \end{pmatrix}. $$Cela signifie que la première colonne est l'image de \(\vec{i}\) et la deuxième colonne est l'image de \(\vec{j}\).
Exemple
Trouver l'image du point \(P(2, 3)\) par la transformation définie par la matrice \(A = \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix}\).

$$\begin{aligned}\begin{pmatrix} x' \\ y' \end{pmatrix} &= \begin{pmatrix} 2 & 0 \\ 0 & 3 \end{pmatrix} \begin{pmatrix} 2 \\ 3 \end{pmatrix}\\ &= \begin{pmatrix} 2(2) + 0(3) \\ 0(2) + 3(3) \end{pmatrix}\\ &= \begin{pmatrix} 4 \\ 9 \end{pmatrix} \end{aligned}$$L'image est \(P'(4, 9)\). Cette transformation représente un étirement horizontal de facteur 2 et un étirement vertical de facteur 3.

Transformations linéaires usuelles

Définition Homothétie / Étirement
  • Un étirement horizontal (ou étirement parallèle à l'axe des abscisses) de rapport \(k\) est représenté par :$$ S_x = \begin{pmatrix} k & 0 \\ 0 & 1 \end{pmatrix} $$
  • Un étirement vertical (ou étirement parallèle à l'axe des ordonnées) de rapport \(k\) est représenté par :$$ S_y = \begin{pmatrix} 1 & 0 \\ 0 & k \end{pmatrix} $$
  • Une agrandissement centrée à l'origine avec un facteur d'échelle horizontal \(k\) et un facteur d'échelle vertical \(m\) est représentée par :$$ S = \begin{pmatrix} k & 0 \\ 0 & m \end{pmatrix} $$Si \(k=m\), c'est une homothétie uniforme de rapport \(k\).
Exemple
Trouver l'image du vecteur position \(\begin{pmatrix} 2 \\ 3 \end{pmatrix}\) par un étirement horizontal de rapport 3.

La matrice pour un étirement horizontal de rapport \(k=3\) est \(S = \begin{pmatrix} 3 & 0 \\ 0 & 1 \end{pmatrix}\).$$\begin{aligned}X' &= SX \\ &= \begin{pmatrix} 3 & 0 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 2 \\ 3 \end{pmatrix} \\ &= \begin{pmatrix} 3(2) + 0(3) \\ 0(2) + 1(3) \end{pmatrix} \\ &= \begin{pmatrix} 6 \\ 3 \end{pmatrix}\end{aligned}$$

Définition Réflexion
  • Réflexion par rapport à l'axe des \(x\) : \((x, y) \to (x, -y)\) $$ M_x = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} $$
  • Réflexion par rapport à l'axe des \(y\) : \((x, y) \to (-x, y)\) $$ M_y = \begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} $$
  • Réflexion par rapport à la droite \(y=x\) : \((x, y) \to (y, x)\) $$ M_{y=x} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} $$
  • Réflexion par rapport à la droite \(y=(\tan\theta)x\):$$M_{y=(\tan\theta)x}=\begin{pmatrix}\cos(2\theta) & \sin(2\theta)\\ \sin(2\theta) & -\cos(2\theta)\end{pmatrix}.$$
Exemple
Trouver l'image du vecteur position \(\begin{pmatrix} 2 \\ 3 \end{pmatrix}\) par une réflexion par rapport à l'axe des \(x\).

La matrice pour une réflexion par rapport à l'axe des \(x\) est \(M_x = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\).$$\begin{aligned}X' &= M_x X \\ &= \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} 2 \\ 3 \end{pmatrix} \\ &= \begin{pmatrix} 1(2) + 0(3) \\ 0(2) + (-1)(3) \end{pmatrix} \\ &= \begin{pmatrix} 2 \\ -3 \end{pmatrix}\end{aligned}$$

Définition Rotation
Une rotation d'angle \(\theta\) dans le sens anti-horaire autour de l'origine est représentée par :$$ R_{\theta} = \begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{pmatrix} $$
Exemple
Trouver l'image du vecteur position \(\begin{pmatrix} 2 \\ 3 \end{pmatrix}\) par une rotation de \(90^\circ\) (\(\frac{\pi}{2}\) radians) dans le sens anti-horaire.

La matrice pour une rotation de \(90^\circ\) est \(R_{90^\circ} = \begin{pmatrix} \cos 90^\circ & -\sin 90^\circ \\ \sin 90^\circ & \cos 90^\circ \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\).$$\begin{aligned}X' &= R_{90^\circ} X \\ &= \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 2 \\ 3 \end{pmatrix} \\ &= \begin{pmatrix} 0(2) + (-1)(3) \\ 1(2) + 0(3) \end{pmatrix} \\ &= \begin{pmatrix} -3 \\ 2 \end{pmatrix}\end{aligned}$$

Translation

Définition Translation
Une translation de vecteur \(T = \begin{pmatrix} e \\ f \end{pmatrix}\) déplace chaque point \(P(x, y)\) vers \(P'(x', y')\) selon :$$\begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} x \\ y \end{pmatrix} + \begin{pmatrix} e \\ f \end{pmatrix} = \begin{pmatrix} x+e \\ y+f \end{pmatrix}.$$
Ce n'est pas une transformation linéaire (sauf si \(T=0\)) car l'origine \((0,0)\) est transformée en \((e, f)\) et non en elle-même.
Exemple
Trouver l'image du vecteur position \(\begin{pmatrix} 2 \\ 3 \end{pmatrix}\) par une translation de vecteur \(\begin{pmatrix} 1 \\ -2 \end{pmatrix}\).

$$\begin{aligned}X' &= X + T \\ &= \begin{pmatrix} 2 \\ 3 \end{pmatrix} + \begin{pmatrix} 1 \\ -2 \end{pmatrix} \\ &= \begin{pmatrix} 2+1 \\ 3+(-2) \end{pmatrix} \\ &= \begin{pmatrix} 3 \\ 1 \end{pmatrix}\end{aligned}$$

Transformation affine

Définition Transformation affine
Une transformation affine est une combinaison d'une transformation linéaire suivie d'une translation. Elle est représentée par l'équation matricielle :$$X' = AX + T$$où \(X = \begin{pmatrix} x \\ y \end{pmatrix}\), \(A\) est une matrice \(2\times 2\) (représentant rotation, mise à l'échelle, cisaillement, etc.), et \(T = \begin{pmatrix} e \\ f \end{pmatrix}\) est le vecteur de translation.
Exemple
Trouver l'image du point \(P(1, 2)\) par une transformation affine consistant en une rotation de \(90^\circ\) anti-horaire suivie d'une translation de \(\begin{pmatrix} 3 \\ -1 \end{pmatrix}\).

La matrice de rotation est \(R_{90^\circ} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\). Le vecteur de translation est \(T = \begin{pmatrix} 3 \\ -1 \end{pmatrix}\).$$\begin{aligned}X' &= \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 1 \\ 2 \end{pmatrix} + \begin{pmatrix} 3 \\ -1 \end{pmatrix}\\ &= \begin{pmatrix} -2 \\ 1 \end{pmatrix} + \begin{pmatrix} 3 \\ -1 \end{pmatrix}\\ &= \begin{pmatrix} 1 \\ 0 \end{pmatrix}\\ \end{aligned}$$Le point image est \((1, 0)\).

Composition de transformations

Définition ransformation composée
Une transformation composée est le résultat de l'application de plusieurs transformations à un objet.
Exemple
Si la transformation \(T_1\) a pour matrice \(A\) et la transformation \(T_2\) a pour matrice \(B\), appliquer \(T_1\) puis \(T_2\) correspond à la multiplication matricielle \(BA\).$$\begin{aligned} X' &= T_2(T_1(X))\\ &= B(AX)\\ & = (BA)X\end{aligned} $$
Proposition L'ordre est important
Lorsque plusieurs transformations sont appliquées séquentiellement, l'ordre compte.
Exemple
  1. Trouver la matrice unique qui représente une réflexion par rapport à l'axe des abscisses suivie d'une rotation de \(90^\circ\) anti-horaire.
  2. Trouver la matrice unique qui représente une rotation de \(90^\circ\) anti-horaire suivie d'une réflexion par rapport à l'axe des abscisses.
  3. Comparer les résultats.

Soit \(M_x = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\) la réflexion et \(R_{90} = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\) la rotation.
  1. La transformation combinée de la rotation appliquée après la réflexion est$$\begin{aligned}T_1 &= R_{90} M_x \\ &=\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\\ &= \begin{pmatrix} 0(1)+(-1)(0) & 0(0)+(-1)(-1) \\ 1(1)+0(0) & 1(0)+0(-1) \end{pmatrix}\\ &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\\ \end{aligned}$$Cela représente une réflexion par rapport à la droite \(y=x\).
  2. La transformation combinée de la réflexion appliquée après la rotation est$$\begin{aligned}T_2 &= M_x R_{90} \\ &=\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\\ &= \begin{pmatrix} 1(0)+0(1) & 1(-1)+0(0) \\ 0(0)+(-1)(1) & 0(-1)+(-1)(0) \end{pmatrix}\\ &= \begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}\\ \end{aligned}$$Cela représente une réflexion par rapport à la droite \(y=-x\).
  3. On voit que \(T_1 \neq T_2\). Par conséquent, l'ordre des transformations est important.

Aire et déterminant

Proposition Facteur d'échelle d'aire
Soit \(A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}\) la matrice d'une transformation linéaire.
Si une forme d'aire \(S\) est transformée par \(A\), l'aire de la forme image \(S'\) est donnée par :$$ \text{Aire}(S') = |\det(A)| \times \text{Aire}(S) = |ad-bc| \times \text{Aire}(S) $$La valeur absolue du déterminant représente le facteur d'échelle d'aire.
Si \(\det(A) = 1\) ou \(-1\), la transformation conserve l'aire (ex : rotation, réflexion).
Si \(\det(A) = 0\), la transformation projette tout le plan sur une droite ou un point (l'aire s'effondre à zéro).
Exemple
Un carré unité (Aire = 1) est transformé par \(A = \begin{pmatrix} 3 & 1 \\ 0 & 2 \end{pmatrix}\). Calculer l'aire de l'image.

$$ \det(A) = (3)(2) - (1)(0) = 6. $$L'aire de l'image est \(|6| \times 1 = 6\).