summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/resolsysteme
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/resolsysteme')
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdfbin132738 -> 154471 bytes
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex264
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdfbin98310 -> 108019 bytes
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex45
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdfbin138727 -> 144719 bytes
-rw-r--r--macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex28
-rw-r--r--macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty958
7 files changed, 1198 insertions, 97 deletions
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf
index 9e5d8c6476..92d5440f79 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex
index 28b9e5b397..1f7bc60547 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-doc.tex
@@ -2,9 +2,9 @@
% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode}
% arara: lualatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
-\documentclass[a4paper,11pt]{article}
-\def\TPversion{0.1.2}
-\def\TPdate{8 Février 2023}
+\documentclass[french,a4paper,11pt]{article}
+\def\TPversion{0.1.3}
+\def\TPdate{10 Février 2023}
\usepackage[executable=python.exe]{pyluatex}
\usepackage[table,svgnames]{xcolor}
\usepackage{amsmath,amssymb}
@@ -55,6 +55,7 @@
\usepackage[french]{babel}
\usepackage[most]{tcolorbox}
+\usetikzlibrary{calc}
\tcbuselibrary{minted}
\NewTCBListing{PresentationCode}{ O{blue} m }{%
sharp corners=downhill,enhanced,arc=12pt,skin=bicolor,%
@@ -85,7 +86,23 @@
#2
}
+\tcbset{vignettes/.style={%
+ nobeforeafter,box align=base,boxsep=0pt,enhanced,sharp corners=all,rounded corners=southeast,%
+ boxrule=0.75pt,left=7pt,right=1pt,top=0pt,bottom=0.25pt,%
+ }
+}
+
+\tcbset{vignetteMaJ/.style={%
+ fontupper={\vphantom{pf}\footnotesize\ttfamily},
+ vignettes,colframe=ForestGreen!50!black,coltitle=white,colback=ForestGreen!25,%
+ overlay={\begin{tcbclipinterior}%
+ \fill[fill=ForestGreen!75]($(interior.south west)$) rectangle node[rotate=90]{\tiny \sffamily{\textcolor{Black}{\scalebox{0.85}[0.75]{\textbf{MàJ}}}}} ($(interior.north west)+(5pt,0pt)$);%
+ \end{tcbclipinterior}}
+ }
+}
+
\newcommand\Cle[1]{{\bfseries\sffamily\textlangle #1\textrangle}}
+\newcommand\cmaj[1]{\tcbox[vignetteMaJ]{#1}\xspace}
\begin{document}
@@ -106,9 +123,9 @@
\begin{tabular}{c}
{\Huge \texttt{ResolSysteme [fr]}}\\
\\
- {\LARGE Des outils pour des} \\
+ {\LARGE Des outils pour des matrices, } \\
\\
- {\LARGE systèmes linéaires,} \\
+ {\LARGE des systèmes linéaires,} \\
\\
{\LARGE avec xint ou pyluatex.} \\
\end{tabular}
@@ -121,8 +138,6 @@
\end{minipage}
\end{center}
-\vspace{0.5cm}
-
\begin{center}
\begin{tabular}{c}
\texttt{Cédric Pierquet}\\
@@ -137,36 +152,44 @@
\smallskip
-{$\blacktriangleright$~~Des commandes pour calculer le déterminant et l'inverse de matrices carrées (2x2, 3x3 ou 4x4).}
+{$\blacktriangleright$~~Quelques commandes pour effectuer des calculs matriciels (produit, carré, puissance).}
\smallskip
-{$\blacktriangleright$~~Des commandes pour résoudre des systèmes linéaires (2x2, 3x3 ou 4x4).}
+{$\blacktriangleright$~~Des commandes pour calculer le déterminant et l'inverse de matrices carrées (2x2, 3x3 ou 4x4).}
\smallskip
+{$\blacktriangleright$~~Des commandes pour résoudre des systèmes linéaires (2x2, 3x3 ou 4x4).}
+
\vspace{1cm}
\begin{center}
\begin{tcolorbox}[enhanced,colframe=ForestGreen,colback=lightgray!5,center,width=0.95\linewidth,drop fuzzy shadow=lightgray]
+ \verb|$M=\AffMatrice(1,2 § 3,4)$, et $M^3=\MatricePuissancePY(1,2 § 3,4)(3)$.|
+
+ \medskip
+
+ La matrice $M=\AffMatrice(1,2 § 3,4)$ au cube vaut $M^3=\MatricePuissancePY(1,2 § 3,4)(3)$.
+
Le \textbf{déterminant} de $A=\begin{pNiceMatrix} -1&\frac12 \\ \frac12&4 \end{pNiceMatrix}$ est
$\det(A)=\DetMatrice[dec](-1,0.5 § 1/2,4)$.
\medskip
- L'\textbf{inverse} de la matrice $A=\begin{pNiceMatrix} 1&2&3&4\\5&6&7&0\\1&1&1&1\\-2&-3&-5&-6 \end{pNiceMatrix}$ est $A^{-1}=\MatriceInversePY*[n]<cell-space-limits=2pt>(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § -2,-3,-5,-6)$.
+ L'\textbf{inverse} de la matrice $A=\begin{pNiceMatrix} 1&2&3&4\\5&6&7&0\\1&1&1&1\\-2&-3&-5&-6 \end{pNiceMatrix}$ est $A^{-1}=\MatriceInversePY[n]<cell-space-limits=2pt>(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § -2,-3,-5,-6)$.
\medskip
- La \textbf{solution} de $\systeme[xyzt]{y+z+t=1,x+z+t=-1,x+y+t=1,x+y+z=0}$ est $\mathcal{S}=\left\lbrace\SolutionSystemePY*[d](0,1,1,1 § 1,0,1,1 § 1,1,0,1 § 1,1,1,0)(1,-1,1,0)\right\rbrace$.
+ La \textbf{solution} de $\systeme[xyzt]{y+z+t=1,x+z+t=-1,x+y+t=1,x+y+z=0}$ est $\mathcal{S}=\left\lbrace\SolutionSystemePY[d](0,1,1,1 § 1,0,1,1 § 1,1,0,1 § 1,1,1,0)(1,-1,1,0)\right\rbrace$.
\end{tcolorbox}
\end{center}
\vspace{0.5cm}
-%\hfill{}\textit{Merci aux membres du groupe \faFacebook{} du \og Coin \LaTeX{} \fg{} pour leur aide et leurs idées !}
+\hfill{}\textit{Merci à Denis Bitouzé et à Gilles Le Bourhis pour leurs retours et idées !}
-\hfill{}\textit{Merci à Denis Bitouzé pour leurs retours et idées !}
+\smallskip
\vfill
@@ -198,9 +221,10 @@
\subsection{Introduction}
\begin{noteblock}
-L'idée est de \textit{proposer} des outils pour travailler sur des systèmes linéaires (de taille réduite !) :
+La package \textit{propose} des outils pour travailler sur des matrices ou des systèmes linéaires (de taille réduite !) :
\begin{itemize}
+ \item en calculant des produits matriciels \textit{simples} (dimensions réduites) ;
\item en affichant la \textbf{solution} (si elle existe) ;
\item en affichant le \textbf{déterminant} et l'éventuelle \textbf{inverse} de la matrice des coefficients.
\end{itemize}
@@ -215,7 +239,7 @@ L'idée est de \textit{proposer} des outils pour travailler sur des systèmes li
\item via \textsf{python} et le package \textsf{pyluatex} (à charger manuellement du fait des options spécifiques) pour des formats \textbf{2x2}, \textbf{3x3} ou \textbf{4x4}.
\end{itemize}
-Il n'est pas prévu -- pour le moment -- de travailler sur des matrices/systèmes plus grands.
+Il n'est pas prévu -- pour le moment -- de travailler sur des matrices/systèmes plus grands, car l'idée est de pouvoir formater le résultat, ce qui se fait coefficient par coefficient.
\end{importantblock}
\begin{warningblock}
@@ -232,9 +256,8 @@ La méthode par \textsf{python} utilise quoi qu'il en soit le module \texttt{sym
Le package charge les packages suivantes :
\begin{itemize}
- \item \texttt{xintexpr} et \texttt{xinttools} ;
+ \item \texttt{xintexpr}, \texttt{xinttools}, \texttt{xstring} et \texttt{listofitems} ;
\item \texttt{sinuitx}, \texttt{nicefrac} et \texttt{nicematrix} ;
- \item \texttt{xstring} et \texttt{listofitems}.
\end{itemize}
Il est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} (obligatoire pour \textsf{pyluatex} !!) ou \textsf{xelatex}.
@@ -248,6 +271,20 @@ Les nombres sont formatés par la commande \texttt{\textbackslash num} de \texts
L'affichage des matrices est gérée par le package \textsf{nicematrix}, et des options spécifiques \textit{simples} pourront être placées dans les différentes commandes.
\end{importantblock}
+\subsection{Fichiers d'exemples}
+
+\begin{noteblock}
+En marge de la présente documentation, compilée en \textsf{lualatex} avec \textsf{shell-escape}, deux fichiers avec des exemples d'utilisation sont proposés :
+
+\begin{itemize}
+ \item \texttt{ResolSysteme-exemples} pour les commandes disponibles en version classique (\textsf{xint}) ;
+ \item \texttt{ResolSysteme-exemples-pyluatex} pour les commandes disponibles en version python (\textsf{pyluatex}).
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{noteblock}
+
+\pagebreak
+
\subsection{Chargement du package, et option}
\begin{importantblock}
@@ -265,6 +302,16 @@ Le package peut donc se charger de deux manières différentes, suivant si l'uti
\usepackage[pyluatex]{ResolSysteme}
\end{PresentationCode}
+\part{Historique}
+
+\verb|v0.1.3|~:~~~~Ajout de commandes pour du calcul matriciel (de taille raisonnable) + inversion comportement des commandes étoilées.
+
+\verb|v0.1.2|~:~~~~Ajout d'une commande d'affichage (formaté) d'une matrice 2x2, 3x3 ou 4x4.
+
+\verb|v0.1.1|~:~~~~Correction d'un bug avec le caractère \og ; \fg.
+
+\verb|v0.1.0|~:~~~~Version initiale.
+
\pagebreak
\part{Commandes}
@@ -287,7 +334,7 @@ En \textit{interne}, le code utilise une commande pour formater un résultat sou
Concernant cette commande, qui est dans un bloc \texttt{ensuremath} :
\begin{itemize}
- \item la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} avant l'éventuelle fraction ;
+ \item \cmaj{0.1.3} la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} sur le numérateur ;
\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
\begin{itemize}
\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
@@ -302,23 +349,18 @@ Concernant cette commande, qui est dans un bloc \texttt{ensuremath} :
\end{tipblock}
\begin{PresentationCode}{listing only}
-\ConvVersFrac{-10+1/3*(-5/16)} %sortie par défaut (fraction avec - sur numérateur)
-
-\ConvVersFrac*{-10+1/3*(-5/16)} %sortie avec - avant la fraction
-
-\ConvVersFrac*[d]{-10+1/3*(-5/16)} %sortie en displaystyle
-
+\ConvVersFrac{-10+1/3*(-5/16)} %sortie par défaut
+\ConvVersFrac*{-10+1/3*(-5/16)} %sortie fraction avec - sur numérateur
+\ConvVersFrac[d]{-10+1/3*(-5/16)} %sortie en displaystyle
\ConvVersFrac[n]{-10+1/3*(-5/16)} %sortie en nicefrac
-
\ConvVersFrac[dec=4]{-10+1/3*(-5/16)} %sortie en décimal arrondi à 0,0001
-
\ConvVersFrac{2+91/7} %entier correctement formaté
\end{PresentationCode}
\begin{PresentationCode}{text only}
\hfill\ConvVersFrac{-10+1/3*(-5/16)} \qquad
\ConvVersFrac*{-10+1/3*(-5/16)} \qquad
-\ConvVersFrac*[d]{-10+1/3*(-5/16)} \qquad
+\ConvVersFrac[d]{-10+1/3*(-5/16)} \qquad
\ConvVersFrac[n]{-10+1/3*(-5/16)} \qquad
\ConvVersFrac[dec=4]{-10+1/3*(-5/16)} \qquad
\ConvVersFrac{2+91/7}\hfill~
@@ -345,7 +387,7 @@ Les \textit{transformations} en fraction devraient pouvoir fonctionner avec des
\subsection{La commande}
\begin{cautionblock}
-La première commande (matricielle) est dédiée à l'affichage d'une matrice \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} :
+La première commande (matricielle) est dédiée à l'affichage d'une matrice \textbf{2x2} ou \textbf{3x3} ou \textbf{4x4} (\texttt{python} est ici non nécessaire):
\begin{itemize}
\item en saisissant les coefficients via une syntaxe propre au package (l'affichage est géré en interne par \textsf{nicematrix}) ;
@@ -356,7 +398,7 @@ La première commande (matricielle) est dédiée à l'affichage d'une matrice \t
\begin{PresentationCode}{listing only}
%commande disponible avec les deux versions, pyluatex ou non
-\AffMatrice(*)[option de formatage](matrice)
+\AffMatrice(*)[option de formatage]<(matrice)
\end{PresentationCode}
\subsection{Utilisation}
@@ -365,7 +407,7 @@ La première commande (matricielle) est dédiée à l'affichage d'une matrice \t
Concernant cette commande, qui est à insérer dans un environnement \textit{math} :
\begin{itemize}
- \item la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} avant l'éventuelle fraction ;
+ \item \cmaj{0.1.3} la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} sur le numérateur ;
\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
\begin{itemize}
\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
@@ -388,7 +430,97 @@ et $C=\AffMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
\begin{PresentationCode}{}
On considère la matrice
-$M=\AffMatrice*[d]<cell-space-limits=2pt>(1+1/4,0,3+4/5 § 0,1,-5/3 § 1/2,0.45,6/7)$.
+$M=\AffMatrice[d]<cell-space-limits=2pt>(1+1/4,0,3+4/5 § 0,1,-5/3 § 1/2,0.45,6/7)$.
+\end{PresentationCode}
+
+\pagebreak
+
+\section{Calculs matriciels \og simples \fg}
+
+\subsection{Introduction}
+
+\begin{cautionblock}
+L'idée est de proposer des commandes pour effectuer des calculs matriciels \textit{simples} sur des matrices :
+
+\begin{itemize}
+ \item des produits matriciels :
+ \begin{itemize}[label=$\bullet$]
+ \item $(1\times2)\times(2\times1)$ ;
+ \item $(1\times2)\times(2\times2)$ ;
+ \item $(2\times2)\times(2\times2)$ ;
+ \item $(2\times2)\times(2\times1)$ ;
+ \item $(1\times3)\times(3\times1)$ ;
+ \item $(1\times3)\times(3\times3)$ ;
+ \item $(3\times3)\times(3\times3)$ ;
+ \item $(3\times3)\times(3\times1)$ ;
+ \end{itemize}
+ \item le carré d'une matrice 2x2 ou 3x3 ;
+ \item la puissance d'une matrice 2x2 ou 3x3 ou 4x4 (via \textsf{python}).
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{cautionblock}
+
+\begin{PresentationCode}{listing only}
+%commandes disponible avec les deux versions, pyluatex ou non
+\ProduitMatrices(*)[option de formatage]<options nicematrix>(matrice 1)(matrice 2)[Clé]
+\CarreMatrice(*)[option de formatage]<options nicematrix>(matrice)(-5,6 § 1,4)[Clé]
+
+%commande disponible avec l'option pyluatex
+\MatricePuissancePY(*)[option de formatage]<options nicematrix>(matrice)(puissance)[Clé]
+\end{PresentationCode}
+
+\begin{warningblock}
+Dans le cas où le produit matriciel n'existe pas, ou ne rentre pas dans le cadre des cas possibles, rien ne sera affiché !
+\end{warningblock}
+
+\subsection{Utilisation}
+
+\begin{tipblock}
+Concernant ces commandes, qui sont à insérer dans un environnement \textit{math} :
+
+\begin{itemize}
+ \item \cmaj{0.1.3} la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} sur le numérateur ;
+ \item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
+ \begin{itemize}
+ \item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
+ \item \Cle{d} pour l'affichage de la fraction en mode \textsf{dfrac} ;
+ \item \Cle{n} pour l'affichage de la fraction en mode \textsf{nicefrac} ;
+ \item \Cle{dec} pour l'affichage du résultat en mode \texttt{décimal} (sans arrondi !) ;
+ \item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
+ \end{itemize}
+ \item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
+ \item les arguments suivants, \textit{obligatoires} et entre \textsf{(...)}, sont quant à eux, les matrices données par leurs coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}) ou la matrice et la puissance ;
+ \item le dernier argument, \textit{optionnel} et entre \textsf{[...]} propose l'unique \frquote{clé} \Cle{Aff} pour afficher le calcul avant le résultat.
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{tipblock}
+
+\begin{PresentationCode}{}
+$\ProduitMatrices(-5,6 § 1,4)(2 § 7)[Aff]$ et $\ProduitMatrices(-5,6 § 1,4)(2 § 7)$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+$\ProduitMatrices[dec](0.5,0.3,0.2)(0.75,0.1,0.15 § 0.4,0.4,0.2 § 0.6,0.1,0.3)[Aff]$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+$\CarreMatrice(-5,6 § 1,4)[Aff]$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+$\CarreMatrice(-5,6,8 § 1,4,-9 § 1,-1,1)[Aff]$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+$\MatricePuissancePY(1,1 § 5,-2)(7)[Aff]$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+$\MatricePuissancePY(1,1,-1 § 5,-2,1 § 0,5,2)(3)[Aff]$
+\end{PresentationCode}
+
+\begin{PresentationCode}{}
+$\MatricePuissancePY(1,1,1,1 § 5,-2,1,5 § 0,5,2,-1 § 0,1,1,1)(5)[Aff]$
\end{PresentationCode}
\pagebreak
@@ -421,7 +553,7 @@ La deuxième commande (matricielle) disponible est pour calculer le déterminant
Concernant cette commande, qui est à insérer dans un environnement \textit{math} :
\begin{itemize}
- \item la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} avant l'éventuelle fraction ;
+ \item \cmaj{0.1.3} la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} sur le numérateur ;
\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
\begin{itemize}
\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
@@ -449,8 +581,8 @@ $\det(A)=\DetMatrice[dec](-1,0.5 § 1/2,4)$.
\begin{PresentationCode}{}
%version classique
-Le dét. de $A=\AffMatrice*[t](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$ est
-$\det(A) \approx \DetMatrice[dec=3](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$.
+Le dét. de $A=\AffMatrice[t](-1,1/3,4 § -1/3,4,-1 § -1,0,0)$ est
+$\det(A) \approx \DetMatrice[dec=3](-1,1/3,4 § -1/3,4,-1 § -1,0,0)$.
\end{PresentationCode}
\begin{PresentationCode}{}
@@ -461,7 +593,7 @@ $\det(A)=\DetMatricePY(1,2 § 3,4)$.
\begin{PresentationCode}{}
Le dét. de $A=\AffMatrice[dec](-1,0.5 § 1/2,4)$ est
-$\det(A)=\DetMatricePY*[d](-1,0.5 § 1/2,4)$.\end{PresentationCode}
+$\det(A)=\DetMatricePY[d](-1,0.5 § 1/2,4)$.\end{PresentationCode}
\begin{PresentationCode}{}
%version python
@@ -469,6 +601,8 @@ Le dét. de $A=\AffMatrice(-1,1/3,4 § 1/3,4,-1 § -1,0,0)$ est
$\det(A) \approx \DetMatricePY[dec=3](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$.
\end{PresentationCode}
+\pagebreak
+
\section{Inverse d'une matrice}
\subsection{Introduction}
@@ -485,10 +619,10 @@ La troisième commande (matricielle) disponible est pour calculer l'éventuelle
\begin{PresentationCode}{listing only}
%version classique
-\MatriceInverse(*)[option de formatage]<options nicematrix>(matrice)
+\MatriceInverse(*)[option de formatage]<options nicematrix>(matrice)[Clé]
%version python
-\MatriceInversePY(*)[option de formatage]<options nicematrix>(matrice)
+\MatriceInversePY(*)[option de formatage]<options nicematrix>(matrice)[Clé]
\end{PresentationCode}
\subsection{Utilisation}
@@ -497,7 +631,7 @@ La troisième commande (matricielle) disponible est pour calculer l'éventuelle
Concernant cette commande, qui est à insérer dans un environnement \textit{math} :
\begin{itemize}
- \item la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} avant l'éventuelle fraction ;
+ \item \cmaj{0.1.3} la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} sur le numérateur ;
\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
\begin{itemize}
\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
@@ -507,7 +641,8 @@ Concernant cette commande, qui est à insérer dans un environnement \textit{mat
\item \Cle{dec=k} pour l'affichage du résultat en mode \texttt{décimal} arrondi à $10^{-k}$ ;
\end{itemize}
\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
- \item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}).
+ \item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}) ;
+ \item le dernier argument, \textit{optionnel} et entre \textsf{[...]} propose l'unique \frquote{clé} \Cle{Aff} pour afficher le calcul avant le résultat.
\end{itemize}
À noter que si la matrice n'est pas inversible, le texte \texttt{Matrice non inversible} est affiché.
\end{tipblock}
@@ -521,22 +656,24 @@ $A^{-1}=\MatriceInverse<cell-space-limits=2pt>(1,2 § 3,4)$.
\begin{PresentationCode}{}
%version classique
L'inverse de $A=\AffMatrice(1,2,3 § 4,5,6 § 7,8,8)$ est
-$A^{-1}=\MatriceInverse[n]<cell-space-limits=2pt>(1,2,3 § 4,5,6 § 7,8,8)$.
+$A^{-1}=\MatriceInverse[n]<cell-space-limits=2pt>(1,2,3 § 4,5,6 § 7,8,8)[Aff]$.
\end{PresentationCode}
\begin{PresentationCode}{}
%version python
L'inverse de $A=\AffMatrice(1,2 § 3,4)$ est
-$A^{-1}=\MatriceInversePY*[d]<cell-space-limits=2pt>(1,2 § 3,4)$.
+$A^{-1}=\MatriceInversePY[d]<cell-space-limits=2pt>(1,2 § 3,4)[Aff]$.
\end{PresentationCode}
\begin{PresentationCode}{}
%version python
L'inv. de $A=\AffMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § -2,-3,-5,-6)$ est
$A^{-1}=
-\MatriceInversePY*[n]<cell-space-limits=2pt>(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § -2,-3,-5,-6)$.
+\MatriceInversePY[n]<cell-space-limits=2pt>(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § -2,-3,-5,-6)$.
\end{PresentationCode}
+\pagebreak
+
\section{Résolution d'un système linéaire}
\subsection{Introduction}
@@ -553,10 +690,10 @@ La deuxième commande (matricielle) disponible est pour déterminer l'éventuell
\begin{PresentationCode}{listing only}
%version classique
-\SolutionSysteme(*)[opt de formatage]<opts nicematrix>(matriceA)(matriceB)[opt Matrice]
+\SolutionSysteme(*)[opt de formatage]<opts nicematrix>(matriceA)(matriceB)[Clé]
%version python
-\SolutionSystemePY(*)[opt de formatage]<opts nicematrix>(matriceA)(matriceB)[opt Matrice]
+\SolutionSystemePY(*)[opt de formatage]<opts nicematrix>(matriceA)(matriceB)[Clé]
\end{PresentationCode}
\subsection{Utilisation}
@@ -565,7 +702,7 @@ La deuxième commande (matricielle) disponible est pour déterminer l'éventuell
Concernant cette commande, qui est à insérer dans un environnement \textit{math} :
\begin{itemize}
- \item la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} avant l'éventuelle fraction ;
+ \item \cmaj{0.1.3} la version \textit{étoilée} force l'écriture du signe \og $-$ \fg{} sur le numérateur ;
\item le premier argument, \textit{optionnel} et entre \textsf{[...]} permet de spécifier un formatage du résultat :
\begin{itemize}
\item \Cle{t} pour l'affichage de la fraction en mode \textsf{tfrac} ;
@@ -577,7 +714,7 @@ Concernant cette commande, qui est à insérer dans un environnement \textit{mat
\item le deuxième argument, \textit{optionnel} et entre \textsf{<...>} correspond aux \Cle{options} à passer à l'environnement \texttt{pNiceMatrix} ;
\item le troisième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice $A$ donnée par ses coefficients \textsf{a11,a12,... § a21,a22,...} (syntaxe héritée de \texttt{sympy}) ;
\item le quatrième argument, \textit{obligatoire} et entre \textsf{(...)}, est quant à lui, la matrice $B$ donnée par ses coefficients \textsf{b11,b21,...} (syntaxe héritée de \texttt{sympy}) ;
- \item le dernier argument, \textit{optionnel} et entre \textsf{[...]}, permet -- grâce à \Cle{Matrice} -- de présenter le vecteur solution.
+ \item le dernier argument, \textit{optionnel} et entre \textsf{[...]}, permet -- grâce à la \textit{clé} \Cle{Matrice} -- de présenter le vecteur solution.
\end{itemize}
À noter que si la matrice n'est pas inversible, le texte \texttt{Matrice non inversible} est affiché.
\end{tipblock}
@@ -585,7 +722,7 @@ Concernant cette commande, qui est à insérer dans un environnement \textit{mat
\begin{PresentationCode}{}
%version classique
La solution de $\systeme{3x+y-2z=-1,2x-y+z=4,x-y-2z=5}$ est $\mathcal{S}=%
-\left\lbrace \SolutionSysteme*[d](3,1,-2 § 2,-1,1 § 1,-1,-2)(-1,4,5) \right\rbrace$.\\
+\left\lbrace \SolutionSysteme[d](3,1,-2 § 2,-1,1 § 1,-1,-2)(-1,4,5) \right\rbrace$.\\
\end{PresentationCode}
\begin{PresentationCode}{}
@@ -602,7 +739,6 @@ est $\mathcal{S}=%
\SolutionSystemePY%
[dec]<cell-space-limits=2pt>%
(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § -2,-3,-5,-6)(-10,0,4,7)%
- [Matrice]
\right\rbrace$.
\end{PresentationCode}
@@ -623,12 +759,16 @@ Elles sont accessibles en \textit{natif} une fois l'option \textsf{lua} activée
\end{cautionblock}
\begin{PresentationCodePython}{listing only}
+#variables symboliques (pour du 4x4 maxi)
import sympy as sy
x = sy.Symbol('x')
y = sy.Symbol('y')
z = sy.Symbol('z')
t = sy.Symbol('t')
+\end{PresentationCodePython}
+\begin{PresentationCodePython}{listing only}
+#résolution de systèmes
def resol_systeme_QQ(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,u) :
solution=sy.solve([a*x+b*y+c*z+d*t-e,f*x+g*y+h*z+i*t-j,k*x+l*y+m*z+n*t-o,p*x+q*y+r*z+s*t-u],[x,y,z,t])
return solution
@@ -640,7 +780,10 @@ def resol_systeme_TT(a,b,c,d,e,f,g,h,i,j,k,l) :
def resol_systeme_DD(a,b,c,d,e,f) :
solution=sy.solve([a*x+b*y-c,d*x+e*y-f],[x,y])
return solution
+\end{PresentationCodePython}
+\begin{PresentationCodePython}{listing only}
+#déterminant d'une matrice
def det_matrice_QQ(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) :
MatTmp = sy.Matrix(([a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]))
DetMatTmp = MatTmp.det()
@@ -655,7 +798,10 @@ def det_matrice_DD(a,b,c,d) :
MatTmp = sy.Matrix(([a,b],[c,d]))
DetMatTmp = MatTmp.det()
return DetMatTmp
+\end{PresentationCodePython}
+\begin{PresentationCodePython}{listing only}
+#inverse d'une martrice
def inverse_matrice_QQ(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) :
MatTmp = sy.Matrix(([a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]))
DetMatTmp = MatTmp.inv()
@@ -672,14 +818,22 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
return InvMatTmp
\end{PresentationCodePython}
-\pagebreak
-
-\part{Historique}
-
-\verb|v0.1.2|~:~~~~Ajout d'une commande d'affichage (formaté) d'une matrice 2x2, 3x3 ou 4x4
+\begin{PresentationCodePython}{listing only}
+#puissance d'une matrice
+def puissance_matrice_QQ(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,puiss) :
+ MatTmp = sy.Matrix(([a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]))
+ PuissMatTmp = MatTmp**puiss
+ return PuissMatTmp
-\verb|v0.1.1|~:~~~~Correction d'un bug avec le caractère \og ; \fg{}
+def puissance_matrice_TT(a,b,c,d,e,f,g,h,i,puiss) :
+ MatTmp = sy.Matrix(([a,b,c],[d,e,f],[g,h,i]))
+ PuissMatTmp = MatTmp**puiss
+ return PuissMatTmp
-\verb|v0.1.0|~:~~~~Version initiale
+def puissance_matrice_DD(a,b,c,d,puiss) :
+ MatTmp = sy.Matrix(([a,b],[c,d]))
+ PuissMatTmp = MatTmp**puiss
+ return PuissMatTmp
+\end{PresentationCodePython}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf
index 2f1f0191c2..e9f019288e 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.pdf
Binary files differ
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex
index 7d891b08a5..c27148ec3a 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples-pyluatex.tex
@@ -1,14 +1,15 @@
+% !TeX document-id = {fc3853a9-0c9c-4d02-b763-6dc6c85d34db}
% !TeX TXS-program:compile = txs:///lualatex/[--shell-escape]
\documentclass[french,a4paper,10pt]{article}
-\def\RSver{0.1.2}
+\def\RSver{0.1.3}
\usepackage[margin=1.5cm]{geometry}
\usepackage[executable=python.exe]{pyluatex}
\usepackage[pyluatex]{ResolSysteme}
\usepackage{systeme}
+\usepackage{babel}
\usepackage[most]{tcolorbox}
\sisetup{locale=FR,output-decimal-marker={,}}
-\usepackage{babel}
\newtcblisting{ShowCodeTeX}[1][]{colback=white,colframe=red!75!black,listing options={style=tcblatex},#1}
\begin{document}
@@ -30,10 +31,34 @@
\begin{ShowCodeTeX}
On considère les matrices $A=\AffMatrice(1,2 § 3,4)$
-et $B=\AffMatrice*[n](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$
+et $B=\AffMatrice[n](-1,-1/3,4 § 1/3,4,-1 § -1,0,0)$
et $C=\AffMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
\end{ShowCodeTeX}
+\section{Calculs avec des matrices, 2x2 ou 3x3}
+
+\begin{ShowCodeTeX}
+$\ProduitMatrices(1,2)(3 § 4)[Aff]$ et $\ProduitMatrices(1,2)(3,4 § 5,6)[Aff]$ \\
+$\ProduitMatrices(-5,6 § 1,4)(2 § 7)[Aff]$ et $\ProduitMatrices(-5,6 § 1,4)(2,-4 § 7,0)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+$\ProduitMatrices(1,2,3)(4 § 5 § 6)[Aff]$ et $\ProduitMatrices(1,2,3)(1,1,1 § 2,1,5 § 0,5,-6)[Aff]$\\
+$\ProduitMatrices(1,1,1 § 2,1,5 § 0,5,-6)(1 § 2 § 3)[Aff]$ et
+$\ProduitMatrices(1,1,1 § 2,1,5 § 0,5,-6)(1,2,3 § -5,-4,2 § 3,3,10)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+$\CarreMatrice(-5,6 § 1,4)[Aff]$ \\
+$\CarreMatrice(-5,6,8 § 1,4,-9 § 1,-1,1)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+$\MatricePuissancePY(1,1 § 5,-2)(7)[Aff]$\\
+$\MatricePuissancePY(1,1,-1 § 5,-2,1 § 0,5,2)(3)[Aff]$ \\
+$\MatricePuissancePY(1,1,1,1 § 5,-2,1,5 § 0,5,2,-1 § 0,1,1,1)(5)[Aff]$
+\end{ShowCodeTeX}
+
\section{Inverse d'une matrice, 2x2 ou 3x3 ou 4x4}
\begin{ShowCodeTeX}
@@ -53,7 +78,7 @@ $A^{-1}=\MatriceInversePY<cell-space-limits=2pt>(1,2 § 3,6)$.
\begin{ShowCodeTeX}
L'inverse de $A=\begin{pNiceMatrix} 1&2 \\ 3&4 \end{pNiceMatrix}$ est
-$A^{-1}=\MatriceInversePY*[d]<cell-space-limits=2pt>(1,2 § 3,4)$.
+$A^{-1}=\MatriceInversePY[d]<cell-space-limits=2pt>(1,2 § 3,4)$.
\end{ShowCodeTeX}
\begin{ShowCodeTeX}
@@ -68,7 +93,7 @@ $A^{-1}=\MatriceInversePY*<cell-space-limits=2pt>(1,2,3 § 4,5,6 § 7,8,8)$.
\begin{ShowCodeTeX}
L'inverse de $A=\begin{pNiceMatrix} 1&2&3&4\\5&6&7&0\\1&1&1&1\\2&-3&-5&-6 \end{pNiceMatrix}$
-est $A^{-1}=\MatriceInversePY*[n]<cell-space-limits=2pt>(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
+est $A^{-1}=\MatriceInversePY[n]<cell-space-limits=2pt>(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
\end{ShowCodeTeX}
\section{Résolution d'un système, 2x2 ou 3x3 ou 4x4}
@@ -85,7 +110,7 @@ La solution de $\systeme{x+2y=-5,4x+8y=1}$ est $\mathcal{S}=%
\begin{ShowCodeTeX}
La solution de $\systeme{-9x-8y=-8,3x-6y=-7}$ est $\mathcal{S}=%
-\left\lbrace \SolutionSystemePY*[d](-9,-8 § 3,-6)(-8,-7) \right\rbrace$.
+\left\lbrace \SolutionSystemePY[d](-9,-8 § 3,-6)(-8,-7) \right\rbrace$.
\end{ShowCodeTeX}
\begin{ShowCodeTeX}
@@ -100,17 +125,15 @@ La solution de $\systeme{x+y+z=-1,3x+2y-z=-5,-x-y+2z=0}$ est donnée par $X=%
\begin{ShowCodeTeX}
La solution de $\systeme[xyzt]{y+z+t=1,x+z+t=-1,x+y+t=1,x+y+z=0}$ est $\mathcal{S}=%
-\left\lbrace\SolutionSystemePY*[d](0,1,1,1 § 1,0,1,1 § 1,1,0,1 § 1,1,1,0)(1,-1,1,0)\right\rbrace$.
+\left\lbrace\SolutionSystemePY[d](0,1,1,1 § 1,0,1,1 § 1,1,0,1 § 1,1,1,0)(1,-1,1,0)\right\rbrace$.
\end{ShowCodeTeX}
\begin{ShowCodeTeX}
-La solution de $\systeme[xyzt]{x+2y+3z+4t=-10,5x+6y+7z=0,x+y+z+t=4,-2x-3y-5z-6t=7}$ est $\mathcal{S}=
-\left\lbrace
+La solution de $\systeme[xyzt]{x+2y+3z+4t=-10,5x+6y+7z=0,x+y+z+t=4,-2x-3y-5z-6t=7}$ est $X=
\SolutionSystemePY
[dec]<cell-space-limits=2pt>
(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § -2,-3,-5,-6)(-10,0,4,7)
- [Matrice]
-\right\rbrace$.
+ [Matrice]$
\end{ShowCodeTeX}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf
index 7a2d7f4576..b331fac8ce 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.pdf
Binary files differ
diff --git a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex
index 2bf3f3b252..4ea7128787 100644
--- a/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex
+++ b/macros/latex/contrib/resolsysteme/doc/ResolSysteme-exemples.tex
@@ -2,7 +2,7 @@
% !TeX TXS-program:compile = txs:///pdflatex
\documentclass[french,a4paper,10pt]{article}
-\def\RSver{0.1.2}
+\def\RSver{0.1.3}
\usepackage[margin=1.5cm]{geometry}
\usepackage{ResolSysteme}
\usepackage{systeme}
@@ -29,10 +29,28 @@
\begin{ShowCodeTeX}
On considère les matrices $A=\AffMatrice(1,2 § 3,4)$
-et $B=\AffMatrice*[n](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$
+et $B=\AffMatrice[n](-1,1/3,4 § 1/3,4,-1 § -1,0,0)$
et $C=\AffMatrice(1,2,3,4 § 5,6,7,0 § 1,1,1,1 § 2,-3,-5,-6)$.
\end{ShowCodeTeX}
+\section{Calculs avec des matrices, 2x2 ou 3x3}
+
+\begin{ShowCodeTeX}
+$\ProduitMatrices(1,2)(3 § 4)[Aff]$ et $\ProduitMatrices(1,2)(3,4 § 5,6)[Aff]$ \\
+$\ProduitMatrices(-5,6 § 1,4)(2 § 7)[Aff]$ et $\ProduitMatrices(-5,6 § 1,4)(2,-4 § 7,0)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+$\ProduitMatrices(1,2,3)(4 § 5 § 6)[Aff]$ et $\ProduitMatrices(1,2,3)(1,1,1 § 2,1,5 § 0,5,-6)[Aff]$\\
+$\ProduitMatrices(1,1,1 § 2,1,5 § 0,5,-6)(1 § 2 § 3)[Aff]$ et
+$\ProduitMatrices(1,1,1 § 2,1,5 § 0,5,-6)(1,2,3 § -5,-4,2 § 3,3,10)[Aff]$
+\end{ShowCodeTeX}
+
+\begin{ShowCodeTeX}
+$\CarreMatrice(-5,6 § 1,4)[Aff]$ \\
+$\CarreMatrice(-5,6,8 § 1,4,-9 § 1,-1,1)[Aff]$
+\end{ShowCodeTeX}
+
\section{Déterminant d'une matrice, 2x2 ou 3x3}
\begin{ShowCodeTeX}
@@ -41,8 +59,8 @@ $\det(A)=\DetMatrice(1,2 § 3,4)$.
\end{ShowCodeTeX}
\begin{ShowCodeTeX}
-Le déterminant de $A=\AffMatrice*(-1,0.5 § 1/2,4)$ est
-$\det(A)=\DetMatrice[dec](-1,0.5 § 1/2,4)$.
+Le déterminant de $A=\AffMatrice(-1,0.5 § -1/2,4)$ est
+$\det(A)=\DetMatrice[dec](-1,0.5 § -1/2,4)$.
\end{ShowCodeTeX}
\begin{ShowCodeTeX}
@@ -106,7 +124,7 @@ La solution de $\systeme{3x+y-2z=-1,2x-y+z=4,x-y-2z=5}$ est $\mathcal{S}=%
\begin{ShowCodeTeX}
La solution de $\systeme{3x+y-2z=-1,2x-y+z=4,x-y-2z=5}$ est $\mathcal{S}=%
-\left\lbrace \SolutionSysteme*[d](3,1,-2 § 2,-1,1 § 1,-1,-2)(-1,4,5) \right\rbrace$.
+\left\lbrace \SolutionSysteme[d](3,1,-2 § 2,-1,1 § 1,-1,-2)(-1,4,5) \right\rbrace$.
\end{ShowCodeTeX}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty b/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty
index 930cfd33e9..5ae5c8fe94 100644
--- a/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty
+++ b/macros/latex/contrib/resolsysteme/tex/ResolSysteme.sty
@@ -2,7 +2,8 @@
% licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ResolSysteme}[2023/02/08 v0.1.2 Travailler sur un systeme lineaire avec xint ou pyluatex]
+\ProvidesPackage{ResolSysteme}[2023/02/10 v0.1.3 Travailler sur un systeme lineaire avec xint ou pyluatex]
+% 0.1.3 Produit matriciel + Puissance matricielle (2x2/3x3 carré en normal, 2x2/3x3/4x4 avec python) + Inversion comportement commandes étoilées
% 0.1.2 Ajout pour afficher une matrice, à l'aide d'une syntaxe similaire aux autres commandes
% 0.1.1 Correction d'un bug avec le séparateur ";"
% 0.1.0 Version initiale
@@ -74,12 +75,27 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
InvMatTmp = MatTmp.inv()
return InvMatTmp
+def puissance_matrice_QQ(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,puiss) :
+ MatTmp = sy.Matrix(([a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]))
+ PuissMatTmp = MatTmp**puiss
+ return PuissMatTmp
+
+def puissance_matrice_TT(a,b,c,d,e,f,g,h,i,puiss) :
+ MatTmp = sy.Matrix(([a,b,c],[d,e,f],[g,h,i]))
+ PuissMatTmp = MatTmp**puiss
+ return PuissMatTmp
+
+def puissance_matrice_DD(a,b,c,d,puiss) :
+ MatTmp = sy.Matrix(([a,b],[c,d]))
+ PuissMatTmp = MatTmp**puiss
+ return PuissMatTmp
+
\end{python}
\fi
%------conversion en fraction, version interne !
\NewDocumentCommand\ConvVersFrac{ s O{} m }{%
- %*=moins devant
+ %*=moins sur le numérateur
%2=argument.optionnel[d/t/dec=...]
%3=argument mandataire {calcul ou fraction}
\def\calculargument{\xintPRaw{\xintIrr{\xinteval{#3}}}}%on calcule et on transforme en A/B
@@ -90,45 +106,45 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\ifblank{#2}%
{%
\IfBooleanTF{#1}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
{%
\ifthenelse{\numerateur < 0}%
- {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
- {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
}%
- {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
}%
{}%si l'argument optionnel est vide
\IfStrEq{#2}{d}%
{%
\IfBooleanTF{#1}%
+ {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
{%
\ifthenelse{\numerateur < 0}%
- {\ensuremath{-\dfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
- {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {\ensuremath{-\dfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
}%
- {\ensuremath{\dfrac{\num{\numerateur}}{\num{\denominateur}}}}%
}%
{}%si l'argument optionnel est vide
\IfStrEq{#2}{t}%
{%
\IfBooleanTF{#1}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
{%
\ifthenelse{\numerateur < 0}%
- {\ensuremath{-\tfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
- {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {\ensuremath{-\tfrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
}%
- {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
}%
{}%si l'argument optionnel est vide
\IfStrEq{#2}{n}%
{%
- \IfBooleanTF{#1}%
- {%
- \ifthenelse{\numerateur < 0}%
- {\ensuremath{-\nicefrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
- {\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}}%
- }%
+ %\IfBooleanTF{#1}%
{\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ %{%
+ % \ifthenelse{\numerateur < 0}%
+ % {\ensuremath{-\nicefrac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ % {\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ %}%
}%
{}%si l'argument optionnel est vide
\IfSubStr{#2}{dec}%on veut la forme décimale
@@ -150,7 +166,7 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
%------Affichage d'une matrice classique, 2x2 ou 3x3 ou 4x4
\NewDocumentCommand\AffMatrice{ s O{} D<>{} r() }{%
- %*=fractions avec - devant
+ %*=fractions avec - sur le numérateur
%2=options conversion
%3=options nicematrix
%4=matrice (,,;,,)
@@ -290,12 +306,210 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\fi
}
+
+\NewDocumentCommand\CarreMatrice{ s O{} D<>{} r() O{} }{%
+ %*=fractions avec - sur le numérateur
+ %2=options conversion
+ %3=options nicematrix
+ %4=matrice (,,;,,)
+ %5=affichage énoncé avec [Aff]
+ %---------------------
+ %lectures des matrices
+ \setsepchar{§/,}%
+ \readlist*\MAMATRICEA{#4}%
+ %les coeffs de A
+ \ifnum \MAMATRICEAlen=3
+ \itemtomacro\MAMATRICEA[1,1]\MatA
+ \itemtomacro\MAMATRICEA[1,2]\MatB
+ \itemtomacro\MAMATRICEA[1,3]\MatC
+ \itemtomacro\MAMATRICEA[2,1]\MatD
+ \itemtomacro\MAMATRICEA[2,2]\MatE
+ \itemtomacro\MAMATRICEA[2,3]\MatF
+ \itemtomacro\MAMATRICEA[3,1]\MatG
+ \itemtomacro\MAMATRICEA[3,2]\MatH
+ \itemtomacro\MAMATRICEA[3,3]\MatI
+ %les conversions
+ \IfBooleanTF{#1}%
+ {%
+ \def\MatSQA{\ConvVersFrac*[#2]{\MatA*\MatA+\MatB*\MatD+\MatC*\MatG}}%
+ \def\MatSQB{\ConvVersFrac*[#2]{\MatA*\MatB+\MatB*\MatE+\MatC*\MatH}}%
+ \def\MatSQC{\ConvVersFrac*[#2]{\MatA*\MatC+\MatB*\MatF+\MatC*\MatI}}%
+ \def\MatSQD{\ConvVersFrac*[#2]{\MatD*\MatA+\MatE*\MatD+\MatF*\MatG}}%
+ \def\MatSQE{\ConvVersFrac*[#2]{\MatD*\MatB+\MatE*\MatE+\MatF*\MatH}}%
+ \def\MatSQF{\ConvVersFrac*[#2]{\MatD*\MatC+\MatE*\MatF+\MatF*\MatI}}%
+ \def\MatSQG{\ConvVersFrac*[#2]{\MatG*\MatA+\MatH*\MatD+\MatI*\MatG}}%
+ \def\MatSQH{\ConvVersFrac*[#2]{\MatG*\MatB+\MatH*\MatE+\MatI*\MatH}}%
+ \def\MatSQI{\ConvVersFrac*[#2]{\MatG*\MatC+\MatH*\MatF+\MatI*\MatI}}%
+ }%
+ {%
+ \def\MatSQA{\ConvVersFrac[#2]{\MatA*\MatA+\MatB*\MatD+\MatC*\MatG}}%
+ \def\MatSQB{\ConvVersFrac[#2]{\MatA*\MatB+\MatB*\MatE+\MatC*\MatH}}%
+ \def\MatSQC{\ConvVersFrac[#2]{\MatA*\MatC+\MatB*\MatF+\MatC*\MatI}}%
+ \def\MatSQD{\ConvVersFrac[#2]{\MatD*\MatA+\MatE*\MatD+\MatF*\MatG}}%
+ \def\MatSQE{\ConvVersFrac[#2]{\MatD*\MatB+\MatE*\MatE+\MatF*\MatH}}%
+ \def\MatSQF{\ConvVersFrac[#2]{\MatD*\MatC+\MatE*\MatF+\MatF*\MatI}}%
+ \def\MatSQG{\ConvVersFrac[#2]{\MatG*\MatA+\MatH*\MatD+\MatI*\MatG}}%
+ \def\MatSQH{\ConvVersFrac[#2]{\MatG*\MatB+\MatH*\MatE+\MatI*\MatH}}%
+ \def\MatSQI{\ConvVersFrac[#2]{\MatG*\MatC+\MatH*\MatF+\MatI*\MatI}}%
+ }%
+ %l'affichage
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} \\
+ \ConvVersFrac*[#2]{\MatD} & \ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} \\
+ \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} & \ConvVersFrac*[#2]{\MatI}
+ \end{pNiceMatrix}}^2=
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} \\
+ \ConvVersFrac[#2]{\MatD} & \ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} \\
+ \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} & \ConvVersFrac[#2]{\MatI}
+ \end{pNiceMatrix}}^2=
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ {\MatSQA}&{\MatSQB}&{\MatSQC} \\
+ {\MatSQD}&{\MatSQE}&{\MatSQF} \\
+ {\MatSQG}&{\MatSQH}&{\MatSQI}
+ \end{pNiceMatrix}%
+ \fi
+ \ifnum \MAMATRICEAlen=2
+ \itemtomacro\MAMATRICEA[1,1]\MatA
+ \itemtomacro\MAMATRICEA[1,2]\MatB
+ \itemtomacro\MAMATRICEA[2,1]\MatC
+ \itemtomacro\MAMATRICEA[2,2]\MatD
+ %les conversions
+ \IfBooleanTF{#1}%
+ {%
+ \def\MatSQA{\ConvVersFrac*[#2]{\MatA*\MatA+\MatB*\MatC}}%
+ \def\MatSQB{\ConvVersFrac*[#2]{\MatA*\MatB+\MatB*\MatD}}%
+ \def\MatSQC{\ConvVersFrac*[#2]{\MatC*\MatA+\MatD*\MatC}}%
+ \def\MatSQD{\ConvVersFrac*[#2]{\MatC*\MatB+\MatD*\MatD}}%
+ }%
+ {%
+ \def\MatSQA{\ConvVersFrac[#2]{\MatA*\MatA+\MatB*\MatC}}%
+ \def\MatSQB{\ConvVersFrac[#2]{\MatA*\MatB+\MatB*\MatD}}%
+ \def\MatSQC{\ConvVersFrac[#2]{\MatC*\MatA+\MatD*\MatC}}%
+ \def\MatSQD{\ConvVersFrac[#2]{\MatC*\MatB+\MatD*\MatD}}%
+ }%
+ %l'affichage
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} \\
+ \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD}
+ \end{pNiceMatrix}}^2=
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} \\
+ \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD}
+ \end{pNiceMatrix}}^2=
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ {\MatSQA}&{\MatSQB} \\
+ {\MatSQC}&{\MatSQD}
+ \end{pNiceMatrix}%
+ \fi
+ \ifnum \MAMATRICEAlen=4
+ \itemtomacro\MAMATRICEA[1,1]\MatA
+ \itemtomacro\MAMATRICEA[1,2]\MatB
+ \itemtomacro\MAMATRICEA[1,3]\MatC
+ \itemtomacro\MAMATRICEA[1,4]\MatD
+ \itemtomacro\MAMATRICEA[2,1]\MatE
+ \itemtomacro\MAMATRICEA[2,2]\MatF
+ \itemtomacro\MAMATRICEA[2,3]\MatG
+ \itemtomacro\MAMATRICEA[2,4]\MatH
+ \itemtomacro\MAMATRICEA[3,1]\MatI
+ \itemtomacro\MAMATRICEA[3,2]\MatJ
+ \itemtomacro\MAMATRICEA[3,3]\MatK
+ \itemtomacro\MAMATRICEA[3,4]\MatL
+ \itemtomacro\MAMATRICEA[4,1]\MatM
+ \itemtomacro\MAMATRICEA[4,2]\MatN
+ \itemtomacro\MAMATRICEA[4,3]\MatO
+ \itemtomacro\MAMATRICEA[4,4]\MatP
+ %les conversions
+ \IfBooleanTF{#1}%
+ {%
+ \def\MatAffA{\ConvVersFrac*[#2]{\MatA}}%
+ \def\MatAffB{\ConvVersFrac*[#2]{\MatB}}%
+ \def\MatAffC{\ConvVersFrac*[#2]{\MatC}}%
+ \def\MatAffD{\ConvVersFrac*[#2]{\MatD}}%
+ \def\MatAffE{\ConvVersFrac*[#2]{\MatE}}%
+ \def\MatAffF{\ConvVersFrac*[#2]{\MatF}}%
+ \def\MatAffG{\ConvVersFrac*[#2]{\MatG}}%
+ \def\MatAffH{\ConvVersFrac*[#2]{\MatH}}%
+ \def\MatAffI{\ConvVersFrac*[#2]{\MatI}}%
+ \def\MatAffJ{\ConvVersFrac*[#2]{\MatJ}}%
+ \def\MatAffK{\ConvVersFrac*[#2]{\MatK}}%
+ \def\MatAffL{\ConvVersFrac*[#2]{\MatL}}%
+ \def\MatAffM{\ConvVersFrac*[#2]{\MatM}}%
+ \def\MatAffN{\ConvVersFrac*[#2]{\MatN}}%
+ \def\MatAffO{\ConvVersFrac*[#2]{\MatO}}%
+ \def\MatAffP{\ConvVersFrac*[#2]{\MatP}}%
+ }%
+ {%
+ \def\MatAffA{\ConvVersFrac[#2]{\MatA}}%
+ \def\MatAffB{\ConvVersFrac[#2]{\MatB}}%
+ \def\MatAffC{\ConvVersFrac[#2]{\MatC}}%
+ \def\MatAffD{\ConvVersFrac[#2]{\MatD}}%
+ \def\MatAffE{\ConvVersFrac[#2]{\MatE}}%
+ \def\MatAffF{\ConvVersFrac[#2]{\MatF}}%
+ \def\MatAffG{\ConvVersFrac[#2]{\MatG}}%
+ \def\MatAffH{\ConvVersFrac[#2]{\MatH}}%
+ \def\MatAffI{\ConvVersFrac[#2]{\MatI}}%
+ \def\MatAffJ{\ConvVersFrac[#2]{\MatJ}}%
+ \def\MatAffK{\ConvVersFrac[#2]{\MatK}}%
+ \def\MatAffL{\ConvVersFrac[#2]{\MatL}}%
+ \def\MatAffM{\ConvVersFrac[#2]{\MatM}}%
+ \def\MatAffN{\ConvVersFrac[#2]{\MatN}}%
+ \def\MatAffO{\ConvVersFrac[#2]{\MatO}}%
+ \def\MatAffP{\ConvVersFrac[#2]{\MatP}}%
+ }%
+ %l'affichage
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD} \\
+ \ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} & \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} \\
+ \ConvVersFrac*[#2]{\MatI} & \ConvVersFrac*[#2]{\MatJ} & \ConvVersFrac*[#2]{\MatK} & \ConvVersFrac*[#2]{\MatL} \\
+ \ConvVersFrac*[#2]{\MatM} & \ConvVersFrac*[#2]{\MatN} & \ConvVersFrac*[#2]{\MatO} & \ConvVersFrac*[#2]{\MatP}
+ \end{pNiceMatrix}}^2=
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD} \\
+ \ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} & \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} \\
+ \ConvVersFrac[#2]{\MatI} & \ConvVersFrac[#2]{\MatJ} & \ConvVersFrac[#2]{\MatK} & \ConvVersFrac[#2]{\MatL} \\
+ \ConvVersFrac[#2]{\MatM} & \ConvVersFrac[#2]{\MatN} & \ConvVersFrac[#2]{\MatO} & \ConvVersFrac[#2]{\MatP}
+ \end{pNiceMatrix}}^2=
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ {\MatAffA} & {\MatAffB} & {\MatAffC} & {\MatAffD} \\
+ {\MatAffE} & {\MatAffF} & {\MatAffG} & {\MatAffH} \\
+ {\MatAffI} & {\MatAffJ} & {\MatAffK} & {\MatAffL} \\
+ {\MatAffM} & {\MatAffN} & {\MatAffO} & {\MatAffP} \\
+ \end{pNiceMatrix}%
+ \fi
+}
+
%------Commande classique, 2x2 ou 3x3
-\NewDocumentCommand\MatriceInverse{ s O{} D<>{} r() }{%
- %*=fractions avec - devant
+\NewDocumentCommand\MatriceInverse{ s O{} D<>{} r() O{} }{%
+ %*=fractions avec - sur le numérateur
%2=options conversion
%3=options nicematrix
%4=matrice (,,;,,)
+ %5=Affichage énoncé avec [Aff]
%---------------------
%lectures des matrices
\setsepchar{§/,}%
@@ -341,6 +555,24 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\def\MatInvH{\ConvVersFrac[#2]{(-\MatA*\MatH+\MatB*\MatG)/\DETMATRICE}}%
\def\MatInvI{\ConvVersFrac[#2]{(\MatA*\MatE-\MatB*\MatD)/\DETMATRICE}}%
}%
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} \\
+ \ConvVersFrac*[#2]{\MatD} & \ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} \\
+ \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} & \ConvVersFrac*[#2]{\MatI} \\
+ \end{pNiceMatrix}}^{-1}=
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} \\
+ \ConvVersFrac[#2]{\MatD} & \ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} \\
+ \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} & \ConvVersFrac[#2]{\MatI} \\
+ \end{pNiceMatrix}}^{-1}=
+ }%
+ }{}%
\begin{pNiceMatrix}[#3]
{\MatInvA}&{\MatInvB}&{\MatInvC} \\
{\MatInvD}&{\MatInvE}&{\MatInvF} \\
@@ -372,6 +604,22 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\def\MatInvC{\ConvVersFrac[#2]{(-\MatC)/\DETMATRICE}}%
\def\MatInvD{\ConvVersFrac[#2]{(\MatA)/\DETMATRICE}}%
}%
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} \\
+ \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD}
+ \end{pNiceMatrix}}^{-1}=
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} \\
+ \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD}
+ \end{pNiceMatrix}}^{-1}=
+ }%
+ }{}%
\begin{pNiceMatrix}[#3]
{\MatInvA}&{\MatInvB} \\
{\MatInvC}&{\MatInvD}
@@ -381,7 +629,7 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
}
\NewDocumentCommand\DetMatrice{ s O{} r() }{%
- %*=fractions avec - devant
+ %*=fractions avec - sur le numérateur
%2=options conversion
%3=matrice (,,;,,)
%---------------------
@@ -420,7 +668,7 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
}
\NewDocumentCommand\SolutionSysteme{ s O{} D<>{} r() r() O{} }{%
- %*=fractions avec - devant
+ %*=fractions avec - sur le numérateur
%2=options conversion
%3=options nicematrix
%4=matrice (,,;,,) principale
@@ -530,10 +778,408 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\fi
}
+\NewDocumentCommand\ProduitMatrices{ s O{} D<>{} r() r() O{} }{%
+ %*=fractions avec - sur le numérateur
+ %2=options conversion
+ %3=options nicematrix globales ?
+ %4=matrice (,,§,,) A
+ %5=matrice (,,§,,) B
+ %---------------------
+ %lectures des matrices et dimensions
+ \setsepchar{§/,}%
+ \readlist*\MatA{#4}%
+ \readlist*\MatB{#5}%
+ \def\NbLigMatA{\MatAlen}%
+ \def\NbLigMatB{\MatBlen}%
+ \itemtomacro\MatA[1]{\MatAligne}%
+ \itemtomacro\MatB[1]{\MatBligne}%
+ \setsepchar{,}%
+ \readlist*\TmpA{\MatAligne}%
+ \readlist*\TmpB{\MatBligne}%
+ \def\NbColMatA{\TmpAlen}%
+ \def\NbColMatB{\TmpBlen}%
+ %test de dimensions !!
+ \xintifboolexpr{\NbColMatA != \NbLigMatB}
+ {\text{Erreur de dimensions}}%
+ {
+ \xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==1}% (1,2)*(2,1)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatB[1]\CoeffBa
+ \itemtomacro\MatB[2]\CoeffBb
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatRes{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+ }%
+ {%
+ \def\MatRes{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatRes
+ \end{pNiceMatrix}%
+ }{}%fin 1,2*2,1
+ \xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==2}% (1,2)*(2,2)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatB[1,1]\CoeffBa
+ \itemtomacro\MatB[1,2]\CoeffBb
+ \itemtomacro\MatB[2,1]\CoeffBc
+ \itemtomacro\MatB[2,2]\CoeffBd
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+ \def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBd}}%
+ }%
+ {%
+ \def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+ \def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBd}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatResA & \MatResB
+ \end{pNiceMatrix}%
+ }{}%fin 1,2*2,1
+ \xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==1}% (1,3)*(3,1)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatA[1,3]\CoeffAc
+ \itemtomacro\MatB[1]\CoeffBa
+ \itemtomacro\MatB[2]\CoeffBb
+ \itemtomacro\MatB[3]\CoeffBc
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatRes{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+ }%
+ {%
+ \def\MatRes{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatRes
+ \end{pNiceMatrix}%
+ }{}%fin 1,3*3,1
+ \xintifboolexpr{\NbLigMatA==1 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==3}% (1,3)*(3,3)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatA[1,3]\CoeffAc
+ \itemtomacro\MatB[1,1]\CoeffBa
+ \itemtomacro\MatB[1,2]\CoeffBb
+ \itemtomacro\MatB[1,3]\CoeffBc
+ \itemtomacro\MatB[2,1]\CoeffBd
+ \itemtomacro\MatB[2,2]\CoeffBe
+ \itemtomacro\MatB[2,3]\CoeffBf
+ \itemtomacro\MatB[3,1]\CoeffBg
+ \itemtomacro\MatB[3,2]\CoeffBh
+ \itemtomacro\MatB[3,3]\CoeffBi
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+ \def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+ \def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+ }%
+ {%
+ \def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+ \def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+ \def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} \\
+ \ConvVersFrac*[#2]{\CoeffBd} & \ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} \\
+ \ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} & \ConvVersFrac*[#2]{\CoeffBi}
+ \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} \\
+ \ConvVersFrac[#2]{\CoeffBd} & \ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} \\
+ \ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} & \ConvVersFrac[#2]{\CoeffBi}
+ \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatResA & \MatResB & \MatResC
+ \end{pNiceMatrix}%
+ }{}%fin 1,3*3,3
+ \xintifboolexpr{\NbLigMatA==2 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==1}% (2,2)*(2,1)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatA[2,1]\CoeffAc
+ \itemtomacro\MatA[2,2]\CoeffAd
+ \itemtomacro\MatB[1]\CoeffBa
+ \itemtomacro\MatB[2]\CoeffBb
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+ \def\MatResB{\ConvVersFrac*[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBb}}%
+ }%
+ {%
+ \def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb}}%
+ \def\MatResB{\ConvVersFrac[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBb}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \\ \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \\ \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatResA \\ \MatResB
+ \end{pNiceMatrix}%
+ }{}%fin 2,2*2,1
+ \xintifboolexpr{\NbLigMatA==2 'and' \NbColMatA==2 'and' \NbLigMatB==2 'and' \NbColMatB==2}% (2,2)*(2,2)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatA[2,1]\CoeffAc
+ \itemtomacro\MatA[2,2]\CoeffAd
+ \itemtomacro\MatB[1,1]\CoeffBa
+ \itemtomacro\MatB[1,2]\CoeffBb
+ \itemtomacro\MatB[2,1]\CoeffBc
+ \itemtomacro\MatB[2,2]\CoeffBd
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+ \def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAd*\CoeffBd}}%
+ \def\MatResC{\ConvVersFrac*[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBc}}%
+ \def\MatResD{\ConvVersFrac*[#2]{\CoeffAc*\CoeffBb+\CoeffAd*\CoeffBd}}%
+ }%
+ {%
+ \def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBc}}%
+ \def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAd*\CoeffBd}}%
+ \def\MatResC{\ConvVersFrac[#2]{\CoeffAc*\CoeffBa+\CoeffAd*\CoeffBc}}%
+ \def\MatResD{\ConvVersFrac[#2]{\CoeffAc*\CoeffBb+\CoeffAd*\CoeffBd}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} \\ \ConvVersFrac*[#2]{\CoeffAc} & \ConvVersFrac*[#2]{\CoeffAd} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} & \ConvVersFrac*[#2]{\CoeffBd} \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} \\ \ConvVersFrac[#2]{\CoeffAc} & \ConvVersFrac[#2]{\CoeffAd} \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} & \ConvVersFrac[#2]{\CoeffBd} \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatResA & \MatResB \\ \MatResC & \MatResD
+ \end{pNiceMatrix}%
+ }{}%fin 2,2*2,1
+ \xintifboolexpr{\NbLigMatA==3 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==1}% (3,3)*(3,1)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatA[1,3]\CoeffAc
+ \itemtomacro\MatA[2,1]\CoeffAd
+ \itemtomacro\MatA[2,2]\CoeffAe
+ \itemtomacro\MatA[2,3]\CoeffAf
+ \itemtomacro\MatA[3,1]\CoeffAg
+ \itemtomacro\MatA[3,2]\CoeffAh
+ \itemtomacro\MatA[3,3]\CoeffAi
+ \itemtomacro\MatB[1]\CoeffBa
+ \itemtomacro\MatB[2]\CoeffBb
+ \itemtomacro\MatB[3]\CoeffBc
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+ \def\MatResB{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBc}}%
+ \def\MatResC{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBb+\CoeffAi*\CoeffBc}}%
+ }%
+ {%
+ \def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBb+\CoeffAc*\CoeffBc}}%
+ \def\MatResB{\ConvVersFrac[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBb+\CoeffAf*\CoeffBc}}%
+ \def\MatResC{\ConvVersFrac[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBb+\CoeffAi*\CoeffBc}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \\
+ \ConvVersFrac*[#2]{\CoeffAd} & \ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} \\
+ \ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} & \ConvVersFrac*[#2]{\CoeffAi}
+ \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac*[#2]{\CoeffBa} \\ \ConvVersFrac*[#2]{\CoeffBb} \\ \ConvVersFrac*[#2]{\CoeffBc} \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \\
+ \ConvVersFrac[#2]{\CoeffAd} & \ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} \\
+ \ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} & \ConvVersFrac[#2]{\CoeffAi}
+ \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3] \ConvVersFrac[#2]{\CoeffBa} \\ \ConvVersFrac[#2]{\CoeffBb} \\ \ConvVersFrac[#2]{\CoeffBc} \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatResA \\ \MatResB \\ \MatResC
+ \end{pNiceMatrix}%
+ }{}%fin 3,3*3,1
+ \xintifboolexpr{\NbLigMatA==3 'and' \NbColMatA==3 'and' \NbLigMatB==3 'and' \NbColMatB==3}% (3,3)*(3,3)
+ {%
+ \itemtomacro\MatA[1,1]\CoeffAa
+ \itemtomacro\MatA[1,2]\CoeffAb
+ \itemtomacro\MatA[1,3]\CoeffAc
+ \itemtomacro\MatA[2,1]\CoeffAd
+ \itemtomacro\MatA[2,2]\CoeffAe
+ \itemtomacro\MatA[2,3]\CoeffAf
+ \itemtomacro\MatA[3,1]\CoeffAg
+ \itemtomacro\MatA[3,2]\CoeffAh
+ \itemtomacro\MatA[3,3]\CoeffAi
+ \itemtomacro\MatB[1,1]\CoeffBa
+ \itemtomacro\MatB[1,2]\CoeffBb
+ \itemtomacro\MatB[1,3]\CoeffBc
+ \itemtomacro\MatB[2,1]\CoeffBd
+ \itemtomacro\MatB[2,2]\CoeffBe
+ \itemtomacro\MatB[1,3]\CoeffBf
+ \itemtomacro\MatB[3,1]\CoeffBg
+ \itemtomacro\MatB[3,2]\CoeffBh
+ \itemtomacro\MatB[3,3]\CoeffBi
+ \IfBooleanTF{#1}%version étoilée := moins sur num
+ {%
+ \def\MatResA{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+ \def\MatResB{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+ \def\MatResC{\ConvVersFrac*[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+ \def\MatResD{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBg}}%
+ \def\MatResE{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBb+\CoeffAe*\CoeffBe+\CoeffAf*\CoeffBh}}%
+ \def\MatResF{\ConvVersFrac*[#2]{\CoeffAd*\CoeffBc+\CoeffAe*\CoeffBf+\CoeffAf*\CoeffBi}}%
+ \def\MatResG{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBd+\CoeffAi*\CoeffBg}}%
+ \def\MatResH{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBb+\CoeffAh*\CoeffBe+\CoeffAi*\CoeffBh}}%
+ \def\MatResI{\ConvVersFrac*[#2]{\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBf+\CoeffAi*\CoeffBi}}%
+ }%
+ {%
+ \def\MatResA{\ConvVersFrac[#2]{\CoeffAa*\CoeffBa+\CoeffAb*\CoeffBd+\CoeffAc*\CoeffBg}}%
+ \def\MatResB{\ConvVersFrac[#2]{\CoeffAa*\CoeffBb+\CoeffAb*\CoeffBe+\CoeffAc*\CoeffBh}}%
+ \def\MatResC{\ConvVersFrac[#2]{\CoeffAa*\CoeffBc+\CoeffAb*\CoeffBf+\CoeffAc*\CoeffBi}}%
+ \def\MatResD{\ConvVersFrac[#2]{\CoeffAd*\CoeffBa+\CoeffAe*\CoeffBd+\CoeffAf*\CoeffBg}}%
+ \def\MatResE{\ConvVersFrac[#2]{\CoeffAd*\CoeffBb+\CoeffAe*\CoeffBe+\CoeffAf*\CoeffBh}}%
+ \def\MatResF{\ConvVersFrac[#2]{\CoeffAd*\CoeffBc+\CoeffAe*\CoeffBf+\CoeffAf*\CoeffBi}}%
+ \def\MatResG{\ConvVersFrac[#2]{\CoeffAg*\CoeffBa+\CoeffAh*\CoeffBd+\CoeffAi*\CoeffBg}}%
+ \def\MatResH{\ConvVersFrac[#2]{\CoeffAg*\CoeffBb+\CoeffAh*\CoeffBe+\CoeffAi*\CoeffBh}}%
+ \def\MatResI{\ConvVersFrac[#2]{\CoeffAg*\CoeffBc+\CoeffAh*\CoeffBf+\CoeffAi*\CoeffBi}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\CoeffAa} & \ConvVersFrac*[#2]{\CoeffAb} & \ConvVersFrac*[#2]{\CoeffAc} \\
+ \ConvVersFrac*[#2]{\CoeffAd} & \ConvVersFrac*[#2]{\CoeffAe} & \ConvVersFrac*[#2]{\CoeffAf} \\
+ \ConvVersFrac*[#2]{\CoeffAg} & \ConvVersFrac*[#2]{\CoeffAh} & \ConvVersFrac*[#2]{\CoeffAi}
+ \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\CoeffBa} & \ConvVersFrac*[#2]{\CoeffBb} & \ConvVersFrac*[#2]{\CoeffBc} \\
+ \ConvVersFrac*[#2]{\CoeffBd} & \ConvVersFrac*[#2]{\CoeffBe} & \ConvVersFrac*[#2]{\CoeffBf} \\
+ \ConvVersFrac*[#2]{\CoeffBg} & \ConvVersFrac*[#2]{\CoeffBh} & \ConvVersFrac*[#2]{\CoeffBi}
+ \end{pNiceMatrix}
+ =
+ }%
+ {%
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\CoeffAa} & \ConvVersFrac[#2]{\CoeffAb} & \ConvVersFrac[#2]{\CoeffAc} \\
+ \ConvVersFrac[#2]{\CoeffAd} & \ConvVersFrac[#2]{\CoeffAe} & \ConvVersFrac[#2]{\CoeffAf} \\
+ \ConvVersFrac[#2]{\CoeffAg} & \ConvVersFrac[#2]{\CoeffAh} & \ConvVersFrac[#2]{\CoeffAi}
+ \end{pNiceMatrix}
+ \times
+ \begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\CoeffBa} & \ConvVersFrac[#2]{\CoeffBb} & \ConvVersFrac[#2]{\CoeffBc} \\
+ \ConvVersFrac[#2]{\CoeffBd} & \ConvVersFrac[#2]{\CoeffBe} & \ConvVersFrac[#2]{\CoeffBf} \\
+ \ConvVersFrac[#2]{\CoeffBg} & \ConvVersFrac[#2]{\CoeffBh} & \ConvVersFrac[#2]{\CoeffBi}
+ \end{pNiceMatrix}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ \MatResA & \MatResB & \MatResC \\ \MatResD & \MatResE & \MatResF \\ \MatResG & \MatResH & \MatResI
+ \end{pNiceMatrix}%
+ }{}%fin 3,3*3,3
+ }%
+}
+
+
%------Commandes via pyluatex
\if@pyluatex %package pyluatex à charger par l'utilisateur !
\NewDocumentCommand\SolutionSystemePY{ s O{} D<>{} r() r() O{} }{%
- %*=avec le moins devant
+ %*=fractions avec - sur le numérateur
%2=Option Fraction
%3=matrice du système
%4=second membre
@@ -681,8 +1327,8 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\fi
}
-\NewDocumentCommand\MatriceInversePY{ s O{} D<>{} r() }{%
- %*=fractions avec - devant
+\NewDocumentCommand\MatriceInversePY{ s O{} D<>{} r() O{} }{%
+ %*=fractions avec - sur le numérateur
%2=options conversion
%3=options nicematrix
%4=matrice (,,;,,)
@@ -750,6 +1396,28 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\def\MatInvO{\ConvVersFrac[#2]{\py{inverse_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[14]}}}%
\def\MatInvP{\ConvVersFrac[#2]{\py{inverse_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP)[15]}}}%
}%
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD} \\
+ \ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} & \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} \\
+ \ConvVersFrac*[#2]{\MatI} & \ConvVersFrac*[#2]{\MatJ} & \ConvVersFrac*[#2]{\MatK} & \ConvVersFrac*[#2]{\MatL} \\
+ \ConvVersFrac*[#2]{\MatM} & \ConvVersFrac*[#2]{\MatN} & \ConvVersFrac*[#2]{\MatO} & \ConvVersFrac*[#2]{\MatO} \\
+ \end{pNiceMatrix}}^{-1}
+ =
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD} \\
+ \ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} & \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} \\
+ \ConvVersFrac[#2]{\MatI} & \ConvVersFrac[#2]{\MatJ} & \ConvVersFrac[#2]{\MatK} & \ConvVersFrac[#2]{\MatL} \\
+ \ConvVersFrac[#2]{\MatM} & \ConvVersFrac[#2]{\MatN} & \ConvVersFrac[#2]{\MatO} & \ConvVersFrac[#2]{\MatO} \\
+ \end{pNiceMatrix}}^{-1}
+ =
+ }%
+ }{}%
\begin{pNiceMatrix}[#3]
{\MatInvA} & {\MatInvB} & {\MatInvC} & {\MatInvD} \\
{\MatInvE} & {\MatInvF} & {\MatInvG} & {\MatInvH} \\
@@ -795,6 +1463,26 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\def\MatInvH{\ConvVersFrac[#2]{\py{inverse_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[7]}}}
\def\MatInvI{\ConvVersFrac[#2]{\py{inverse_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI)[8]}}}
}%
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} \\
+ \ConvVersFrac*[#2]{\MatD} & \ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} \\
+ \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} & \ConvVersFrac*[#2]{\MatI}
+ \end{pNiceMatrix}}^{-1}
+ =
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} \\
+ \ConvVersFrac[#2]{\MatD} & \ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} \\
+ \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} & \ConvVersFrac[#2]{\MatI}
+ \end{pNiceMatrix}}^{-1}
+ =
+ }%
+ }{}%
\begin{pNiceMatrix}[#3]
{\MatInvA} & {\MatInvB} & {\MatInvC} \\
{\MatInvD} & {\MatInvE} & {\MatInvF} \\
@@ -824,6 +1512,24 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\def\MatInvC{\ConvVersFrac[#2]{\py{inverse_matrice_DD(\MatA,\MatB,\MatC,\MatD)[2]}}}
\def\MatInvD{\ConvVersFrac[#2]{\py{inverse_matrice_DD(\MatA,\MatB,\MatC,\MatD)[3]}}}
}%
+ \IfStrEq{#5}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} \\
+ \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD}
+ \end{pNiceMatrix}}^{-1}
+ =
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} \\
+ \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD}
+ \end{pNiceMatrix}}^{-1}
+ =
+ }%
+ }{}%
\begin{pNiceMatrix}[#3]
{\MatInvA} & {\MatInvB} \\
{\MatInvC} & {\MatInvD}
@@ -832,8 +1538,208 @@ def inverse_matrice_TT(a,b,c,d,e,f,g,h,i) :
\fi
}
+\NewDocumentCommand\MatricePuissancePY{ s O{} D<>{} r() r() O{} }{%
+ %*=fractions avec - sur le numérateur
+ %2=options conversion
+ %3=options nicematrix
+ %4=matrice (,,;,,)
+ %5=puissance
+ %6=affichage de l'énoncé
+ %---------------------
+ %lectures des matrices
+ \setsepchar{§/,}%
+ \readlist*\MAMATRICEA{#4}%
+ %les coeffs de A et le déterminant et les coeff de l'inverse
+ \ifnum \MAMATRICEAlen=4
+ \itemtomacro\MAMATRICEA[1,1]\MatA
+ \itemtomacro\MAMATRICEA[1,2]\MatB
+ \itemtomacro\MAMATRICEA[1,3]\MatC
+ \itemtomacro\MAMATRICEA[1,4]\MatD
+ \itemtomacro\MAMATRICEA[2,1]\MatE
+ \itemtomacro\MAMATRICEA[2,2]\MatF
+ \itemtomacro\MAMATRICEA[2,3]\MatG
+ \itemtomacro\MAMATRICEA[2,4]\MatH
+ \itemtomacro\MAMATRICEA[3,1]\MatI
+ \itemtomacro\MAMATRICEA[3,2]\MatJ
+ \itemtomacro\MAMATRICEA[3,3]\MatK
+ \itemtomacro\MAMATRICEA[3,4]\MatL
+ \itemtomacro\MAMATRICEA[4,1]\MatM
+ \itemtomacro\MAMATRICEA[4,2]\MatN
+ \itemtomacro\MAMATRICEA[4,3]\MatO
+ \itemtomacro\MAMATRICEA[4,4]\MatP
+ %les solutions
+ \IfBooleanTF{#1}%
+ {
+ \def\MatPuissA{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[0]}}}%
+ \def\MatPuissB{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[1]}}}%
+ \def\MatPuissC{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[2]}}}%
+ \def\MatPuissD{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[3]}}}%
+ \def\MatPuissE{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[4]}}}%
+ \def\MatPuissF{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[5]}}}%
+ \def\MatPuissG{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[6]}}}%
+ \def\MatPuissH{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[7]}}}%
+ \def\MatPuissI{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[8]}}}%
+ \def\MatPuissJ{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[9]}}}%
+ \def\MatPuissK{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[10]}}}%
+ \def\MatPuissL{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[11]}}}%
+ \def\MatPuissM{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[12]}}}%
+ \def\MatPuissN{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[13]}}}%
+ \def\MatPuissO{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[14]}}}%
+ \def\MatPuissP{\ConvVersFrac*[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[15]}}}%
+ }%
+ {%
+ \def\MatPuissA{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[0]}}}%
+ \def\MatPuissB{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[1]}}}%
+ \def\MatPuissC{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[2]}}}%
+ \def\MatPuissD{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[3]}}}%
+ \def\MatPuissE{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[4]}}}%
+ \def\MatPuissF{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[5]}}}%
+ \def\MatPuissG{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[6]}}}%
+ \def\MatPuissH{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[7]}}}%
+ \def\MatPuissI{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[8]}}}%
+ \def\MatPuissJ{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[9]}}}%
+ \def\MatPuissK{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[10]}}}%
+ \def\MatPuissL{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[11]}}}%
+ \def\MatPuissM{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[12]}}}%
+ \def\MatPuissN{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[13]}}}%
+ \def\MatPuissO{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[14]}}}%
+ \def\MatPuissP{\ConvVersFrac[#2]{\py{puissance_matrice_QQ(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,\MatJ,\MatK,\MatL,\MatM,\MatN,\MatO,\MatP,#5)[15]}}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD} \\
+ \ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} & \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} \\
+ \ConvVersFrac*[#2]{\MatI} & \ConvVersFrac*[#2]{\MatJ} & \ConvVersFrac*[#2]{\MatK} & \ConvVersFrac*[#2]{\MatL} \\
+ \ConvVersFrac*[#2]{\MatM} & \ConvVersFrac*[#2]{\MatN} & \ConvVersFrac*[#2]{\MatO} & \ConvVersFrac*[#2]{\MatO} \\
+ \end{pNiceMatrix}}^{#5}
+ =
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD} \\
+ \ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} & \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} \\
+ \ConvVersFrac[#2]{\MatI} & \ConvVersFrac[#2]{\MatJ} & \ConvVersFrac[#2]{\MatK} & \ConvVersFrac[#2]{\MatL} \\
+ \ConvVersFrac[#2]{\MatM} & \ConvVersFrac[#2]{\MatN} & \ConvVersFrac[#2]{\MatO} & \ConvVersFrac[#2]{\MatO} \\
+ \end{pNiceMatrix}}^{#5}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ {\MatPuissA} & {\MatPuissB} & {\MatPuissC} & {\MatPuissD} \\
+ {\MatPuissE} & {\MatPuissF} & {\MatPuissG} & {\MatPuissH} \\
+ {\MatPuissI} & {\MatPuissJ} & {\MatPuissK} & {\MatPuissL} \\
+ {\MatPuissM} & {\MatPuissN} & {\MatPuissO} & {\MatPuissP} \\
+ \end{pNiceMatrix}%
+ \fi
+ \ifnum \MAMATRICEAlen=3
+ \itemtomacro\MAMATRICEA[1,1]\MatA
+ \itemtomacro\MAMATRICEA[1,2]\MatB
+ \itemtomacro\MAMATRICEA[1,3]\MatC
+ \itemtomacro\MAMATRICEA[2,1]\MatD
+ \itemtomacro\MAMATRICEA[2,2]\MatE
+ \itemtomacro\MAMATRICEA[2,3]\MatF
+ \itemtomacro\MAMATRICEA[3,1]\MatG
+ \itemtomacro\MAMATRICEA[3,2]\MatH
+ \itemtomacro\MAMATRICEA[3,3]\MatI
+ %les solutions
+ \IfBooleanTF{#1}%
+ {
+ \def\MatPuissA{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[0]}}}%
+ \def\MatPuissB{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[1]}}}%
+ \def\MatPuissC{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[2]}}}%
+ \def\MatPuissD{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[3]}}}%
+ \def\MatPuissE{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[4]}}}%
+ \def\MatPuissF{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[5]}}}%
+ \def\MatPuissG{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[6]}}}%
+ \def\MatPuissH{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[7]}}}%
+ \def\MatPuissI{\ConvVersFrac*[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[8]}}}%
+ }%
+ {%
+ \def\MatPuissA{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[0]}}}%
+ \def\MatPuissB{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[1]}}}%
+ \def\MatPuissC{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[2]}}}%
+ \def\MatPuissD{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[3]}}}%
+ \def\MatPuissE{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[4]}}}%
+ \def\MatPuissF{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[5]}}}%
+ \def\MatPuissG{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[6]}}}%
+ \def\MatPuissH{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[7]}}}%
+ \def\MatPuissI{\ConvVersFrac[#2]{\py{puissance_matrice_TT(\MatA,\MatB,\MatC,\MatD,\MatE,\MatF,\MatG,\MatH,\MatI,#5)[8]}}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} & \ConvVersFrac*[#2]{\MatC} \\
+ \ConvVersFrac*[#2]{\MatD} & \ConvVersFrac*[#2]{\MatE} & \ConvVersFrac*[#2]{\MatF} \\
+ \ConvVersFrac*[#2]{\MatG} & \ConvVersFrac*[#2]{\MatH} & \ConvVersFrac*[#2]{\MatI}
+ \end{pNiceMatrix}}^{#5}
+ =
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} & \ConvVersFrac[#2]{\MatC} \\
+ \ConvVersFrac[#2]{\MatD} & \ConvVersFrac[#2]{\MatE} & \ConvVersFrac[#2]{\MatF} \\
+ \ConvVersFrac[#2]{\MatG} & \ConvVersFrac[#2]{\MatH} & \ConvVersFrac[#2]{\MatI}
+ \end{pNiceMatrix}}^{#5}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ {\MatPuissA} & {\MatPuissB} & {\MatPuissC} \\
+ {\MatPuissD} & {\MatPuissE} & {\MatPuissF} \\
+ {\MatPuissG} & {\MatPuissH} & {\MatPuissI}
+ \end{pNiceMatrix}%
+ \fi
+ \ifnum \MAMATRICEAlen=2
+ \itemtomacro\MAMATRICEA[1,1]\MatA
+ \itemtomacro\MAMATRICEA[1,2]\MatB
+ \itemtomacro\MAMATRICEA[2,1]\MatC
+ \itemtomacro\MAMATRICEA[2,2]\MatD
+ %les solutions
+ \IfBooleanTF{#1}%
+ {
+ \def\MatPuissA{\ConvVersFrac*[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[0]}}}%
+ \def\MatPuissB{\ConvVersFrac*[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[1]}}}%
+ \def\MatPuissC{\ConvVersFrac*[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[2]}}}%
+ \def\MatPuissD{\ConvVersFrac*[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[3]}}}%
+ }%
+ {%
+ \def\MatPuissA{\ConvVersFrac[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[0]}}}%
+ \def\MatPuissB{\ConvVersFrac[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[1]}}}%
+ \def\MatPuissC{\ConvVersFrac[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[2]}}}%
+ \def\MatPuissD{\ConvVersFrac[#2]{\py{puissance_matrice_DD(\MatA,\MatB,\MatC,\MatD,#5)[3]}}}%
+ }%
+ \IfStrEq{#6}{Aff}%si matrice
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac*[#2]{\MatA} & \ConvVersFrac*[#2]{\MatB} \\
+ \ConvVersFrac*[#2]{\MatC} & \ConvVersFrac*[#2]{\MatD}
+ \end{pNiceMatrix}}^{#5}
+ =
+ }%
+ {%
+ {\begin{pNiceMatrix}[#3]
+ \ConvVersFrac[#2]{\MatA} & \ConvVersFrac[#2]{\MatB} \\
+ \ConvVersFrac[#2]{\MatC} & \ConvVersFrac[#2]{\MatD}
+ \end{pNiceMatrix}}^{#5}
+ =
+ }%
+ }{}%
+ \begin{pNiceMatrix}[#3]
+ {\MatPuissA} & {\MatPuissB} \\
+ {\MatPuissC} & {\MatPuissD}
+ \end{pNiceMatrix}%
+ \fi
+}
+
\NewDocumentCommand\DetMatricePY{ s O{} r() }{%
- %*=fractions avec - devant
+ %*=fractions avec - sur le numérateur
%2=options conversion
%3=matrice (,,;,,)
%---------------------