| Hosted by CoCalc | Download
typeset_mode(True)

Exemple.

On considère la matrice M=(8225)M = \left(\begin{array}{rr} 8 & -2 \\ -2 & 5 \end{array}\right). Elle représente une transformation linéaire ff dans la base canonique, à savoir f(e1)=(82) f(\mathbf{e}_1) = \left(\begin{array}{r}8\\-2\end{array}\right) et f(e2)=(22)f(\mathbf{e}_2) = \left(\begin{array}{r}-2\\2\end{array}\right). On veut calculer la matrice de ff dans la base B\mathcal{B}' formée par les vecteurs [ \mathbf{v}_1 = \frac{1}{\sqrt{5}} = \left(21\begin{array}{r}2\\1\end{array}\right), \mathbf{v}_2 = f(\mathbf{e}_1) = \frac{1}{\sqrt{5}}\left(21\begin{array}{r}-2\\1\end{array}\right)]

M=matrix([[8,-2],[-2,5]]) M N=60
(8225)\displaystyle \left(\begin{array}{rr} 8 & -2 \\ -2 & 5 \end{array}\right)

La matrice P=PBBP = P_{\mathcal{B}' \to \mathcal{B}} de passage de B\mathcal{B}' vers B\mathcal{B} est donnée par les vecteurs colonnes des coordonnées des vi\mathbf{v}_i dans B\mathcal{B}, il s'agit des vecteurs vi\mathbf{v}_i eux-mêmes. La matrice PBBP_{\mathcal{B} \to \mathcal{B'}} dans l'autre sens, est l'inverse.

P=1/sqrt(5)*matrix([[1,-2],[2,1]]) P
(155255255155)\displaystyle \left(\begin{array}{rr} \frac{1}{5} \, \sqrt{5} & -\frac{2}{5} \, \sqrt{5} \\ \frac{2}{5} \, \sqrt{5} & \frac{1}{5} \, \sqrt{5} \end{array}\right)
M1 = P.inverse()*M*P M1
(4009)\displaystyle \left(\begin{array}{rr} 4 & 0 \\ 0 & 9 \end{array}\right)

Dans la figure ci-bas on présente des vecteurs u\mathbf{u} en bleu, et, juxtaposés, les vecteurs MuM\mathbf{u}, en rouge et en plus normalisés. Notez qu'il y a certains vecteurs pour lesquels u\mathbf{u} et MuM\mathbf{u} semblent colinéaires.

ListeVects = [ vector([cos(2*pi*j/N), sin(2*pi*j/N)]) for j in range(N)] LignesOrig = [line([(0,0), u]) for u in ListeVects] LignesNouv = [line([u,u+ (M*u)/((M*u).norm())], color = "red") for u in ListeVects ] LEigen = [ line([(0,0), 1/sqrt(5)*vector([1,2])], color="green", thickness=3), line([(0,0), 1/sqrt(5)*vector([-2,1])], color="green", thickness=3)] show(sum(LignesOrig)+ sum(LignesNouv), aspect_ratio=1, figsize=9)

Il peut être utile de voir la figure, sans la normalisation.

LignesNouvNon = [line([u,u+ (M*u)], color = "red") for u in ListeVects ] show(sum(LignesOrig)+ sum(LignesNouvNon), aspect_ratio=1, figsize=10)