summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/proflycee
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/proflycee')
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty4
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/proflycee-tools-aleatoire.tex14
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex30
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex390
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex189
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/proflycee-tools-probas.tex183
6 files changed, 775 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
index 25a212e65ad..f6222383099 100644
--- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
+++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
@@ -3,7 +3,9 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2024/04/20 3.03d Aide pour l'utilisation de LaTeX en lycee]
+\ProvidesPackage{ProfLycee}[2024/05/09 3.04b Aide pour l'utilisation de LaTeX en lycee]
+% 3.04b Travail sur la loi binomiale + Ajout de clés pour les environnements graphiques
+% 3.04a Améliorations de la partie graphiques tikz (intégrales, axes) + Factorielle
% 3.03d Page de garde type BAC
% 3.03c Correction du fonctionnement gobble avec piton + compatibilité luamplib PfC
% 3.03b Compétences Maths Lycées + \pflnum pour num+xint :-) + correction de bugs (div eucl)
diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-aleatoire.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-aleatoire.tex
index 19d13ab9321..4d4a50eca37 100644
--- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-aleatoire.tex
+++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-aleatoire.tex
@@ -85,8 +85,18 @@
\newcommand\NbAlea[4][0]{%entier ou décimal
\xintifboolexpr{#1 == 0}%
- {\xdef#4{\fpeval{randint(#2,#3)}}}%
- {\xdef#4{\fpeval{round(randint(#2,#3)+rand(),#1)}}}%
+ {%
+ \xdef#4{\fpeval{randint(#2,#3)}}%
+ }%
+ {%
+ \xintifboolexpr{(#3-#2) == 1}%
+ {%
+ \xdef#4{\fpeval{round(#2+rand(),#1)}}%
+ }%
+ {%
+ \xdef#4{\fpeval{round(randint(#2,#3)+rand(),#1)}}%
+ }%
+ }%
}
\newcommand\VarNbAlea[2]{%
\xdef#1{\fpeval{#2}}%
diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex
index 5e1f246ab3f..ade88434c2c 100644
--- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex
+++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-analyse.tex
@@ -574,6 +574,36 @@
}%
}
+%===intégrale 'brute'
+\NewDocumentCommand\CalcIntegrale{ s O{} D<>{50} m m m }{%
+ \xintdeffloatfunc varfct(x) := #4 ;%
+ \def\TmpNmU{\xinteval{(#3)-1}}%
+ \def\TmpRes{\xintfloateval{(#6-#5)/(6*(#3))*(2*add(varfct(#5+i*(#6-#5)/(#3)),i=1..\TmpNmU)+varfct(#5)+varfct(#6)+4*add(varfct(#5+(i+0.5)*(#6-#5)/(#3)), i=0..\TmpNmU))}}%
+ \IfStrEq{#2}{}%
+ {%
+ \IfBooleanTF{#1}{\num{\TmpRes}}{\TmpRes}%
+ }%
+ {%
+ \IfBooleanTF{#1}{\num{\xintfloateval{round(\TmpRes,#2)}}}{\xintfloateval{round(\TmpRes,#2)}}%
+ }%
+ \relax
+}
+
+%===intégrale 'brute'
+\NewDocumentCommand\ValeurMoyenneIntg{ s O{} D<>{50} m m m }{%
+ \xintdeffloatfunc varfct(x) := #4 ;%
+ \def\TmpNmU{\xinteval{(#3)-1}}%
+ \def\TmpRes{\xintfloateval{(1)/(6*(#3))*(2*add(varfct(#5+i*(#6-#5)/(#3)),i=1..\TmpNmU)+varfct(#5)+varfct(#6)+4*add(varfct(#5+(i+0.5)*(#6-#5)/(#3)), i=0..\TmpNmU))}}%
+ \IfStrEq{#2}{}%
+ {%
+ \IfBooleanTF{#1}{\num{\TmpRes}}{\TmpRes}%
+ }%
+ {%
+ \IfBooleanTF{#1}{\num{\xintfloateval{round(\TmpRes,#2)}}}{\xintfloateval{round(\TmpRes,#2)}}%
+ }%
+ \relax
+}
+
%==intégrale tikz==
\defKV[methodeintegrtkz]{%
diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex
index db3f2bc8ac4..a021fea9374 100644
--- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex
+++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-arithm.tex
@@ -1512,4 +1512,394 @@
{}%
}
+%====FACTORIELLE
+\defKV[calcfactorielle]{ChSignif=\def\factochfsign{#1},Sens=\def\factochfsens{#1}}
+\setKVdefault[calcfactorielle]{%
+ Complet=false,%
+ Enonce=false,%
+ Partiel=false,%
+ Grand=false,%
+ ChSignif=9,%
+ Espace=\mkern1.5mu\relax,%
+ Sens=m
+}
+
+\NewDocumentCommand\Factorielle{ s O{} m }{%
+ \restoreKV[calcfactorielle]%
+ \setKV[calcfactorielle]{#2}%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \xdef\tmpres{\xintfloateval[\factochfsign]{factorial(#3)}}%
+ }%
+ {%
+ \xdef\tmpres{\xinteval{factorial(#3)}}%
+ }%
+ \ensuremath{%
+ \ifboolKV[calcfactorielle]{Enonce}%
+ {%
+ \IfBooleanTF{#1}{#3\useKV[calcfactorielle]{Espace}!}{\num{#3}\useKV[calcfactorielle]{Espace}!}=
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Partiel}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEqCase{\factochfsens}{%
+ {m}{1 \times 2 \times \ldots \times \xinteval{#3-1} \times #3 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ {d}{#3 \times \xinteval{#3-1} \times \ldots \times 2 \times 1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ }%
+ }%
+ {%
+ \IfStrEqCase{\factochfsens}{%
+ {m}{1 \times 2 \times \ldots \times \num{\xinteval{#3-1}} \times \num{#3} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ {d}{\num{#3} \times \num{\xinteval{#3-1}} \times \ldots \times 2 \times 1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ }%
+ }%
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Complet}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 1 \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\times ##1} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{2}}\do{##1 \times} 1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 1 \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\times \num{##1}} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{2}}\do{\num{##1} \times} 1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ }%
+ {}%
+ \IfBooleanTF{#1}%
+ {%
+ \tmpres%
+ }%
+ {%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \num[scientific-notation=true]{\tmpres}%
+ }%
+ {%
+ \num{\tmpres}%
+ }%
+ }%
+ }%
+}
+
+\NewDocumentCommand\Primorielle{ s O{} m }{%
+ \restoreKV[calcfactorielle]%
+ \setKV[calcfactorielle]{#2}%
+ \def\tmpres{1}%
+ \xintFor* ##1 in {\xintSeq{1}{#3}}\do{%
+ \pgfmathisprime{##1}\ifnum\pgfmathresult=1\xdef\tmpres{\xinteval{\tmpres*##1}}\fi%
+ }%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \xdef\tmpres{\xintfloateval[\factochfsign]{\tmpres}}%
+ }%
+ {}%
+ \ensuremath{%
+ \ifboolKV[calcfactorielle]{Enonce}%
+ {%
+ \IfBooleanTF{#1}{#3\#}{\num{#3}\#}=
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Complet}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 2 \xintFor* ##1 in {\xintSeq{3}{#3}}\do{\pgfmathisprime{##1}\ifnum\pgfmathresult=1\times##1\fi} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{3}}\do{\pgfmathisprime{##1}\ifnum\pgfmathresult=1##1\times\fi} 2 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 2 \xintFor* ##1 in {\xintSeq{3}{#3}}\do{\pgfmathisprime{##1}\ifnum\pgfmathresult=1\times\num{##1}\fi} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{3}}\do{\pgfmathisprime{##1}\ifnum\pgfmathresult=1\num{##1}\times\fi} 2 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ }%
+ {}%
+ \IfBooleanTF{#1}%
+ {%
+ \tmpres%
+ }%
+ {%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \num[scientific-notation=true]{\tmpres}%
+ }%
+ {%
+ \num{\tmpres}%
+ }%
+ }%
+ }%
+}
+
+\NewDocumentCommand\DoubleFactorielle{ s O{} m }{%
+ \restoreKV[calcfactorielle]%
+ \setKV[calcfactorielle]{#2}%
+ \def\tmpres{1}%
+ \xintFor* ##1 in {\xintSeq{1}{#3}}\do{%
+ \xintifboolexpr{\xintiiOdd{#3} == \xintiiOdd{##1} 'or' \xintiiEven{#3} == \xintiiEven{##1}}%
+ {%
+ \xdef\tmpres{\xinteval{\tmpres*##1}}%
+ }%
+ {}%
+ }%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \xdef\tmpres{\xintfloateval[\factochfsign]{\tmpres}}%
+ }%
+ {}%
+ \ensuremath{%
+ \ifboolKV[calcfactorielle]{Enonce}%
+ {%
+ \IfBooleanTF{#1}{#3\useKV[calcfactorielle]{Espace}!!}{\num{#3}\useKV[calcfactorielle]{Espace}!!}=
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Complet}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ \xintifboolexpr{\xintiiOdd{#3} == 1}%
+ {%
+ 1 \xintFor* ##1 in {\xintSeq{3}{#3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} == 1}{\times##1}{}%
+ }%
+ }%
+ {%
+ 2 \xintFor* ##1 in {\xintSeq{3}{#3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} != 1}{\times##1}{}%
+ }%
+ }%
+ \ifboolKV[calcfactorielle]{Grand}{\approx}{=}%
+ }%
+ {%
+ \xintifboolexpr{\xintiiOdd{#3} == 1}%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} == 1}{##1\times}{}%
+ }1%
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} != 1}{##1\times}{}%
+ }2%
+ }%
+ \ifboolKV[calcfactorielle]{Grand}{\approx}{=}%
+ }%
+ }%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ \xintifboolexpr{\xintiiOdd{#3} == 1}%
+ {%
+ 1 \xintFor* ##1 in {\xintSeq{3}{#3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} == 1}{\times\num{##1}}{}%
+ }%
+ }%
+ {%
+ 2 \xintFor* ##1 in {\xintSeq{3}{#3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} != 1}{\times\num{##1}}{}%
+ }%
+ }%
+ \ifboolKV[calcfactorielle]{Grand}{\approx}{=}%
+ }%
+ {%
+ \xintifboolexpr{\xintiiOdd{#3} == 1}%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} == 1}{\num{##1}\times}{}%
+ }1%
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{3}}\do{%
+ \xintifboolexpr{\xintiiOdd{##1} != 1}{\num{##1}\times}{}%
+ }2%
+ }%
+ \ifboolKV[calcfactorielle]{Grand}{\approx}{=}%
+ }%
+ }%
+ }%
+ {}%
+ \IfBooleanTF{#1}%
+ {%
+ \tmpres%
+ }%
+ {%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \num[scientific-notation=true]{\tmpres}%
+ }%
+ {%
+ \num{\tmpres}%
+ }%
+ }%
+ }%
+}
+
+\NewDocumentCommand\HyperFactorielle{ s O{} m }{%
+ \restoreKV[calcfactorielle]%
+ \setKV[calcfactorielle]{#2}%
+ \def\tmpres{1}%
+ \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\xdef\tmpres{\xinteval{\tmpres*(##1)^(##1)}}}%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \xdef\tmpres{\xintfloateval[\factochfsign]{\tmpres}}%
+ }%
+ {}%
+ \ensuremath{%
+ \ifboolKV[calcfactorielle]{Enonce}%
+ {%
+ \IfBooleanTF{#1}{\text{H}(#3)}{\text{H}(\rm{#3})}=
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Partiel}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEqCase{\factochfsens}{%
+ {m}{1^1 \times 2^2 \times \ldots \times \xinteval{#3-1}^{\xinteval{#3-1}} \times #3^{#3} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ {d}{#3^{#3} \times \xinteval{#3-1}^{\xinteval{#3-1}} \times \ldots \times 2^2 \times 1^1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ }%
+ }%
+ {%
+ \IfStrEqCase{\factochfsens}{%
+ {m}{1 \times 2 \times \ldots \times \num{\xinteval{#3-1}}^{\num{\xinteval{#3-1}}} \times \num{#3}^{\num{#3}} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ {d}{\num{#3}^{\num{#3}} \times \num{\xinteval{#3-1}}^{\num{\xinteval{#3-1}}} \times \ldots \times 2^2 \times 1^1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ }%
+ }%
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Complet}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 1^1 \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\times ##1^{##1}} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{2}}\do{##1^{##1} \times} 1^1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 1^1 \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\times \num{##1}^{\num{##1}}} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{2}}\do{\num{##1}^{\num{##1}} \times} 1^1 \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ }%
+ {}%
+ \IfBooleanTF{#1}%
+ {%
+ \tmpres%
+ }%
+ {%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \num[scientific-notation=true]{\tmpres}%
+ }%
+ {%
+ \num{\tmpres}%
+ }%
+ }%
+ }%
+}
+
+\NewDocumentCommand\SuperFactorielle{ s O{} m }{%
+ \restoreKV[calcfactorielle]%
+ \setKV[calcfactorielle]{#2}%
+ \def\tmpres{1}%
+ \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\xdef\tmpres{\xinteval{\tmpres*factorial(##1)}}}%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \xdef\tmpres{\xintfloateval[\factochfsign]{\tmpres}}%
+ }%
+ {}%
+ \ensuremath{%
+ \ifboolKV[calcfactorielle]{Enonce}%
+ {%
+ \IfBooleanTF{#1}{\text{sf}(#3)}{\text{sf}(\num{#3})}=
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Partiel}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEqCase{\factochfsens}{%
+ {m}{1\useKV[calcfactorielle]{Espace}! \times 2\useKV[calcfactorielle]{Espace}! \times \ldots \times \xinteval{#3-1}\useKV[calcfactorielle]{Espace}! \times #3\useKV[calcfactorielle]{Espace}! \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ {d}{#3\useKV[calcfactorielle]{Espace}! \times \xinteval{#3-1}\useKV[calcfactorielle]{Espace}! \times \ldots \times 2\useKV[calcfactorielle]{Espace}! \times 1\useKV[calcfactorielle]{Espace}! \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ }%
+ }%
+ {%
+ \IfStrEqCase{\factochfsens}{%
+ {m}{1\useKV[calcfactorielle]{Espace}! \times 2\useKV[calcfactorielle]{Espace}! \times \ldots \times \num{\xinteval{#3-1}}\useKV[calcfactorielle]{Espace}! \times \num{#3}\useKV[calcfactorielle]{Espace}! \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ {d}{\num{#3}\useKV[calcfactorielle]{Espace}! \times \num{\xinteval{#3-1}}\useKV[calcfactorielle]{Espace}! \times \ldots \times 2\useKV[calcfactorielle]{Espace}! \times 1\useKV[calcfactorielle]{Espace}! \ifboolKV[calcfactorielle]{Grand}{\approx}{=}}%
+ }%
+ }%
+ }%
+ {}%
+ \ifboolKV[calcfactorielle]{Complet}%
+ {%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 1\useKV[calcfactorielle]{Espace}! \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\times ##1\useKV[calcfactorielle]{Espace}!} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{2}}\do{##1\useKV[calcfactorielle]{Espace}! \times} 1\useKV[calcfactorielle]{Espace}! \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ {%
+ \IfStrEq{\factochfsens}{m}%
+ {%
+ 1\useKV[calcfactorielle]{Espace}! \xintFor* ##1 in {\xintSeq{2}{#3}}\do{\times \num{##1}\useKV[calcfactorielle]{Espace}!} \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ {%
+ \xintFor* ##1 in {\xintSeq{#3}{2}}\do{\num{##1}\useKV[calcfactorielle]{Espace}! \times} 1\useKV[calcfactorielle]{Espace}! \ifboolKV[calcfactorielle]{Grand}{\approx}{=}
+ }%
+ }%
+ }%
+ {}%
+ \IfBooleanTF{#1}%
+ {%
+ \tmpres%
+ }%
+ {%
+ \ifboolKV[calcfactorielle]{Grand}%
+ {%
+ \num[scientific-notation=true]{\tmpres}%
+ }%
+ {%
+ \num{\tmpres}%
+ }%
+ }%
+ }%
+}
+
\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex
index 22775038e70..74a3e827ed2 100644
--- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex
+++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-graphiques.tex
@@ -36,7 +36,7 @@
}
\NewDocumentCommand\PtsDiscontinuite{ O{} m }{%
- \useKVdefault[ptdiscont]
+ \restoreKV[ptdiscont]
\setKV[ptdiscont]{#1}%
\setsepchar[.]{§./}%
\readlist*\SPLlisteDiscont{#2}%
@@ -101,7 +101,7 @@
%1=liste
%2=num point début
%3=num point fin
- \useKVdefault[genspline]%
+ \restoreKV[genspline]%
\setKV[genspline]{#1}%
\setsepchar[.]{§./}%
\readlist*\SPLlistepoints{#2}%
@@ -156,7 +156,7 @@
\NewDocumentCommand\SplineTikz{ O{} m }{%
%\newcommand\SplineTikz[2][]{%
- \useKVdefault[spline]
+ \restoreKV[spline]
\setKV[spline]{#1}% on paramètres les nouvelles clés et on les simplifie
%on lit la liste des points/nbderivés et on stocke dans \listepoints
\setsepchar[.]{§./}%
@@ -219,7 +219,7 @@
}
\newcommand\TangenteTikz[2][]{%
- \useKVdefault[tgte]%
+ \restoreKV[tgte]%
\setKV[tgte]{#1}% on paramètres les nouvelles clés et on les simplifie
\setsepchar[.]{§./}%
\readlist*\TGTlistepoints{#2}%
@@ -308,26 +308,36 @@
}
\DeclareDocumentCommand\AxexTikz{ O{} m }{%
- \useKVdefault[PLaxextkz]
+ \restoreKV[PLaxextkz]
\setKV[PLaxextkz]{#1}% on paramètres les nouvelles clés et on les simplifie
%récupération des tickwidth H/B
\IfSubStr{\axextickwidth}{/}
{\StrCut{\axextickwidth}{/}{\axextickwidthA}{\axextickwidthB}}
{\def\axextickwidthA{\axextickwidth}\def\axextickwidthB{\axextickwidth}}
+ %====test====
+ \IfEq{#2}{auto}%
+ {%
+ \xdef\tmprangexvalues{\xintfloateval{seq(i,i=\xmin..[\xgrille]..\xmax)}}\StrDel{\tmprangexvalues}{ }[\tmprangexvalues]%
+ \setKV[PLaxextkz]{Trigo=false}%
+ }%
+ {%
+ \xdef\tmprangexvalues{#2}%
+ }%
+ %====fintest=
%en fonction de Trigo ou non
\ifboolKV[PLaxextkz]{Trigo}
- {
- \foreach \x in {#2}{%
+ {%
+ \foreach \x in \tmprangexvalues {%
\draw[line width=\axexwidth] ({\x-\axexOx},{\axextickwidthA}) -- ({\x-\axexOx},{-\axextickwidthB})%
\ifboolKV[PLaxextkz]{AffGrad}%on affiche les graduations
{%
node[\axexposlabel,font=\axexfont] {\ifboolKV[PLaxextkz]{Dfrac}{$\AffAngleRadian*{\x}$}{$\AffAngleRadian{\x}$}}
}%
{}%
- ;}
- }
- {
- \foreach \x in {#2}{%
+ ;}%
+ }%
+ {%
+ \foreach \x in \tmprangexvalues {%
\draw[line width=\axexwidth] ({\x-\axexOx},{\axextickwidthA}) -- ({\x-\axexOx},{-\axextickwidthB})%
\ifboolKV[PLaxextkz]{AffGrad}%on affiche les graduations
{%
@@ -336,16 +346,16 @@
{\ifboolKV[PLaxextkz]{Annee}%
{\num[group-digits=none]{\x}}%
{\num[text-family-to-math=true,text-series-to-math=true]{\x}}%
- }
- }
+ }%
+ }%
{\xintifboolexpr{\x==\axexOx}{}{node[\axexposlabel,font=\axexfont] {\ifboolKV[PLaxextkz]{Annee}%
{\num[group-digits=none]{\x}}%
{\num[text-family-to-math=true,text-series-to-math=true]{\x}}%
- }
- }
- }
- }
- {}
+ }%
+ }%
+ }%
+ }%
+ {}%
;}
}
@@ -371,26 +381,36 @@
}
\DeclareDocumentCommand\AxeyTikz{ O{} m }{%
- \useKVdefault[PLaxeytkz]
+ \restoreKV[PLaxeytkz]
\setKV[PLaxeytkz]{#1}% on paramètres les nouvelles clés et on les simplifie
\IfSubStr{\axeytickwidth}{/}
- {\StrCut{\axeytickwidth}{/}{\axeytickwidthA}{\axeytickwidthB}}
- {\def\axeytickwidthA{\axeytickwidth}\def\axeytickwidthB{\axeytickwidth}}
+ {\StrCut{\axeytickwidth}{/}{\axeytickwidthA}{\axeytickwidthB}}
+ {\def\axeytickwidthA{\axeytickwidth}\def\axeytickwidthB{\axeytickwidth}}
+ %====test====
+ \IfEq{#2}{auto}%
+ {%
+ \xdef\tmprangeyvalues{\xintfloateval{seq(i,i=\ymin..[\ygrille]..\ymax)}}\StrDel{\tmprangeyvalues}{ }[\tmprangeyvalues]%
+ }%
+ {%
+ \xdef\tmprangeyvalues{#2}%
+ }%
+ %====fintest=
+
\ifboolKV[PLaxeytkz]{Frac}%
{%
\ifboolKV[PLaxeytkz]{AffGrad}%on affiche les graduations
{%
- \foreach \y in {#2}
+ \foreach \y in \tmprangeyvalues
{\draw[line width=\axeywidth] ({\axeytickwidthA},{\y-\axeyOy}) -- ({-\axeytickwidthB},{\y-\axeyOy}) %
\xintifboolexpr{\y==\axeyOy}{}{node[\axeyposlabel,font=\axeyfont] {\ConversionFraction{\y}}} ;}
}%
{%
- \foreach \y in {#2}
+ \foreach \y in \tmprangeyvalues
{\draw[line width=\axeywidth] ({\axeytickwidthA},{\y-\axeyOy}) -- ({-\axeytickwidthB},{\y-\axeyOy}) ;}
}%
}%
{%
- \foreach \y in {#2}{%
+ \foreach \y in \tmprangeyvalues {%
\draw[line width=\axeywidth] ({\axeytickwidthA},{\y-\axeyOy}) -- ({-\axeytickwidthB},{\y-\axeyOy})%
\ifboolKV[PLaxeytkz]{AffGrad}%on affiche les graduations
{%
@@ -414,6 +434,12 @@
}%
}
+%axesOxoy
+\DeclareDocumentCommand\AxexyTikz{ O{} O{} m m }{%
+ \AxexTikz[#1]{#3}
+ \AxeyTikz[#2]{#4}
+}
+
%axes
\defKV[PLaxestkz]{%
Epaisseur=\def\axeswidth{#1},%
@@ -444,7 +470,7 @@
}
\DeclareDocumentCommand\AxesTikz{ O{} }{%
- \useKVdefault[PLaxestkz]
+ \restoreKV[PLaxestkz]
\setKV[PLaxestkz]{#1}%
%les petits élargissements
\IfSubStr{\axeselargx}{/}
@@ -490,7 +516,7 @@
}
\DeclareDocumentCommand\OrigineTikz{ O{} }{%
- \useKVdefault[PLaxesorig]%
+ \restoreKV[PLaxesorig]%
\setKV[PLaxesorig]{#1}%
\draw (0,0) node[\axesorpos=\axesordecal,font=\axesorfont] {\axesorval} ;
}
@@ -498,11 +524,12 @@
%grilles
\setKVdefault[PLgrillestkz]{%
Affp=true,%
- Affs=true
+ Affs=true,%
+ Dernier=false
}
\DeclareDocumentCommand\GrilleTikz{ O{} O{thin,lightgray} O{ultra thin,lightgray} }{%
- \useKVdefault[PLgrillestkz]
+ \restoreKV[PLgrillestkz]
\setKV[PLgrillestkz]{#1}%
\ifboolKV[PLgrillestkz]{Affs}
{\draw[xstep=\xgrilles,ystep=\ygrilles,#3] ({\xmin-\axexOx},{\ymin-\axeyOy}) grid ({\xmax-\axexOx},{\ymax-\axeyOy});}
@@ -510,6 +537,12 @@
\ifboolKV[PLgrillestkz]{Affp}
{\draw[xstep=\xgrille,ystep=\ygrille,#2] ({\xmin-\axexOx},{\ymin-\axeyOy}) grid ({\xmax-\axexOx},{\ymax-\axeyOy});}
{}
+ \ifboolKV[PLgrillestkz]{Dernier}
+ {%
+ \draw[#2] ({\xmin-\axexOx},{\ymax-\axeyOy}) -- ({\xmax-\axexOx},{\ymax-\axeyOy});%
+ \draw[#2] ({\xmax-\axexOx},{\ymin-\axeyOy}) -- ({\xmax-\axexOx},{\ymax-\axeyOy});%
+ }
+ {}
}
%point(s) avec changement origines
@@ -526,7 +559,7 @@
}
\newcommand\PLnuagepoints[2][]{%
- \useKVdefault[PLpts]
+ \restoreKV[PLpts]
\setKV[PLpts]{#1}%
\setsepchar{§}%
\readlist\listepointsaffiches{#2}
@@ -546,7 +579,7 @@
}
\newcommand\NuagePointsTikz[3][]{%
- \useKVdefault[PLpts]
+ \restoreKV[PLpts]
\setKV[PLpts]{#1}% on paramètres les nouvelles clés et on les simplifie
\def\xliste{#2}
\def\yliste{#3}
@@ -597,7 +630,7 @@
}
\newcommand\PointMoyenTikz[1][]{%
- \useKVdefault[PLptmoy]
+ \restoreKV[PLptmoy]
\setKV[PLptmoy]{#1}% on paramètres les nouvelles clés et on les simplifie
\IfStrEq{\ptmoystyle}{o}%
{
@@ -648,7 +681,7 @@
}
\DeclareDocumentCommand\FenetreSimpleTikz{ O{} D(){} D<>{} m D<>{} m }{%
- \useKVdefault[PLsimplewindow]%
+ \restoreKV[PLsimplewindow]%
\setKV[PLsimplewindow]{#1}% on paramètres les nouvelles clés et on les simplifie
\ifboolKV[PLsimplewindow]{Grille}%
{\GrilleTikz}%
@@ -664,6 +697,10 @@
\tikzset{declare function={#1(\x)=#2;}}
}
+\NewDocumentCommand\DeclareFonctionTikzXint{ O{f} m }{%nom_fonction+langage xint
+ \xintdeffloatfunc #1(x) := #2 ;%
+}
+
%====INTERVALLES TIKZ
\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing}
@@ -821,4 +858,92 @@
\end{scope}%
}
+%====Intégrale TikZ
+\defKV[IntegrDomainTikz]{%
+ Epaisseur=\def\intgdomtikzthick{#1},%
+ Couleurs=\def\intgdomtikzcolors{#1},%
+ Style=\def\intgdomtikzstyle{#1},%
+ Opacite=\def\intgdomtikzopac{#1},%
+ Samples=\def\intgdomtikzsamples{#1},%
+ Hachures=\def\intgdomtikzhatch{#1},%
+ Type=\def\intgdomtikztype{#1},%
+ Pas=\def\intgdomtikzstep{#1},%
+ Jonction=\def\intgdomtikzjoin{#1}
+}
+\setKVdefault[IntegrDomainTikz]{%
+ Epaisseur=1pt,%
+ Couleurs={gray/teal},%
+ Style=remplissage,%
+ Opacite=0.5,%
+ Samples=250,%
+ Hachures={north west lines},%
+ Type=dessous,%
+ Pas=0.1,%
+ Jonction=bevel
+}
+
+\NewDocumentCommand\IntegraleTikz{ O{} D<>{} m O{0} m m }{%
+ %1 = clés
+ %2 = options particulières tikz
+ %3 = fonction, en tikz
+ %4 = fonction n°2 éventuelle
+ %de #5 à #6
+ \restoreKV[IntegrDomainTikz]% revenir au valeurs par défaut
+ \setKV[IntegrDomainTikz]{#1}% lit les arguments optionnels
+ \StrCut{\intgdomtikzcolors}{/}{\intgcolbord}{\intcolhach}%
+ \IfStrEq{\intgcolbord}{}{\xdef\intgcolbord{none}}{}%
+ \IfStrEq{\intgdomtikzstyle}{hachures}%
+ {%
+ \tikzset{integraletikzstyle/.style={line width=\intgdomtikzthick,draw=\intgcolbord,pattern=\intgdomtikzhatch,pattern color=\intcolhach,line join=\intgdomtikzjoin}}
+ }%
+ {}%
+ \IfStrEq{\intgdomtikzstyle}{remplissage}%
+ {%
+ \tikzset{integraletikzstyle/.style={line width=\intgdomtikzthick,draw=\intgcolbord,fill=\intcolhach,fill opacity=\intgdomtikzopac,line join=\intgdomtikzjoin}}
+ }%
+ {}%
+ \IfStrEq{\intgdomtikztype}{dessous}%
+ {%
+ \draw[integraletikzstyle,#2] (#5,0) -- plot[samples=\intgdomtikzsamples,domain=#5:#6] (\x,{#3}) --(#6,0) -- cycle ;
+ }%
+ {}%
+ \IfStrEq{\intgdomtikztype}{entre}%
+ {%
+ \draw[integraletikzstyle,#2] plot[samples=\intgdomtikzsamples,domain=#5:#6] (\x,{#3}) -- plot[samples=\intgdomtikzsamples,domain=#6:#5] (\x,{#4}) -- cycle ;
+ }%
+ {}%
+}
+
+\NewDocumentCommand\IntegraleTikzXint{ O{} D<>{} m O{0} m m }{%
+ %1 = clés
+ %2 = options particulières tikz
+ %3 = fonction, en tikz
+ %4 = fonction n°2 éventuelle
+ %de #5 à #6
+ \restoreKV[IntegrDomainTikz]% revenir au valeurs par défaut
+ \setKV[IntegrDomainTikz]{#1}% lit les arguments optionnels
+ \StrCut{\intgdomtikzcolors}{/}{\intgcolbord}{\intcolhach}%
+ \IfStrEq{\intgcolbord}{}{\xdef\intgcolbord{none}}{}%
+ \IfStrEq{\intgdomtikzstyle}{hachures}%
+ {%
+ \tikzset{integraletikzstyle/.style={line width=\intgdomtikzthick,draw=\intgcolbord,pattern=\intgdomtikzhatch,pattern color=\intcolhach,line join=\intgdomtikzjoin}}
+ }%
+ {}%
+ \IfStrEq{\intgdomtikzstyle}{remplissage}%
+ {%
+ \tikzset{integraletikzstyle/.style={line width=\intgdomtikzthick,draw=\intgcolbord,fill=\intcolhach,fill opacity=\intgdomtikzopac,line join=\intgdomtikzjoin}}
+ }%
+ {}%
+ \IfStrEq{\intgdomtikztype}{dessous}%
+ {%
+ \draw[integraletikzstyle,#2] (#5,0) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=#5..[\intgdomtikzstep]..#6)\relax} -- (#6,0) -- cycle ;
+ }%
+ {}%
+ \IfStrEq{\intgdomtikztype}{entre}%
+ {%
+ \draw[integraletikzstyle,#2] plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=#5..[\intgdomtikzstep]..#6)\relax} -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=#6..[-\intgdomtikzstep]..#5)\relax} -- cycle ;
+ }%
+ {}%
+}
+
\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-probas.tex b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-probas.tex
index e817af767ea..92cff337721 100644
--- a/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-probas.tex
+++ b/Master/texmf-dist/tex/latex/proflycee/proflycee-tools-probas.tex
@@ -1041,4 +1041,187 @@
}%
}
+%===BINOMIALE
+\defKV[HistoBinom]{%
+ Largeur=\def\GraphBinomLarg{#1},%
+ Hauteur=\def\GraphBinomHaut{#1},%
+ PasX=\def\GraphBinomPasX{#1},%
+ PasY=\def\GraphBinomPasY{#1},%
+ Plage=\def\GraphBinomPlage{#1},%
+ CouleurPlage=\def\GraphBimomColPlage{#1},%
+ Epaisseur=\def\GraphBinomThick{#1},%
+ ClipX=\def\GraphBinomXminmax{#1},%
+ Police=\def\GraphBinomFonte{#1},%
+ CouleurNormale=\def\GraphBinomColNorm{#1}
+}
+\setKVdefault[HistoBinom]{%
+ Largeur=10,%
+ Hauteur=5,%
+ PasX=5,%
+ PasY=0.01,%
+ Plage={},%
+ CouleurPlage=teal!50,%
+ Epaisseur=0.8pt,
+ ClipX={},%
+ Police=\normalfont\normalsize,%
+ AffNormale=false,%
+ CouleurNormale=red
+}
+
+\NewDocumentCommand\HistogrammeBinomiale{ O{} D<>{} m m }{%
+ \restoreKV[HistoBinom]%
+ \setKV[HistoBinom]{#1}
+ \def\GraphBinomN{#3}%
+ \def\GraphBinomP{#4}%
+ \IfStrEq{\GraphBinomXminmax}{}%
+ {%
+ \xdef\GraphBinomXmin{0}%
+ \xdef\GraphBinomXmax{\GraphBinomN}%
+ }%
+ {%
+ \StrCut{\GraphBinomXminmax}{-}{\GraphBinomXmin}{\GraphBinomXmax}%
+ \IfStrEq{\GraphBinomXmin}{*}{\xdef\GraphBinomXmin{0}}{}%
+ \IfStrEq{\GraphBinomXmax}{*}{\xdef\GraphBinomXmax{\GraphBinomN}}{}%
+ }%
+ \IfStrEq{\GraphBinomPlage}{}%
+ {}%
+ {%
+ \StrCut{\GraphBinomPlage}{-}{\GraphBinomColorMin}{\GraphBinomColorMax}%
+ \IfStrEq{\GraphBinomColorMin}{*}{\xdef\GraphBinomColorMin{\GraphBinomXmin}}{}%
+ \IfStrEq{\GraphBinomColorMax}{*}{\xdef\GraphBinomColorMax{\GraphBinomXmax}}{}%
+ }%
+ %test d'unités
+ \xdef\GraphBinomXunit{\xintfloateval{round((\GraphBinomLarg)/(\GraphBinomXmax-\GraphBinomXmin+1),3)}}%
+ \xdef\grphbinommedA{\xintfloateval{trunc(\GraphBinomN*\GraphBinomP,0)}}%
+ \xdef\grphbinommedB{\xintfloateval{\grphbinommedA+1}}%
+ \xdef\GraphBinomYmaxA{\xintfloateval{binomial(\GraphBinomN,\grphbinommedA)*(\GraphBinomP)^(\grphbinommedA)*(1-(\GraphBinomP))^((\GraphBinomN)-(\grphbinommedA))}}%
+ \xdef\GraphBinomYmaxB{\xintfloateval{binomial(\GraphBinomN,\grphbinommedB)*(\GraphBinomP)^(\grphbinommedB)*(1-(\GraphBinomP))^((\GraphBinomN)-(\grphbinommedB))}}%
+ \xdef\GraphBinomMaxY{\xintfloateval{1.1*max(\GraphBinomYmaxA,\GraphBinomYmaxB)}}%
+ \xdef\GraphBinomNbPrecision{\xinteval{abs(ilog10(\GraphBinomMaxY))+1}}%
+ \xdef\GraphBinomYunit{\xintfloateval{round((\GraphBinomHaut)/(max(\GraphBinomYmaxA,\GraphBinomYmaxB)),3)}}%
+ \begin{tikzpicture}[x=\GraphBinomXunit cm,y=\GraphBinomYunit cm,#2]
+ %coloriage éventuel
+ \IfStrEq{\GraphBinomPlage}{}%
+ {}%
+ {%
+ \xintFor* ##1 in {\xintSeq{\GraphBinomColorMin}{\GraphBinomColorMax}}\do{%
+ \xdef\tmpYYY{\xintfloateval{binomial(\GraphBinomN,##1)*(\GraphBinomP)^(##1)*(1-(\GraphBinomP))^((\GraphBinomN)-(##1))}}%
+ \draw[draw=none,fill=\GraphBimomColPlage,fill opacity=0.5] ({##1-0.5},0) rectangle++ (1,{\tmpYYY}) ;
+ }%
+ }%
+ %axes
+ \draw[line width=\GraphBinomThick,->,>=latex] ({\GraphBinomXmin-0.5},0)--({\GraphBinomXmax+1},0) ;
+ \draw[line width=\GraphBinomThick,->,>=latex] ({\GraphBinomXmin-0.5},0)--({\GraphBinomXmin-0.5},{1.1*(\GraphBinomHaut)/(\GraphBinomYunit)}) ;
+ \foreach \x in {\GraphBinomXmin,\inteval{\GraphBinomXmin+\GraphBinomPasX},...,\GraphBinomXmax}{%
+ \draw[line width=\GraphBinomThick] (\x,2pt)--++(0,-4pt) node[below,font=\GraphBinomFonte] {\num{\x}} ;
+ }%
+ \xdef\GraphBinomNbPrecisionAxeY{\xinteval{abs(ilog10(\GraphBinomPasY))+1}}%
+ \foreach \y in {0,\GraphBinomPasY,...,\GraphBinomMaxY}{%
+ \draw[line width=\GraphBinomThick] ($({\GraphBinomXmin-0.5},\y)+(2pt,0)$)--++(-4pt,0) node[left,font=\GraphBinomFonte] {\num{\xintfloateval{round(\y,\GraphBinomNbPrecisionAxeY)}}} ;
+ }%
+ %tracé
+ \xintFor* ##1 in {\xintSeq{\GraphBinomXmin}{\GraphBinomXmax}}\do{%
+ \xdef\tmpYYY{\xintfloateval{binomial(\GraphBinomN,##1)*(\GraphBinomP)^(##1)*(1-(\GraphBinomP))^((\GraphBinomN)-(##1))}}%
+ \draw[line width=\GraphBinomThick] ({##1-0.5},0) rectangle++ (1,{\tmpYYY}) ;
+ }
+ \ifboolKV[HistoBinom]{AffNormale}%
+ {%
+ \xdef\MinNormHistoBinom{\xintfloateval{{\GraphBinomXmin-0.5}}}%
+ \xdef\MaxNormHistoBinom{\xintfloateval{{\GraphBinomXmax+0.5}}}%
+ \TraceLoiNormale*[line width={1.25*\GraphBinomThick},\GraphBinomColNorm]<\MinNormHistoBinom..[0.1]..\MaxNormHistoBinom>{#3}{#4}
+ }%
+ {}%
+ \end{tikzpicture}
+}
+
+\NewDocumentEnvironment{HistoBinomiale}{ O{} D<>{} m m }%
+{%
+ \restoreKV[HistoBinom]%
+ \setKV[HistoBinom]{#1}
+ \def\GraphBinomN{#3}%
+ \def\GraphBinomP{#4}%
+ \IfStrEq{\GraphBinomXminmax}{}%
+ {%
+ \xdef\GraphBinomXmin{0}%
+ \xdef\GraphBinomXmax{\GraphBinomN}%
+ }%
+ {%
+ \StrCut{\GraphBinomXminmax}{-}{\GraphBinomXmin}{\GraphBinomXmax}%
+ \IfStrEq{\GraphBinomXmin}{*}{\xdef\GraphBinomXmin{0}}{}%
+ \IfStrEq{\GraphBinomXmax}{*}{\xdef\GraphBinomXmax{\GraphBinomN}}{}%
+ }%
+ \IfStrEq{\GraphBinomPlage}{}%
+ {}%
+ {%
+ \StrCut{\GraphBinomPlage}{-}{\GraphBinomColorMin}{\GraphBinomColorMax}%
+ \IfStrEq{\GraphBinomColorMin}{*}{\xdef\GraphBinomColorMin{\GraphBinomXmin}}{}%
+ \IfStrEq{\GraphBinomColorMax}{*}{\xdef\GraphBinomColorMax{\GraphBinomXmax}}{}%
+ }%
+ %test d'unités
+ \xdef\GraphBinomXunit{\xintfloateval{round((\GraphBinomLarg)/(\GraphBinomXmax-\GraphBinomXmin+1),3)}}%
+ \xdef\grphbinommedA{\xintfloateval{trunc(\GraphBinomN*\GraphBinomP,0)}}%
+ \xdef\grphbinommedB{\xintfloateval{\grphbinommedA+1}}%
+ \xdef\GraphBinomYmaxA{\xintfloateval{binomial(\GraphBinomN,\grphbinommedA)*(\GraphBinomP)^(\grphbinommedA)*(1-(\GraphBinomP))^((\GraphBinomN)-(\grphbinommedA))}}%
+ \xdef\GraphBinomYmaxB{\xintfloateval{binomial(\GraphBinomN,\grphbinommedB)*(\GraphBinomP)^(\grphbinommedB)*(1-(\GraphBinomP))^((\GraphBinomN)-(\grphbinommedB))}}%
+ \xdef\GraphBinomMaxY{\xintfloateval{1.1*max(\GraphBinomYmaxA,\GraphBinomYmaxB)}}%
+ \xdef\GraphBinomNbPrecision{\xinteval{abs(ilog10(\GraphBinomMaxY))+1}}%
+ \xdef\GraphBinomYunit{\xintfloateval{round((\GraphBinomHaut)/(max(\GraphBinomYmaxA,\GraphBinomYmaxB)),3)}}%
+ \begin{tikzpicture}[x=\GraphBinomXunit cm,y=\GraphBinomYunit cm,#2]
+ %coloriage éventuel
+ \IfStrEq{\GraphBinomPlage}{}%
+ {}%
+ {%
+ \xintFor* ##1 in {\xintSeq{\GraphBinomColorMin}{\GraphBinomColorMax}}\do{%
+ \xdef\tmpYYY{\xintfloateval{binomial(\GraphBinomN,##1)*(\GraphBinomP)^(##1)*(1-(\GraphBinomP))^((\GraphBinomN)-(##1))}}%
+ \draw[draw=none,fill=\GraphBimomColPlage,fill opacity=0.5] ({##1-0.5},0) rectangle++ (1,{\tmpYYY}) ;
+ }%
+ }%
+ %axes
+ \draw[line width=\GraphBinomThick,->,>=latex] ({\GraphBinomXmin-0.5},0)--({\GraphBinomXmax+1},0) ;
+ \draw[line width=\GraphBinomThick,->,>=latex] ({\GraphBinomXmin-0.5},0)--({\GraphBinomXmin-0.5},{1.1*(\GraphBinomHaut)/(\GraphBinomYunit)}) ;
+ \foreach \x in {\GraphBinomXmin,\inteval{\GraphBinomXmin+\GraphBinomPasX},...,\GraphBinomXmax}{%
+ \draw[line width=\GraphBinomThick] (\x,2pt)--++(0,-4pt) node[below,font=\GraphBinomFonte] {\num{\x}} ;
+ }%
+ \xdef\GraphBinomNbPrecisionAxeY{\xinteval{abs(ilog10(\GraphBinomPasY))+1}}%
+ \foreach \y in {0,\GraphBinomPasY,...,\GraphBinomMaxY}{%
+ \draw[line width=\GraphBinomThick] ($({\GraphBinomXmin-0.5},\y)+(2pt,0)$)--++(-4pt,0) node[left,font=\GraphBinomFonte] {\num{\xintfloateval{round(\y,\GraphBinomNbPrecisionAxeY)}}} ;
+ }%
+ %tracé
+ \xintFor* ##1 in {\xintSeq{\GraphBinomXmin}{\GraphBinomXmax}}\do{%
+ \xdef\tmpYYY{\xintfloateval{binomial(\GraphBinomN,##1)*(\GraphBinomP)^(##1)*(1-(\GraphBinomP))^((\GraphBinomN)-(##1))}}%
+ \draw[line width=\GraphBinomThick] ({##1-0.5},0) rectangle++ (1,{\tmpYYY}) ;
+ }
+ %loi normale ?
+ \ifboolKV[HistoBinom]{AffNormale}%
+ {%
+ \xdef\MinNormHistoBinom{\xintfloateval{{\GraphBinomXmin-0.5}}}%
+ \xdef\MaxNormHistoBinom{\xintfloateval{{\GraphBinomXmax+0.5}}}%
+ \TraceLoiNormale*[line width={1.25*\GraphBinomThick},\GraphBinomColNorm]<\MinNormHistoBinom..[0.1]..\MaxNormHistoBinom>{#3}{#4}
+ }%
+ {}%
+ }%
+ {%
+ \end{tikzpicture}
+}
+
+\xintdeffloatfunc fctreploinorm(x,mu,sigma):=1/(sigma*sqrt(2*Pi))*exp(-1/2*((x-mu)/sigma)^2);
+
+\NewDocumentCommand\TraceLoiNormale{ s O{} D<>{} m m }{%
+ \IfBooleanTF{#1}%
+ {%
+ \draw[#2] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,fctreploinorm(x,#4*#5,sqrt(#4*#5*(1-#5)))),x=#3)
+ \relax
+ };
+ }%
+ {%
+ \draw[#2] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,fctreploinorm(x,#4,#5)),x=#3)
+ \relax
+ };
+ }%
+}
+
\endinput \ No newline at end of file