Créer des matrices et les aligner
dans LaTeX
Bonjour,
je vois sur ce forum qu'il est souvent question de Latex pour mettre en forme des formules scientifiques et ca semble être assez puissant.
J'aimerais savoir si en utilisant Latex il est possible d' aligner des matrices.
Je m'explique : lorsque l'on fait un produit matriciel, on le représe souvent avec une martrice en bas à gauche, une autre en haut à droit et la matrice résultat en bas à droite.
C'est exactement cela que j'aimerais savoir produire, si c'est faisable.
Merci pour votre aide précieuse,
Morgan
je vois sur ce forum qu'il est souvent question de Latex pour mettre en forme des formules scientifiques et ca semble être assez puissant.
J'aimerais savoir si en utilisant Latex il est possible d' aligner des matrices.
Je m'explique : lorsque l'on fait un produit matriciel, on le représe souvent avec une martrice en bas à gauche, une autre en haut à droit et la matrice résultat en bas à droite.
C'est exactement cela que j'aimerais savoir produire, si c'est faisable.
Merci pour votre aide précieuse,
Morgan
Connectez-vous ou Inscrivez-vous pour répondre.
Réponses
Comme ça ?
<BR>$$ \begin{array}{cc}
<BR> &
<BR> \left( \begin{array}{ccc}
<BR> a & b & c \\
<BR> d & f & g \\
<BR> h & i & j
<BR> \end{array} \right)
<BR> \\
<BR> \left( \begin{array}{ccc}
<BR> 1 & 2 & 3 \\
<BR> 4 & 5 & 6
<BR> \end{array} \right)
<BR> &
<BR> \left( \begin{array}{ccc}
<BR> a+2d+3g & b+2e+3h & c+2f+3i \\
<BR> 4a+5d+6d & 4b+5e+6h & 4c+5f+6i
<BR> \end{array} \right)
<BR>\end{array} $$
Merci
Par ailleurs, je n'ai jamais vu l'intérêt de cette présentation bizarroïde, que j'ai déjà rencontré dans de vieux bouquins.
Il faut bien sûr remplacer f,g,h,i,j respectivement par e,f,g,h,i.
e=mc3, le package easybmat est fait pour ça
Pour RAJ : cette écriture a l'immense avantage de faciliter les calculs à la main...en tout cas je l'utilise systématiquement (évidemment, avec cet exemple erronné, la méthode est délicate à défendre :-)).
$$ \begin{array}{cc}
&
\begin{pmatrix}
a & b & c \\
d & e & f \\
g & h & i
\end{pmatrix}
\\
\begin{pmatrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{pmatrix}
&
\begin{pmatrix}
a+2d+3g & b+2e+3h & c+2f+3i \\
4a+5d+6g & 4b+5e+6h & 4c+5f+6i
\end{pmatrix}
\end{array} $$
C'est plus simple que des array car on n'a pas besoin de préciser manuellement le nombre de colonnes.
$$ \begin{array}{cc}
&
\begin{pmatrix}
a & b & c \\
d & e & f \\
g & h & i
\end{pmatrix}
\\
\\
\begin{pmatrix}
1 & 2 & 3 \\
4 & 5 & 6
\end{pmatrix}
&
\begin{pmatrix}
a+2d+3g & b+2e+3h & c+2f+3i \\
4a+5d+6g & 4b+5e+6h & 4c+5f+6i
\end{pmatrix}
\end{array} $$
C'est plus simple que des array car on n'a pas besoin de préciser manuellement le nombre de colonnes.
merci je testerai ca dès le debut du week end
Excellente, celle-là !!
<BR>
<BR>Première option, bourrin ...
<P></P><DIV ALIGN="CENTER" CLASS="mathdisplay"><TABLE CELLPADDING="0" WIDTH="100%" ALIGN="CENTER"><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="3" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img1.png" ALT="$\displaystyle \newline$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="58" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img2.png" ALT="$\displaystyle \begin{pmatrix}
\newline 1 & 2 \\
\newline 3 & 4
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="61" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img3.png" ALT="$\displaystyle \newline \begin{pmatrix}
\newline 5 & 6 \\
\newline 7 & 8
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="77" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img4.png" ALT="$\displaystyle \begin{pmatrix}
\newline 21 & 34 \\
\newline 31 & 46
\newline \end{pmatrix}
\newline$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR></TABLE></DIV><P></P>
\begin{align*}
<BR> & \begin{pmatrix}
<BR> 1 & 2 \\
<BR> 3 & 4
<BR> \end{pmatrix}
<BR> \\
<BR> \begin{pmatrix}
<BR> 5 & 6 \\
<BR> 7 & 8
<BR> \end{pmatrix}
<BR> &
<BR> \begin{pmatrix}
<BR> 21 & 34 \\
<BR> 31 & 46
<BR> \end{pmatrix}
<BR>\end{align*}
<BR>
<BR>Pour aligner sur cet exemple, on peut feinter avec des blancs :
<P></P><DIV ALIGN="CENTER" CLASS="mathdisplay"><TABLE CELLPADDING="0" WIDTH="100%" ALIGN="CENTER"><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="3" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img1.png" ALT="$\displaystyle \newline$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="67" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img5.png" ALT="$\displaystyle \;\begin{pmatrix}
\newline 1 & \;2 \\
\newline 3 & \;4
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="61" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img3.png" ALT="$\displaystyle \newline \begin{pmatrix}
\newline 5 & 6 \\
\newline 7 & 8
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="77" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img4.png" ALT="$\displaystyle \begin{pmatrix}
\newline 21 & 34 \\
\newline 31 & 46
\newline \end{pmatrix}
\newline$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR></TABLE></DIV><P></P>
\begin{align*}
<BR> &\;\begin{pmatrix}
<BR> 1 & \;2 \\
<BR> 3 & \;4
<BR> \end{pmatrix}
<BR> \\
<BR> \begin{pmatrix}
<BR> 5 & 6 \\
<BR> 7 & 8
<BR> \end{pmatrix}&\begin{pmatrix}
<BR> 21 & 34 \\
<BR> 31 & 46
<BR> \end{pmatrix}
<BR>\end{align*}
<BR>
<BR>
<BR>En regardant la doc du package, on arrive à un truc un peu mieux pour l'alignement :
<P></P><DIV ALIGN="CENTER" CLASS="mathdisplay"><TABLE CLASS="equation*" CELLPADDING="0" WIDTH="100%" ALIGN="CENTER"><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="CENTER"><SPAN CLASS="MATH"><IMG WIDTH="143" HEIGHT="144" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img6.png" ALT="$\displaystyle \newline \begin{pmatrix}
\newline 5 & 6 \\
\newline 7 & 8
\newl......4 \\
\newline 31 & 46
\newline \end{pmatrix}
\newline \end{gathered}
\newline$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR></TABLE></DIV><P></P>
\begin{equation*}
<BR> \begin{pmatrix}
<BR> 5 & 6 \\
<BR> 7 & 8
<BR> \end{pmatrix}
<BR> \begin{gathered}
<BR> \begin{pmatrix}
<BR> 1 & 2 \\
<BR> 3 & 4
<BR> \end{pmatrix}\\
<BR> \begin{pmatrix}
<BR> 21 & 34 \\
<BR> 31 & 46
<BR> \end{pmatrix}
<BR> \end{gathered}
<BR>\end{equation*}
<BR>
<BR>Le paramètre b [sans le ' ' qui le précède. AD] de l'environnement gathered permet d'aligner sur la ligne de base.
<BR>
<BR>On peut bien sur encore feinter avec des blancs à l'intérieur de la matrice supérieure.
<BR>
<BR>Si maintenant on considère l'exemple des messages précédents, ça devient un peu sale. Si je devais aligner les colonnes dans ce cas, j'utiliserai le package xypic (désolé pas le temps ce soir, concert d'Al Di Meola).<BR>
<BR>
<BR>Première option, bourrin ...
<BR>
<BR><P></P><DIV ALIGN="CENTER" CLASS="mathdisplay"><TABLE CELLPADDING="0" WIDTH="100%" ALIGN="CENTER"><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="3" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img1.png" ALT="$\displaystyle \newline$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="58" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img2.png" ALT="$\displaystyle \begin{pmatrix}
\newline 1 & 2 \\
\newline 3 & 4
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="61" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img3.png" ALT="$\displaystyle \newline \begin{pmatrix}
\newline 5 & 6 \\
\newline 7 & 8
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="77" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img4.png" ALT="$\displaystyle \begin{pmatrix}
\newline 21 & 34 \\
\newline 31 & 46
\newline \end{pmatrix}
\newline$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR></TABLE></DIV><BR CLEAR="ALL"><P></P>
<BR>
<BR>Pour aligner sur cet exemple, on peut feinter avec des blancs :
<BR>
<BR><P></P><DIV ALIGN="CENTER" CLASS="mathdisplay"><TABLE CELLPADDING="0" WIDTH="100%" ALIGN="CENTER"><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="3" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img1.png" ALT="$\displaystyle \newline$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="67" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img5.png" ALT="$\displaystyle \;\begin{pmatrix}
\newline 1 & \;2 \\
\newline 3 & \;4
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="RIGHT"><SPAN CLASS="MATH"><IMG WIDTH="61" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img3.png" ALT="$\displaystyle \newline \begin{pmatrix}
\newline 5 & 6 \\
\newline 7 & 8
\newline \end{pmatrix}$"></SPAN></TD><TD NOWRAP ALIGN="LEFT"><SPAN CLASS="MATH"><IMG WIDTH="77" HEIGHT="54" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img4.png" ALT="$\displaystyle \begin{pmatrix}
\newline 21 & 34 \\
\newline 31 & 46
\newline \end{pmatrix}
\newline$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR></TABLE></DIV><BR CLEAR="ALL"><P></P>
<BR>
<BR>
<BR>En regardant la doc du package, on arrive à un truc un peu mieux pour l'alignement :
<BR>
<BR><P></P><DIV ALIGN="CENTER" CLASS="mathdisplay"><TABLE CLASS="equation*" CELLPADDING="0" WIDTH="100%" ALIGN="CENTER"><TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="CENTER"><SPAN CLASS="MATH"><IMG WIDTH="143" HEIGHT="144" ALIGN="MIDDLE" BORDER="0" SRC="http://www.les-mathematiques.net/phorum/2006/11/10/101127/cv/img6.png" ALT="$\displaystyle \newline \begin{pmatrix}
\newline 5 & 6 \\
\newline 7 & 8
\newl......4 \\
\newline 31 & 46
\newline \end{pmatrix}
\newline \end{gathered}
\newline$"></SPAN></TD><TD NOWRAP CLASS="eqno" WIDTH="10" ALIGN="RIGHT"> </TD></TR></TABLE></DIV><BR CLEAR="ALL"><P></P>
<BR>
<BR>Le paramètre b [sans le ' ' qui le précède. AD] de l'environnement gathered permet d'aligner sur la ligne de base.
<BR>
<BR>On peut bien sur encore feinter avec des blancs à l'intérieur de la matrice supérieure.
<BR>
<BR>Si maintenant on considère l'exemple des messages précédents, ça devient un peu sale. Si je devais aligner les colonnes dans ce cas, j'utiliserai le package xypic (désolé pas le temps ce soir, concert d'Al Di Meola).<BR>