From dc2e3de3e66d27b63432c7125f94bfaa0cf1824d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 13 May 2023 20:29:20 +0000 Subject: profcollege (13may23) git-svn-id: svn://tug.org/texlive/trunk@67096 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/profcollege/ProfCollege-doc.pdf | Bin 9283470 -> 9127255 bytes .../doc/latex/profcollege/ProfCollege-doc.zip | Bin 2338341 -> 2342255 bytes .../metapost/profcollege/PfCGeometrie.mp | 21 +- Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex | 7 +- .../tex/latex/profcollege/PfCCartesJeux.tex | 16 +- .../texmf-dist/tex/latex/profcollege/PfCDobble.tex | 27 ++ .../tex/latex/profcollege/PfCEcritureUnites.tex | 40 +- .../tex/latex/profcollege/PfCErathostene.tex | 80 ++++ .../tex/latex/profcollege/PfCNotionFonction.tex | 6 + .../tex/latex/profcollege/PfCProbabilites.tex | 2 + .../tex/latex/profcollege/PfCPythagore.tex | 155 ++++--- .../tex/latex/profcollege/PfCPythagoreold.tex | 516 --------------------- .../tex/latex/profcollege/PfCReperage.tex | 2 +- .../tex/latex/profcollege/PfCSquaroaprioriold.tex | 107 ----- .../tex/latex/profcollege/PfCStatistiques.tex | 56 ++- .../tex/latex/profcollege/PfCTrigonometrie.tex | 6 +- .../tex/latex/profcollege/ProfCollege.sty | 22 +- .../texmf-dist/tex/latex/profcollege/dobblePfC.lua | 82 ++++ 18 files changed, 425 insertions(+), 720 deletions(-) create mode 100644 Master/texmf-dist/tex/latex/profcollege/PfCDobble.tex create mode 100644 Master/texmf-dist/tex/latex/profcollege/PfCErathostene.tex delete mode 100644 Master/texmf-dist/tex/latex/profcollege/PfCPythagoreold.tex delete mode 100644 Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex create mode 100644 Master/texmf-dist/tex/latex/profcollege/dobblePfC.lua diff --git a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf index b4144010b66..f0a1742b381 100644 Binary files a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf and b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip index 1f37a1c7b67..32c8669e5bc 100644 Binary files a/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip and b/Master/texmf-dist/doc/latex/profcollege/ProfCollege-doc.zip differ diff --git a/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp b/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp index e19152c695d..52869904afa 100644 --- a/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp +++ b/Master/texmf-dist/metapost/profcollege/PfCGeometrie.mp @@ -180,7 +180,22 @@ vardef cercles(text t)= _T[n]:=p_; fi; endfor; - if typetrace="3D":%centre aa passant par bb dans le plan (ccddee) généralement aa=cc + if typetrace="mainlevee": + path Cer; + path dep; + pair ct; + if n=1 : dep=fullcircle scaled (2*rayon) shifted _t[1]; + ct=_t[1]; + elseif n=2 : dep=fullcircle scaled (2*abs(_t[1]-_t[2])) shifted _t[1]; + ct=_t[1]; + elseif n=3 : + dep=fullcircle scaled (2*abs(CentreCercleC(_t[1],_t[2],_t[3])-_t[1])) shifted CentreCercleC(_t[1],_t[2],_t[3]); + ct=CentreCercleC(_t[1],_t[2],_t[3]); + fi + path ess; + ess=pointarc(dep,0){dir(80+uniformdeviate(5))}..pointarc(dep,90){dir(170+uniformdeviate(20))}..pointarc(dep,90){dir(185+uniformdeviate(5))}..pointarc(dep,180){dir(-80-uniformdeviate(20))}..pointarc(dep,180){dir(-100+uniformdeviate(20))}..pointarc(dep,270){dir(-10+uniformdeviate(20))}..pointarc(dep,270){dir(uniformdeviate(10))}..pointarc(dep,360){dir(80+uniformdeviate(20))}; + Cer=ess; + elseif typetrace="3D":%centre aa passant par bb dans le plan (ccddee) généralement aa=cc path Cer; color ptcer[]; for k=0 step 5 until 360 : @@ -1559,7 +1574,7 @@ vardef axes= axx=image( drawarrow (x.so*cm,y.origine)--(x.ne*cm,y.origine); drawarrow (x.origine,y.so*cm)--(x.origine,y.ne*cm); - label.llft(LATEX($O$),z.origine); +% label.llft(TEX("$O$"),z.origine); ); axx enddef; @@ -1607,7 +1622,7 @@ def replace= xscaled (1/x.u) yscaled (1/y.u) shifted (-z.origine) enddef; -def retrouvecoord(expr p)=%trasnforme les coordonées du point d'affixe p dans le repère absolu de metapost en les coordonnées du point dans le repère défini par l'utilisateur +def retrouvecoord(expr p)=%transforme les coordonées du point d'affixe p dans le repère absolu de metapost en les coordonnées du point dans le repère défini par l'utilisateur p replace enddef; diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex b/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex index ca1ed485c39..9e4b195e48f 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCCAN.tex @@ -240,6 +240,9 @@ \makeatother +\newcommand\PfCJury{Jury}% +\newcommand\PfCEnonce{Énoncé}% +\newcommand\PfCReponse{Reponse}% \newcommand\CNTheme[1]{}% \newcommand\CNReponse{}% @@ -302,7 +305,7 @@ \renewcommand{\arraystretch}{\useKV[ClesCN]{Stretch}}% \begin{longtable}{|c|p{\PfCLargeurQuestion}|>{\centering\arraybackslash}p{\PfCLargeurReponse}|p{\PfCLargeurJury}|}% \hhline{~---}% - \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\'Enoncé&\cellcolor{gray!15}\centering Réponse&\cellcolor{gray!15}\centering\arraybackslash Jury\\% + \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\PfCEnonce&\cellcolor{gray!15}\centering\PfCReponse&\cellcolor{gray!15}\centering\arraybackslash\PfCJury\\% \hline% \endhead% \xintFor* ##1 in {\xintSeq{1}{\ListeFichierslen}}\do{% @@ -328,7 +331,7 @@ \renewcommand{\arraystretch}{\useKV[ClesCN]{Stretch}}% \begin{longtable}{|c|p{\PfCLargeurQuestion}|>{\centering\arraybackslash}p{\PfCLargeurReponse}|p{\PfCLargeurJury}|}% \hhline{~---}% - \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\'Enoncé&\cellcolor{gray!15}\centering Réponse&\cellcolor{gray!15}\centering\arraybackslash Jury\\% + \multicolumn{1}{c|}{}&\cellcolor{gray!15}\centering\PfCEnonce&\cellcolor{gray!15}\centering\PfCReponse&\cellcolor{gray!15}\centering\arraybackslash\PfCJury\\% \hline% \endhead% \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesCN]{NbQ}}}\do{% diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex b/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex index 88b2e3a57b3..69f35b0424e 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCCartesJeux.tex @@ -1,6 +1,15 @@ %%% % Cards %%% +\setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de + Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false,% + % Pour la boite + NbCartes=16,TypeJeu=Loop,Niveau=1,Numero=1,ThemeJeu=Nombres relatifs,Commerce=false, + % Pour le trivial + Trivial=false,Symboles={\faInfinity,\faSignal,\faProjectDiagram,\faHiking,\faRuler,\faLockOpen} +}% +\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}} +% \newtcolorbox{Mybox}[3]{% enhanced,% nobeforeafter,% @@ -330,13 +339,6 @@ \end{tikzpicture}% }{}% -\setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Th\'eor\`eme\\de - Pythagore,ThemeSol=Solution,AfficheTheme=false,Trame=false,Jointes=false,TrameVisible=false,RayonArc=5pt,Titre=false,NomTitre=Jeu 1,Loop,JaiQuia=false,Eleve=false,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg,AffichageSolution=true,SolutionSeule=false,% - % Pour le trivial - Trivial=false,Symboles={\faInfinity,\faSignal,\faProjectDiagram,\faHiking,\faRuler,\faLockOpen} -}% -\defKV[Cards]{ThemeJaiQuiA=\setKV[Cards]{AfficheTheme}} -% \NewDocumentCommand\Cartes{o +m}{%[2][]{% \useKVdefault[Cards]% \setKV[Cards]{#1}% diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCDobble.tex b/Master/texmf-dist/tex/latex/profcollege/PfCDobble.tex new file mode 100644 index 00000000000..e330d761aaa --- /dev/null +++ b/Master/texmf-dist/tex/latex/profcollege/PfCDobble.tex @@ -0,0 +1,27 @@ +%%% +% dobble +%%% +% by Maxime Chupin + +\NewDocumentCommand\dobble{m}{% + \directlua{ + require('dobblePfC.lua') + dobble("#1"); + }% +}% + +\setKVdefault[ClesDobble]{Niveau=5,CouleurCadre=black,Cercle=false} + +\NewDocumentCommand\Dobble{o m}{% + \useKVdefault[ClesDobble]% + \setKV[ClesDobble]{#1}% + \colorlet{PfCDobbleColor}{\useKV[ClesDobble]{CouleurCadre}}% + \setsepchar{,}% + \readlist*\PfCListeSymboleDobble{#2}% + \def\PfCDobbleTotalSymboles{\fpeval{1+\useKV[ClesDobble]{Niveau}+\useKV[ClesDobble]{Niveau}^2}}% + \xdef\PfCDobbleNiveau{\useKV[ClesDobble]{Niveau}}% + \xintifboolexpr{\PfCListeSymboleDobblelen==\PfCDobbleTotalSymboles}{% + \dobble{\PfCDobbleNiveau}% + }{% + Pour un dooble basé sur le nombre premier \useKV[ClesDobble]{Niveau}, le nombre de symboles doit être égal à \num{\PfCDobbleTotalSymboles}.}% +}% \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex b/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex index 81a1b3003f0..d532e10b2f3 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCEcritureUnites.tex @@ -1,8 +1,8 @@ %%% % Ecritures d'unit\'es %%% -\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre} -\defKV[Unites]{Dots=\setKV[Unites]{Nombre=false}} +\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,mmin=false,kmh=true,kms=false,ms=false,mh=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false,Nombre,US=false,UK=false}% +\defKV[Unites]{Dots=\setKV[Unites]{Nombre=false}}% \newlength{\PfCLgUnites} @@ -109,7 +109,7 @@ }{% \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}% \pointilles[\PfCLgUnites]\,\si{\Tempo}% - }% + }% }% \NewDocumentCommand\Conso{o m}{% @@ -128,14 +128,38 @@ % \SI[round-mode=places,round-precision=#1]{#2}{\EuRo}% %} -\NewDocumentCommand\Prix{o O{2} m}{% +%\NewDocumentCommand\Prix{o O{2} m}{% +% \useKVdefault[Unites]% +% \setKV[Unites]{#1}% +% \ifboolKV[Unites]{Nombre}{% +% \SI[round-mode=places,round-precision=#2]{#3}{\EuRo}% +% }{% +% \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}} +% \pointilles[\PfCLgUnites]\,\si{\EuRo}% +% }% +%}% + +\NewDocumentCommand\Prix{o m}{% \useKVdefault[Unites]% \setKV[Unites]{#1}% + \ifboolKV[Unites]{US}{% + \DeclareSIUnit{\Tempo}{\Dollar}% + }{% + \ifboolKV[Unites]{UK}{% + \DeclareSIUnit{\Tempo}{\LivreSterling}% + }{% + \DeclareSIUnit{\Tempo}{\EuRo}% + }% + }% \ifboolKV[Unites]{Nombre}{% - \SI[round-mode=places,round-precision=#2]{#3}{\EuRo}% + \IfInteger{#2}{% + \SI{#2}{\Tempo}% + }{% + \SI[round-mode=places,round-precision=2]{#2}{\Tempo}% + }% }{% - \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}} - \pointilles[\PfCLgUnites]\,\si{\EuRo}% + \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}% + \pointilles[\PfCLgUnites]\,\si{\Tempo}% }% }% @@ -208,7 +232,7 @@ }{% \setlength{\PfCLgUnites}{\useKV[Unites]{Dots}}% \pointilles[\PfCLgUnites]\,\si{\Tempo}% - }% + }% }% \NewDocumentCommand\Masse{o m}{% diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCErathostene.tex b/Master/texmf-dist/tex/latex/profcollege/PfCErathostene.tex new file mode 100644 index 00000000000..983770d0f98 --- /dev/null +++ b/Master/texmf-dist/tex/latex/profcollege/PfCErathostene.tex @@ -0,0 +1,80 @@ +\setKVdefault[ClesEra]{Premier=false,Nombre=1,CouleurP=Cornsilk!50,CouleurNP=Crimson!15,Colonnes=10,Lignes=10,Hauteur=24pt} + +\NewDocumentCommand\TestPremier{m}{% + % #1 le nombre premier \`a tester + \newcount\anp\newcount\bnp\newcount\cnp% + \anp=#1\relax + \bnp=2\relax + \premier=-1\relax + % Pour d\'eterminer le nombre d'\'etapes + \whiledo{\anp > 1}{% + \modulo{\the\anp}{\the\bnp} + \ifnum\remainder=0\relax + \global\premier=\numexpr\premier+1\relax + \cnp=\numexpr\anp/\bnp\relax + \anp=\cnp\relax + \else% + \bnp=\numexpr\bnp+1\relax% + \fi% + }% + \ifnum\premier=0% + \setKV[ClesEra]{Premier=true}% + \else + \setKV[ClesEra]{Premier=false}% + \fi% +}% + +\newlength{\PfCEraHauteur} + +\NewDocumentCommand\Erathostene{o}{% + \useKVdefault[ClesEra] + \setKV[ClesEra]{#1} + \setlength{\PfCEraHauteur}{\useKV[ClesEra]{Hauteur}}% + \xdef\PfCEraMax{\fpeval{\useKV[ClesEra]{Lignes}*\useKV[ClesEra]{Colonnes}}}% + \colorlet{PfCCouleurPremier}{\useKV[ClesEra]{CouleurP}} + \colorlet{PfCCouleurPasPremier}{\useKV[ClesEra]{CouleurNP}} + \begin{NiceTabular}{*{\useKV[ClesEra]{Colonnes}}{m{\PfCEraHauteur-\tabcolsep}}}[hvlines] + \CodeBefore + \tikz\draw[fill,PfCCouleurPasPremier] (1-|1) rectangle (2-|2); + \xintifboolexpr{\useKV[ClesEra]{Nombre}>1}{% + \xintFor* ##3 in{\xintSeq{2}{\useKV[ClesEra]{Nombre}}}\do{% + \TestPremier{##3} + \ifboolKV[ClesEra]{Premier}{% + % on positionne le nombre premier + \xdef\PfCEraLigneA{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})+1}}% + \xdef\PfCEraLigneB{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})+2}}% + \xdef\PfCEraLigneC{\fpeval{floor(##3/\useKV[ClesEra]{Colonnes})}}% + \xdef\PfCEraColonneA{\fpeval{##3-\useKV[ClesEra]{Colonnes}*floor(##3/\useKV[ClesEra]{Colonnes})}} + \xdef\PfCEraColonneB{\fpeval{##3-\useKV[ClesEra]{Colonnes}*floor(##3/\useKV[ClesEra]{Colonnes})+1}} + \xintifboolexpr{\PfCEraColonneA==0}{% + \tikz\draw[fill,PfCCouleurPremier] (\PfCEraLigneC-|\useKV[ClesEra]{Colonnes}) rectangle (\PfCEraLigneA-|\fpeval{\useKV[ClesEra]{Colonnes}+1}); + }{% + \tikz\draw[fill,PfCCouleurPremier] (\PfCEraLigneA-|\PfCEraColonneA) rectangle (\PfCEraLigneB-|\PfCEraColonneB); + }% + %On positionne ses multiples + \xintFor* ##4 in{\xintSeq{2}{\fpeval{floor(\PfCEraMax/##3)}}}\do{% + \xintifboolexpr{##3>\fpeval{floor(sqrt(\PfCEraMax))}}{\xintBreakFor}{% + \xdef\PfCEraLigneA{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})+1}}% + \xdef\PfCEraLigneB{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})+2}}% + \xdef\PfCEraLigneC{\fpeval{floor(##3*##4/\useKV[ClesEra]{Colonnes})}}% + \xdef\PfCEraColonneA{\fpeval{##3*##4-\useKV[ClesEra]{Colonnes}*floor(##3*##4/\useKV[ClesEra]{Colonnes})}} + \xdef\PfCEraColonneB{\fpeval{##3*##4-\useKV[ClesEra]{Colonnes}*floor(##3*##4/\useKV[ClesEra]{Colonnes})+1}} + \xintifboolexpr{\PfCEraColonneA==0}{% + \tikz\draw[fill,PfCCouleurPasPremier] (\PfCEraLigneC-|\useKV[ClesEra]{Colonnes}) rectangle (\PfCEraLigneA-|\fpeval{\useKV[ClesEra]{Colonnes}+1}); + }{% + \tikz\draw[fill,PfCCouleurPasPremier] (\PfCEraLigneA-|\PfCEraColonneA) rectangle (\PfCEraLigneB-|\PfCEraColonneB); + }% + }% + }% + }{%Le nombre choisi n'est pas un nombre premier, ses multiples ont déjà étaient criblés. + }% + }% + }% + \Body + \xintFor* ##1 in{\xintSeq{0}{\fpeval{\useKV[ClesEra]{Lignes}-1}}}\do{% + \xintFor* ##2 in{\xintSeq{1}{\useKV[ClesEra]{Colonnes}}}\do{% + \xintifForFirst{\rule{0pt}{\PfCEraHauteur}}{&}\Block{1-1}{\fpeval{##2+##1*\useKV[ClesEra]{Colonnes}}} + }\\ + }% + \end{NiceTabular} +}% \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex b/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex index d37ac5e0423..81e88648e8c 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCNotionFonction.tex @@ -139,6 +139,9 @@ MinY:=ceiling(MinY)-1; fi; fi; + if MinY>0: + MinY:=0; + fi; if MinX<0: if MinX<>ceiling(MinX): MinX:=ceiling(MinX)-1; @@ -275,6 +278,9 @@ MinY:=ceiling(MinY)-1; fi; fi; + if MinY>0: + MinY:=0; + fi; if MinX<0: if MinX<>ceiling(MinX): MinX:=ceiling(MinX)-1; diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCProbabilites.tex b/Master/texmf-dist/tex/latex/profcollege/PfCProbabilites.tex index 58de59761c1..7ed834a61ea 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCProbabilites.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCProbabilites.tex @@ -33,6 +33,7 @@ % #3: pour l'affichage des labels (0 : rien, 1: fleches, 2 : fleches+ev\`enements, 3: fleches+proba, 4 : tout) % #4 : dimension de "la grille" associ\'ee \ifluatex + \mplibforcehmode \begin{mplibcode} pair A,B,C[],D[];%les noeuds de l'arbre %Figure(-10u,-10u,10u,10u); @@ -158,6 +159,7 @@ % #2:angle entre deux branches de m\^eme origine % #3:Liste des \'ev\`enements/proba \ifluatex + \mplibforcehmode \begin{mplibcode} boolean Incline; Incline=\useKV[ClesProba]{Incline}; diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex b/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex index 45a20b80c7b..5606728dd92 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCPythagore.tex @@ -1,8 +1,10 @@ %%% % Le th\'eor\`eme de Pythagore %%% -\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Echelle=1cm,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,ValeurA=0,ValeurB=0,ValeurC=0,Perso=false,AllPerso=false,SansMots=false} - +\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Echelle=1cm,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,Perso=false,AllPerso=false,SansMots=false} +\defKV[ClesPythagore]{ValeurA=\setKV[ClesPythagore]{EnchaineA}} +\defKV[ClesPythagore]{ValeurB=\setKV[ClesPythagore]{EnchaineB}} +\defKV[ClesPythagore]{ValeurC=\setKV[ClesPythagore]{EnchaineC}} % On d\'efinit les figures \`a utiliser \def\MPFigurePytha#1#2#3#4#5#6{% % #1 Premier sommet @@ -312,6 +314,81 @@ }%\fi% } +\NewDocumentCommand\PfCCalculsReciPythagore{ommmm}{% + \ifboolKV[ClesPythagore]{ReciColonnes}{% + \[ + \begin{array}{cccc|cccc} + &&\NomA\NomC^2&&&\NomA\NomB^2&+&\NomB\NomC^2\\ + &&\ifboolKV[ClesPythagore]{EnchaineC}{% + \num{\useKV[ClesPythagore]{ValeurC}}% + \xdef\PfCRetiensReciHypo{\useKV[ClesPythagore]{ValeurC}}% + }{% + \num{#3}^2}&&&\ifboolKV[ClesPythagore]{EnchaineA}{\num{\useKV[ClesPythagore]{ValeurA}}}{\num{#4}^2}&+&\ifboolKV[ClesPythagore]{EnchaineB}{\num{\useKV[ClesPythagore]{ValeurB}}}{\num{#5}^2}\\ + &&&&&\ifboolKV[ClesPythagore]{EnchaineA}{%Enchaine A + \ifboolKV[ClesPythagore]{EnchaineB}{%EnchaineB + }{%Pas Enchaine B + \num{\useKV[ClesPythagore]{ValeurA}}}}{%Pas EnchaineA + \num{\fpeval{#4*#4}}}&\ifboolKV[ClesPythagore]{EnchaineA}{\ifboolKV[ClesPythagore]{EnchaineB}{}{+}}{+}&\ifboolKV[ClesPythagore]{EnchaineB}{%Enchaine B + \ifboolKV[ClesPythagore]{EnchaineA}{%EnchaineA + }{%Pas Enchaine A + \num{\useKV[ClesPythagore]{ValeurB}}}}{%Pas EnchaineB + \num{\fpeval{#5*#5}}}\\ + &&\ifboolKV[ClesPythagore]{EnchaineC}{}{% + \xdef\PfCRetiensReciHypo{\fpeval{#3*#3}}% + \num{\PfCRetiensReciHypo} + }&&&\multicolumn{3}{c}{% + \ifboolKV[ClesPythagore]{EnchaineA}{%Enchaine A + \ifboolKV[ClesPythagore]{EnchaineB}{%EnchaineB + \xdef\PfCRetiensReciSomme{\fpeval{\useKV[ClesPythagore]{ValeurA}+\useKV[ClesPythagore]{ValeurB}}}% + }{%Pas Enchaine B + \xdef\PfCRetiensReciSomme{\fpeval{\useKV[ClesPythagore]{ValeurA}+#5*#5}}% + }}{%Pas EnchaineA + \ifboolKV[ClesPythagore]{EnchaineB}{ + \xdef\PfCRetiensReciSomme{\fpeval{\useKV[ClesPythagore]{ValeurB}+#4*#4}}% + }{% + \xdef\PfCRetiensReciSomme{\fpeval{#4*#4+#5*#5}}% + } + } + \num{\PfCRetiensReciSomme}% + }\\ + \end{array} + \] + }{% + \[\left. + \begin{array}{l} + \NomA\NomC^2=\ifboolKV[ClesPythagore]{EnchaineC}{% + \num{\useKV[ClesPythagore]{ValeurC}}% + \xdef\PfCRetiensReciHypo{\useKV[ClesPythagore]{ValeurC}}% + }{% + \num{#3}^2=\num{\fpeval{#3*#3}} + \xdef\PfCRetiensReciHypo{\fpeval{#3*#3}}% + }\\ + \NomA\NomB^2+\NomB\NomC^2=\ifboolKV[ClesPythagore]{EnchaineA}{\num{\useKV[ClesPythagore]{ValeurA}}}{\num{#4}^2}+\ifboolKV[ClesPythagore]{EnchaineB}{\num{\useKV[ClesPythagore]{ValeurB}}}{\num{#5}^2}= + \ifboolKV[ClesPythagore]{EnchaineA}{%Enchaine A + \ifboolKV[ClesPythagore]{EnchaineB}{%Enchaine B + \xdef\PfCRetiensReciSomme{\fpeval{\useKV[ClesPythagore]{ValeurA}+\useKV[ClesPythagore]{ValeurB}}}% + \num{\PfCRetiensReciSomme}% + }{% PasEnchaine B + \num{\useKV[ClesPythagore]{ValeurA}}+\num{\fpeval{#5*#5}}=% + \xdef\PfCRetiensReciSomme{\fpeval{\useKV[ClesPythagore]{ValeurA}+#5*#5}}% + \num{\PfCRetiensReciSomme}% + } + }{%Pas Enchaine A + \num{\fpeval{#4*#4}}+ + \ifboolKV[ClesPythagore]{EnchaineB}{%Enchaine B + \num{\useKV[ClesPythagore]{ValeurB}}=\xdef\PfCRetiensReciSomme{\fpeval{\useKV[ClesPythagore]{ValeurB}+#4*#4}}% + \num{\PfCRetiensReciSomme}% + }{%Pas Enchaine B + \num{\fpeval{#5*#5}}=\xdef\PfCRetiensReciSomme{\fpeval{#5*#5+#4*#4}}% + \num{\PfCRetiensReciSomme}% + } + } + \end{array} + \right\}\xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2}{\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2}% + \] + }% +}% + % \newcommand\Pythagore[5][]{% \NewDocumentCommand\Pythagore{o m m m m}{% % #1 Param\`etres sous forme de cl\'es @@ -355,35 +432,20 @@ }{% Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.% } - \ifboolKV[ClesPythagore]{ReciColonnes}{% - \[ - \begin{array}{cccc|cccc} - &&\NomA\NomC^2&&&\NomA\NomB^2&+&\NomB\NomC^2\\ - &&\opexport{A1}{\Aun}\num{\Aun}^2&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\ - &&\opmul*{A1}{A1}{a1}&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\ - &&\opexport{a1}{\Aun}\num{\Aun}&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\ - \end{array} - \] - }{% - \[\left. - \begin{array}{l} - \NomA\NomC^2=\opexport{A1}{\Aun}\num{\Aun}^2=\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}\\ - \\ - \NomA\NomB^2+\NomB\NomC^2=\opexport{A2}{\Adeux}\num{\Adeux}^2+\opexport{A3}{\Atrois}\num{\Atrois}^2=\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}+\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}=\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}\\ - \end{array} - \right\}\opcmp{a1}{a4}\ifopeq\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2\fi\opcmp{a1}{a4}\ifopneq\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2\fi - \] - } + \PfCCalculsReciPythagore[#1]{#2}{#3}{#4}{#5}% \ifboolKV[ClesPythagore]{Egalite}{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee. Donc le triangle $#2$ est rectangle en $\NomB$.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore n'est pas v\'erifi\'ee. Donc le triangle $#2$ n'est pas rectangle.\fi% + \xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{% + Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee. Donc le triangle $#2$ est rectangle en $\NomB$.}{% + Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore n'est pas v\'erifi\'ee. Donc le triangle $#2$ n'est pas rectangle. + }% }{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle - en $\NomB$ d'apr\`es la r\'eciproque du th\'eor\`eme de Pythagore.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le - triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'apr\`es la contrapos\'ee du th\'eor\`eme de Pythagore.}\fi% - } - } + \xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{% + Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle en $\NomB$ d'apr\`es la r\'eciproque du th\'eor\`eme de Pythagore.}{% + Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le + triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'apr\`es la contrapos\'ee du th\'eor\`eme de Pythagore.} + }% + }% + }% \end{multicols} }{% \ifboolKV[ClesPythagore]{AllPerso}{% @@ -394,33 +456,18 @@ \ifboolKV[ClesPythagore]{Perso}{\RedactionReciPythagore}{% Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.% } - \ifboolKV[ClesPythagore]{ReciColonnes}{% - \[ - \begin{array}{cccc|cccc} - &&\NomA\NomC^2&&&\NomA\NomB^2&+&\NomB\NomC^2\\ - &&\opexport{A1}{\Aun}\num{\Aun}^2&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\ - &&\opmul*{A1}{A1}{a1}&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\ - &&\opexport{a1}{\Aun}\num{\Aun}&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\ - \end{array} - \] - }{% - \[\left. - \begin{array}{l} - \NomA\NomC^2=\opexport{A1}{\Aun}\num{\Aun}^2=\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}\\ - \\ - \NomA\NomB^2+\NomB\NomC^2=\opexport{A2}{\Adeux}\num{\Adeux}^2+\opexport{A3}{\Atrois}\num{\Atrois}^2=\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}+\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}=\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}\\ - \end{array} - \right\}\opcmp{a1}{a4}\ifopeq\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2\fi\opcmp{a1}{a4}\ifopneq\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2\fi - \] - }% + \PfCCalculsReciPythagore[#1]{#2}{#3}{#4}{#5}% \ifboolKV[ClesPythagore]{Egalite}{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee. Donc le triangle $#2$ est rectangle en $\NomB$.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore n'est pas v\'erifi\'ee. Donc le triangle $#2$ n'est pas rectangle.\fi% + \xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{% + Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee. Donc le triangle $#2$ est rectangle en $\NomB$.}{% + Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore n'est pas v\'erifi\'ee. Donc le triangle $#2$ n'est pas rectangle. + }% }{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle - en $\NomB$ d'apr\`es la r\'eciproque du th\'eor\`eme de Pythagore.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le - triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'apr\`es la contrapos\'ee du th\'eor\`eme de Pythagore.}\fi% + \xintifboolexpr{\PfCRetiensReciHypo==\PfCRetiensReciSomme}{% + Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle en $\NomB$ d'apr\`es la r\'eciproque du th\'eor\`eme de Pythagore.}{% + Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le + triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'apr\`es la contrapos\'ee du th\'eor\`eme de Pythagore.} + }% }% }% }% diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCPythagoreold.tex b/Master/texmf-dist/tex/latex/profcollege/PfCPythagoreold.tex deleted file mode 100644 index c416595207a..00000000000 --- a/Master/texmf-dist/tex/latex/profcollege/PfCPythagoreold.tex +++ /dev/null @@ -1,516 +0,0 @@ -%%% -% Le th\'eor\`eme de Pythagore -%%% -\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Echelle=1cm,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,ValeurA=0,ValeurB=0,ValeurC=0,Perso=false,AllPerso=false,SansMots=false} - -% On d\'efinit les figures \`a utiliser -\def\MPFigurePytha#1#2#3#4#5#6{% - % #1 Premier sommet - % #2 Sommet de l'angle droit - % #3 troisi\`eme sommet - % #4 1ere longueur - % #5 2eme longueur - % #6 angle de rotation de la figure - \ifluatex - \mplibforcehmode - \begin{mplibcode} - u:=\useKV[ClesPythagore]{Echelle}; - pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit - O=u*(2.5,2.5); - path cc; - cc=(fullcircle scaled 4u) shifted O; - % On place les points A,B,C sur le cercle de mani\`ere \`a faciliter la rotation de la figure - A=point(0.9*length cc) of cc; - B=A rotatedabout(O,-120); - C=2[A,O]; - % On tourne pour \'eventuellement moins de lassitude :) - A:=A rotatedabout(O,#6); - B:=B rotatedabout(O,#6); - C:=C rotatedabout(O,#6); - % On d\'efinit l'angle droit - D-B=7*unitvector(C-B); - F-B=7*unitvector(A-B); - E-D=F-B; - draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)}; - draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)}; - draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)}; - draw D--E--F; - numeric decalage; - decalage=3mm; - if (#4<#5) or (#4=#5) : - if ypart(B)>ypart(O) : - label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B))); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - else: - label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B))); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - fi - else: - if ypart(B)>ypart(O) : - label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90)); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - else: - label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C) - rotated 90)); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - fi; - fi; - label(btex #3 etex,1.2[O,A]); - label(btex #2 etex,1.2[O,B]); - label(btex #1 etex,1.2[O,C]); - \end{mplibcode} - \else - \begin{mpost}[mpsettings={u:=\useKV[ClesPythagore]{Echelle};}] - pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit - O=u*(2.5,2.5); - path cc; - cc=(fullcircle scaled 4u) shifted O; - % On place les points A,B,C sur le cercle de mani\`ere \`a faciliter la rotation de la figure - A=point(0.9*length cc) of cc; - B=A rotatedabout(O,-120); - C=2[A,O]; - % On tourne pour \'eventuellement moins de lassitude :) - A:=A rotatedabout(O,#6); - B:=B rotatedabout(O,#6); - C:=C rotatedabout(O,#6); - % On d\'efinit l'angle droit - D-B=7*unitvector(C-B); - F-B=7*unitvector(A-B); - E-D=F-B; - draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)}; - draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)}; - draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)}; - draw D--E--F; - decalage=3mm; - if (#4<#5) or (#4=#5) : - if ypart(B)>ypart(O) : - label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B))); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - else: - label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B))); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - fi - else: - if ypart(B)>ypart(O) : - label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90)); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - else: - label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C) - rotated 90)); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - fi; - fi; - label(btex #3 etex,1.2[O,A]); - label(btex #2 etex,1.2[O,B]); - label(btex #1 etex,1.2[O,C]); - \end{mpost} - \fi -} - -\def\MPFigureReciPytha#1#2#3#4#5#6#7{% - % #1 Premier sommet - % #2 Sommet de l'angle droit - % #3 troisi\`eme sommet - % #4 1ere longueur - % #5 2eme longueur - % #6 3eme longueur - % #7 angle de rotation de la figure - \ifluatex - \mplibforcehmode - \begin{mplibcode} - u:=\useKV[ClesPythagore]{Echelle}; - pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit - O=u*(2.5,2.5); - path cc; - cc=(fullcircle scaled 4u) shifted O; - % On place les points A,B,C sur le cercle de mani\`ere \`a faciliter la rotation de la figure - A=point(0.8*length cc) of cc; - B=A rotatedabout(O,-100); - C=2[A,O]; - % On tourne pour \'eventuellement moins de lassitude :) - A:=A rotatedabout(O,#7); - B:=B rotatedabout(O,#7); - C:=C rotatedabout(O,#7); - draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)}; - draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)}; - draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)}; - decalage=3mm; - if ypart(B)>ypart(O) : - label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90)); - label(btex \num{#5} etex,1/2[C,B]-decalage*(unitvector(C-B))); - label(btex \num{#6} etex,1/2[A,B]-decalage*(unitvector(C-B))); - else: - label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C) rotated 90)); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - label(btex \num{#6} etex,1/2[C,B]-decalage*(unitvector(A-B))); - fi; - label(btex #1 etex,1.2[O,A]); - label(btex #2 etex,1.2[O,B]); - label(btex #3 etex,1.2[O,C]); - \end{mplibcode} - \else - \begin{mpost}[mpsettings={u:=\useKV[ClesPythagore]{Echelle};}] - pair A,B,C,O,D,E,F;%B est le sommet de l'angle droit - O=u*(2.5,2.5); - path cc; - cc=(fullcircle scaled 4u) shifted O; - % On place les points A,B,C sur le cercle de mani\`ere \`a faciliter la rotation de la figure - A=point(0.8*length cc) of cc; - B=A rotatedabout(O,-100); - C=2[A,O]; - % On tourne pour \'eventuellement moins de lassitude :) - A:=A rotatedabout(O,#7); - B:=B rotatedabout(O,#7); - C:=C rotatedabout(O,#7); - draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)}; - draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)}; - draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)}; - decalage=3mm; - if ypart(B)>ypart(O) : - label(LATEX("\num{"&decimal(#4)&"}") rotated angle(C-A),1/2[C,A]-decalage*(unitvector(C-A) rotated 90)); - label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(C-B)),1/2[C,B]-decalage*(unitvector(C-B))); - label(LATEX("\num{"&decimal(#6)&"}") rotated(angle(B-A)),1/2[A,B]-decalage*(unitvector(C-B))); - else: - label(LATEX("\num{"&decimal(#4)&"}") rotated angle(A-C),1/2[A,C]+decalage*(unitvector(A-C) rotated 90)); - label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(A-B)),1/2[A,B]-decalage*(unitvector(C-B))); - label(LATEX("\num{"&decimal(#6)&"}") rotated angle(C-B),1/2[C,B]-decalage*(unitvector(A-B))); - fi; - label(btex #1 etex,1.2[O,A]); - label(btex #2 etex,1.2[O,B]); - label(btex #3 etex,1.2[O,C]); - \end{mpost} - \fi -} - -\def\MPFigurePythaSansMots#1#2#3#4#5#6{% - % #1 Premier sommet - % #2 Sommet de l'angle droit - % #3 troisi\`eme sommet - % #4 1ere longueur - % #5 2eme longueur - % #6 angle de rotation de la figure - \ifluatex - \mplibforcehmode - \begin{mplibcode} - u:=\useKV[ClesPythagore]{Echelle}; - pair A,B,C,O,D,E,F,L[],M[],N[];%B est le sommet de l'angle droit - O=u*(2.5,2.5); - path cc; - cc=(fullcircle scaled 4u) shifted O; - % On place les points A,B,C sur le cercle de mani\`ere \`a faciliter la rotation de la figure - A=point(0.9*length cc) of cc; - B=A rotatedabout(O,-120); - C=2[A,O]; - % On tourne pour \'eventuellement moins de lassitude :) - A:=A rotatedabout(O,#6); - B:=B rotatedabout(O,#6); - C:=C rotatedabout(O,#6); - % On d\'efinit l'angle droit - D-B=7*unitvector(C-B); - F-B=7*unitvector(A-B); - E-D=F-B; - trace polygone(A,B,C); - draw D--E--F; - L1=rotation(B,A,90); - L2-L1=B-A; - trace chemin(A,L1,L2,B); - M1=rotation(C,B,90); - M2-M1=C-B; - trace chemin(B,M1,M2,C); - N1=rotation(A,C,90); - N2-N1=A-C; - trace chemin(C,N1,N2,A); - numeric decalage; - decalage=3mm; - if (#4<#5) or (#4=#5) : - if ypart(B)>ypart(O) : - label(btex \num{#4} etex,1/2[C,B]+decalage*(unitvector(A-B))); - label(btex \num{#5} etex,1/2[A,B]+decalage*(unitvector(C-B))); - label(TEX("\begin{tabular}{c}Aire\\$\num{#5}\times\num{#5}$\\$\num{\fpeval{#5*#5}}$\\\end{tabular}"),iso(A,L2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{#4}\times\num{#4}$\\$\num{\fpeval{#4*#4}}$\\\end{tabular}"),iso(B,M2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{\fpeval{#4*#4}}+\num{\fpeval{#5*#5}}$\\$\num{\fpeval{#4*#4+#5*#5}}$\\\end{tabular}"),iso(C,N2)); - else: - label(btex \num{#4} etex,1/2[C,B]+decalage*(unitvector(A-B))); - label(btex \num{#5} etex,1/2[A,B]+decalage*(unitvector(C-B))); - label(TEX("\begin{tabular}{c}Aire\\$\num{#5}\times\num{#5}$\\$\num{\fpeval{#5*#5}}$\\\end{tabular}"),iso(A,L2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{#4}\times\num{#4}$\\$\num{\fpeval{#4*#4}}$\\\end{tabular}"),iso(B,M2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{\fpeval{#4*#4}}+\num{\fpeval{#5*#5}}$\\$\num{\fpeval{#4*#4+#5*#5}}$\\\end{tabular}"),iso(C,N2)); - drawarrow 2/10[iso(A,L2),iso(C,N2)]--8/10[iso(A,L2),iso(C,N2)]; - drawarrow 2/10[iso(B,M2),iso(C,N2)]--8/10[iso(B,M2),iso(C,N2)]; - fi - else: - if ypart(B)>ypart(O) : - label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90)); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - label(TEX("\begin{tabular}{c}Aire\\$\num{#5}\times\num{#5}$\\$\num{\fpeval{#5*#5}}$\\\end{tabular}"),iso(A,L2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{#4}\times\num{#4}$\\$\num{\fpeval{#4*#4}}$\\\end{tabular}"),iso(C,N2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{\fpeval{#4*#4}}-\num{\fpeval{#5*#5}}$\\$\num{\fpeval{#4*#4-#5*#5}}$\\\end{tabular}"),iso(B,M2)); - drawarrow 2/10[iso(A,L2),iso(B,M2)]--8/10[iso(A,L2),iso(B,M2)]; - drawarrow 2/10[iso(C,N2),iso(B,M2)]--8/10[iso(C,N2),iso(B,M2)]; - else: - label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C) rotated 90)); - label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B))); - label(TEX("\begin{tabular}{c}Aire\\$\num{#5}\times\num{#5}$\\$\num{\fpeval{#5*#5}}$\\\end{tabular}"),iso(A,L2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{#4}\times\num{#4}$\\$\num{\fpeval{#4*#4}}$\\\end{tabular}"),iso(C,N2)); - label(TEX("\begin{tabular}{c}Aire\\$\num{\fpeval{#4*#4}}-\num{\fpeval{#5*#5}}$\\$\num{\fpeval{#4*#4-#5*#5}}$\\\end{tabular}"),iso(B,M2)); - drawarrow 2/10[iso(A,L2),iso(B,M2)]--8/10[iso(A,L2),iso(B,M2)]; - drawarrow 2/10[iso(C,N2),iso(B,M2)]--8/10[iso(C,N2),iso(B,M2)]; - fi; - fi; - label(btex #3 etex,1.2[O,A]); - label(btex #2 etex,1.2[O,B]); - label(btex #1 etex,1.2[O,C]); - \end{mplibcode} - \fi -} - -\newcommand\RedactionPythagore{}% -\newcommand\RedactionReciPythagore{}% -\newcommand\RedactionCalculsPythagore{}% -\newcommand\RedactionCalculsReciPythagore{}% -\newcommand\RedactionConclusionReciPythagore{}% - -% \newcommand\Pythagore[5][]{% -\NewDocumentCommand\Pythagore{o m m m m}{% - % #1 Param\`etres sous forme de cl\'es - % #2 Nom "complet" du triangle : ABC par exemple - % #3 Premi\`ere longueur - % #4 Deuxi\`eme longueur - % #5 Troisi\`eme longueur (\'eventuellement vide) - \useKVdefault[ClesPythagore]% - \setKV[ClesPythagore]{#1}% - \DeclareSIUnit{\PfCPythaUnit}{\useKV[ClesPythagore]{Unite}}% - \ifboolKV[ClesPythagore]{Reciproque}{% - % On retient les noms des sommets - \StrMid{#2}{1}{1}[\NomA]% - \StrMid{#2}{2}{2}[\NomB]% - \StrMid{#2}{3}{3}[\NomC]% - \xdef\NomTriangle{\NomA\NomB\NomC}% - % on stocke les valeurs donn\'ees - \opcopy{#3}{A1}% - \opcopy{#4}{A2}% - \opcopy{#5}{A3}% - \xdef\GrandCote{#3}% - \xdef\PetitCote{#4}% - \xdef\MoyenCote{#5}% - % On trace une figure ou pas ? - \ifboolKV[ClesPythagore]{FigureSeule}{% - \MPFigureReciPytha{\NomA}{\NomB}{\NomC}{#3}{#4}{#5}{\useKV[ClesPythagore]{Angle}}% - }{% - \ifboolKV[ClesPythagore]{Figure}{%Utilisation obligatoire de l'option --shell-escape de la compilation - \begin{multicols}{2} - {\em La figure est donn\'ee \`a titre indicatif.}% - \[\MPFigureReciPytha{\NomA}{\NomB}{\NomC}{#3}{#4}{#5}{\useKV[ClesPythagore]{Angle}}\]% - \par\columnbreak\par% - \ifboolKV[ClesPythagore]{AllPerso}{% - \RedactionReciPythagore% - \RedactionCalculsReciPythagore% - \RedactionConclusionReciPythagore% - }{% - % on r\'edige - \ifboolKV[ClesPythagore]{Perso}{% - \RedactionReciPythagore% - }{% - Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.% - } - \ifboolKV[ClesPythagore]{ReciColonnes}{% - \[ - \begin{array}{cccc|cccc} - &&\NomA\NomC^2&&&\NomA\NomB^2&+&\NomB\NomC^2\\ - &&\opexport{A1}{\Aun}\num{\Aun}^2&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\ - &&\opmul*{A1}{A1}{a1}&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\ - &&\opexport{a1}{\Aun}\num{\Aun}&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\ - \end{array} - \] - }{% - \[\left. - \begin{array}{l} - \NomA\NomC^2=\opexport{A1}{\Aun}\num{\Aun}^2=\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}\\ - \\ - \NomA\NomB^2+\NomB\NomC^2=\opexport{A2}{\Adeux}\num{\Adeux}^2+\opexport{A3}{\Atrois}\num{\Atrois}^2=\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}+\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}=\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}\\ - \end{array} - \right\}\opcmp{a1}{a4}\ifopeq\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2\fi\opcmp{a1}{a4}\ifopneq\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2\fi - \] - } - \ifboolKV[ClesPythagore]{Egalite}{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee. Donc le triangle $#2$ est rectangle en $\NomB$.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore n'est pas v\'erifi\'ee. Donc le triangle $#2$ n'est pas rectangle.\fi% - }{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle - en $\NomB$ d'apr\`es la r\'eciproque du th\'eor\`eme de Pythagore.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le - triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'apr\`es la contrapos\'ee du th\'eor\`eme de Pythagore.}\fi% - } - } - \end{multicols} - }{% - \ifboolKV[ClesPythagore]{AllPerso}{% - \RedactionReciPythagore% - \RedactionCalculsReciPythagore% - \RedactionConclusionReciPythagore% - }{% - \ifboolKV[ClesPythagore]{Perso}{\RedactionReciPythagore}{% - Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand c\^ot\'e.% - } - \ifboolKV[ClesPythagore]{ReciColonnes}{% - \[ - \begin{array}{cccc|cccc} - &&\NomA\NomC^2&&&\NomA\NomB^2&+&\NomB\NomC^2\\ - &&\opexport{A1}{\Aun}\num{\Aun}^2&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\ - &&\opmul*{A1}{A1}{a1}&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\ - &&\opexport{a1}{\Aun}\num{\Aun}&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\ - \end{array} - \] - }{% - \[\left. - \begin{array}{l} - \NomA\NomC^2=\opexport{A1}{\Aun}\num{\Aun}^2=\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}\\ - \\ - \NomA\NomB^2+\NomB\NomC^2=\opexport{A2}{\Adeux}\num{\Adeux}^2+\opexport{A3}{\Atrois}\num{\Atrois}^2=\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}+\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}=\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}\\ - \end{array} - \right\}\opcmp{a1}{a4}\ifopeq\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2\fi\opcmp{a1}{a4}\ifopneq\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2\fi - \] - }% - \ifboolKV[ClesPythagore]{Egalite}{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee. Donc le triangle $#2$ est rectangle en $\NomB$.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'\'egalit\'e de Pythagore n'est pas v\'erifi\'ee. Donc le triangle $#2$ n'est pas rectangle.\fi% - }{% - \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle - en $\NomB$ d'apr\`es la r\'eciproque du th\'eor\`eme de Pythagore.\fi% - \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le - triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'apr\`es la contrapos\'ee du th\'eor\`eme de Pythagore.}\fi% - }% - }% - }% - }% - }{% - % [xlop] param\`etres de calcul - \opcopy{#3}{A1}% - \opcopy{#4}{A2}% - \opcopy{\useKV[ClesPythagore]{Precision}}{pres}% - \xintifboolexpr{#3<#4 || #3==#4}{ - \xdef\PetitCote{#3}% - \xdef\MoyenCote{#4}% - \xdef\GrandCote{}% - }{% - \xdef\GrandCote{#3}% - \xdef\MoyenCote{#4}% - \xdef\PetitCote{}% Pour la personnalisation - } - % On retient les noms des sommets - \StrMid{#2}{1}{1}[\NomA]% - \StrMid{#2}{2}{2}[\NomB]% - \StrMid{#2}{3}{3}[\NomC]% - \xdef\NomTriangle{\NomA\NomB\NomC}% - \xdef\NomAngleDroit{\NomB}% - \xdef\NomSommetA{\NomA}% - \xdef\NomSommetC{\NomC}% - % On trace une figure ou pas ? - \ifboolKV[ClesPythagore]{FigureSeule}{% - \xintifboolexpr{#3<#4 || #3==#4}{% - \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}% - }{% - \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}% - }% - \MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}} - }{% - \ifboolKV[ClesPythagore]{Figure}{% - \begin{multicols}{2}% - {\em La figure est donn\'ee \`a titre indicatif.}% - \[\MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}\] - \par\columnbreak\par% - % On d\'emarre la r\'esolution - \ifboolKV[ClesPythagore]{AllPerso}{% - \RedactionPythagore% - \RedactionCalculsPythagore% - }{% - \ifboolKV[ClesPythagore]{Perso}{% - \RedactionCalculsPythagore% - }{% - \ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :% - }% - } - \xintifboolexpr{#3<#4 || #3==#4}{%\ifnum#3<#4% - \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}% - \begin{align*} - \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\ - \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opcopy{\useKV[ClesPythagore]{ValeurA}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\ - \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\ - \NomA\NomC^2&=\opadd*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\ - \ifboolKV[ClesPythagore]{AvantRacine}{}{% - \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomC&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}} - \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomC&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}{\NomA\NomC&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}}%\\ - }% - \end{align*} - }{%\else% - \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}% - \begin{align*} - \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\ - \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\ - \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\ - \NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}-\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\ - \NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\ - \ifboolKV[ClesPythagore]{AvantRacine}{}{% - \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}} - \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}}%\\ - }% - \end{align*} - }%\fi% - } - \end{multicols} - }{% - % On d\'emarre la r\'esolution - \ifboolKV[ClesPythagore]{SansMots}{% - \MPFigurePythaSansMots{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}% - }{% - \ifboolKV[ClesPythagore]{AllPerso}{% - \RedactionPythagore% - \RedactionCalculsPythagore% - }{% - \ifboolKV[ClesPythagore]{Perso}{\RedactionPythagore}{\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'\'egalit\'e de Pythagore est v\'erifi\'ee :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :% - }}% - \xintifboolexpr{#3<#4 || #3==#4}{%\ifnum#3<#4% - \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}% - \begin{align*} - \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\ - \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opcopy{\useKV[ClesPythagore]{ValeurA}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\ - \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\ - \NomA\NomC^2&=\opadd*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\ - \ifboolKV[ClesPythagore]{AvantRacine}{}{% - \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomC&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}} - \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomC&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}{\NomA\NomC&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}}%\\ - } - \end{align*} - }{%\else - \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}% - \ifboolKV[ClesPythagore]{Soustraction}{% - \begin{align*} - \NomA\NomB^2&=\NomA\NomC^2-\NomB\NomC^2\\ - \NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}-\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\ - \NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}-\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\ - \NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\ - \ifboolKV[ClesPythagore]{AvantRacine}{}{% - \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}} - \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}}%\\ - } - \end{align*} - }{% - \begin{align*} - \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\ - \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\ - \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\ - \NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}-\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\ - \NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\ - \ifboolKV[ClesPythagore]{AvantRacine}{}{% - \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}}% - \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\SI{\Aquatre}{\PfCPythaUnit}}}%\\ - } - \end{align*} - }% - }%\fi% - }% - }% - }% - }% - }% -}% \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex b/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex index 32e1fac0938..20259f4a868 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCReperage.tex @@ -1572,7 +1572,7 @@ tata(#2); \end{mplibcode} \else - \begin{mpost}[mpsettings={unitex:=\useKV[ClesReperage]{Unitex}*cm; pasx:=\useKV[ClesReperage]{Pasx}; unitp:=unitex/pasx; ValeurUnitex:=\useKV[ClesReperage]{ValeurUnitex}; ValeurOrigine:=\useKV[ClesReperage]{ValeurOrigine}; AffichageGrad:=\AffichageGrad; AffichageCoord:=\useKV[ClesReperage]{AffichageAbs}; AffichageNom:=\AffichageNom; ValeurMin=\useKV[ClesReperage]{ValeurMin}; ValeurMax=\useKV[ClesReperage]{ValeurMax};boolean DemiDroite;DemiDroite=\useKV[ClesReperage]{DemiDroite}}] + \begin{mpost}[mpsettings={unitex:=\useKV[ClesReperage]{Unitex}*cm; pasx:=\useKV[ClesReperage]{Pasx}; unitp:=unitex/pasx; ValeurUnitex:=\useKV[ClesReperage]{ValeurUnitex}; ValeurOrigine:=\useKV[ClesReperage]{ValeurOrigine}; AffichageGrad:=\AffichageGrad; AffichageCoord:=\useKV[ClesReperage]{AffichageAbs}; AffichageNom:=\AffichageNom; ValeurMin=\useKV[ClesReperage]{ValeurMin}; ValeurMax=\useKV[ClesReperage]{ValeurMax};boolean DemiDroite;DemiDroite=\useKV[ClesReperage]{DemiDroite};}] maxx:=0; minx:=4000; numeric valeur[]; diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex b/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex deleted file mode 100644 index ec3717b9c66..00000000000 --- a/Master/texmf-dist/tex/latex/profcollege/PfCSquaroaprioriold.tex +++ /dev/null @@ -1,107 +0,0 @@ -%%% -% Squaro -%%% -\setKVdefault[Squaro]{Solution=false,Longueur=8,Largeur=8,Echelle=8mm,Nom=Jeu1,Graines=false} -\defKV[Squaro]{Graine=\setKV[Squaro]{Graines}}% - -\NewDocumentCommand\SquarO{o}{% - \useKVdefault[Squaro]% - \setKVdefault[Squaro]{#1}% - \ifboolKV[Squaro]{Solution}{\BuildSquaroSolution}{\BuildSquaro}% -} - -\NewDocumentCommand\BuildSquaro{}{% - \ifluatex - \mplibforcehmode - \xdef\PfCSquaroNom{\useKV[Squaro]{Nom}}% - \begin{mplibcode}[\PfCSquaroNom] - numeric Longueur,Largeur; - Longueur=\useKV[Squaro]{Longueur}; - Largeur=\useKV[Squaro]{Largeur}; - boolean Solution,Graines; - Solution=\useKV[Squaro]{Solution}; - Graines:=\useKV[Squaro]{Graines}; - if Graines: - randomseed:=\useKV[Squaro]{Graine}; - fi; - - u:=\useKV[Squaro]{Echelle}; - - p:=0; - pair A[];%centre des carrés. - boolean Allume[][]; - - for k=0 upto Longueur-1: - for l=0 upto Largeur-1: - p:=p+1; - A[p]=u*(k,-l); - trace (unitsquare scaled u) shifted A[p]; - endfor; - endfor; - - for k=0 upto Largeur: - for l=0 upto Longueur: - m:=uniformdeviate(1); - if m<0.5: - Allume[k][l]=true; - fill cercles(u*(l,-k+1),1mm) if Solution=false:withcolor white fi; - else: - Allume[k][l]=false; - fill cercles(u*(l,-k+1),1mm) withcolor white; - fi; - trace cercles(u*(l,-k+1),1mm); - endfor; - endfor; - - for k=0 upto Largeur-1: - for l=0 upto Longueur-1: - Retiens:=0; - if Allume[k][l]:Retiens:=Retiens+1 fi; - if Allume[k][l+1]:Retiens:=Retiens+1 fi; - if Allume[k+1][l]:Retiens:=Retiens+1 fi; - if Allume[k+1][l+1]:Retiens:=Retiens+1 fi; - label(TEX(decimal(Retiens)),u*(l+0.5,-k+0.5)); - endfor; - endfor; - \end{mplibcode} - \fi -} - -\NewDocumentCommand\BuildSquaroSolution{}{% - \ifluatex - \mplibforcehmode - \xdef\PfCSquaroNom{\useKV[Squaro]{Nom}}% - \begin{mplibcode}[\PfCSquaroNom] - u:=\useKV[Squaro]{Echelle}; - p:=0; - for k=0 upto Longueur-1: - for l=0 upto Largeur-1: - p:=p+1; - trace (unitsquare scaled u) shifted A[p]; - endfor; - endfor; - - for k=0 upto Largeur: - for l=0 upto Longueur: - if Allume[k][l]=true: - fill cercles(u*(l,-k+1),1mm); - else: - fill cercles(u*(l,-k+1),1mm) withcolor white; - fi; - trace cercles(u*(l,-k+1),1mm); - endfor; - endfor; - - for k=0 upto Largeur-1: - for l=0 upto Longueur-1: - Retiens:=0; - if Allume[k][l]:Retiens:=Retiens+1 fi; - if Allume[k][l+1]:Retiens:=Retiens+1 fi; - if Allume[k+1][l]:Retiens:=Retiens+1 fi; - if Allume[k+1][l+1]:Retiens:=Retiens+1 fi; - label(TEX(decimal(Retiens)),u*(l+0.5,-k+0.5)); - endfor; - endfor; - \end{mplibcode} - \fi -}% \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex b/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex index 6be4545dee9..8f63507b5b7 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex @@ -158,25 +158,39 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis % Pour construire le diagramme en bâtons \def\Updatetoks#1/#2\nil{\addtotok\toklistepoint{(#1,#2),}}% \newcommand\buildgraph[1][]{% - \newtoks\toklistepoint% + \newtoks\toklistepoint\toklistepoint{}% + \newtoks\toklistecouleur\toklistecouleur{}% + \newtoks\toklistelegende\toklistelegende{}% + \ifboolKV[ClesStat]{LegendeVide}{% + \xdef\foo{\useKV[ClesStat]{LegendesVides}}% + \readlist*\ListeLegendesAEffacer{\foo}% + }{\xdef\foo{-1}\readlist*\ListeLegendesAEffacer{\foo}% + }% + \foreachitem\compteur\in\ListeLegendesAEffacer{\expandafter\UpdateLegende\compteur\nil}% \foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoks\compteur\nil}% - \newtoks\toklistecouleur% \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleursB}}% \readlist*\ListeCouleur{\ListeAvantCouleurs}% \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% - \MPStatNew{\the\toklistepoint}{\the\toklistecouleur}% + \MPStatNew{\the\toklistepoint}{\the\toklistecouleur}{\the\toklistelegende} }% % Pour construire le diagramme en bâtons qualitatif \def\Updatetoksq#1/#2\nil{\addtotok\toklistepointq{"#1",#2,}}% \newcommand\buildgraphq[1][]{% - \newtoks\toklistepointq% + \newtoks\toklistepointq\toklistepointq{}% + \newtoks\toklistecouleur\toklistecouleur{}% + \newtoks\toklistelegende\toklistelegende{}% + \ifboolKV[ClesStat]{LegendeVide}{% + \xdef\foo{\useKV[ClesStat]{LegendesVides}}% + \readlist*\ListeLegendesAEffacer{\foo}% + }{\xdef\foo{-1}\readlist*\ListeLegendesAEffacer{\foo}% + }% + \foreachitem\compteur\in\ListeLegendesAEffacer{\expandafter\UpdateLegende\compteur\nil}% \foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoksq\compteur\nil}% - \newtoks\toklistecouleur% \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleursB}}% \readlist*\ListeCouleur{\ListeAvantCouleurs}% \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% - \MPStatNew{\the\toklistepointq}{\the\toklistecouleur}% + \MPStatNew{\the\toklistepointq}{\the\toklistecouleur}{\the\toklistelegende}% }% \def\UpdateCoul#1\nil{\addtotok\toklistecouleur{#1,}}% @@ -437,20 +451,22 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis unitey:=\useKV[ClesStat]{Unitey}*cm; xpartorigine:=\useKV[ClesStat]{Origine}; AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse}; - boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret; + boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret,LegendeVide,Retour; Rotation=\useKV[ClesStat]{AbscisseRotation}; Lecture:=\useKV[ClesStat]{Lecture}; LectureFine:=\useKV[ClesStat]{LectureFine}; AideLecture:=\useKV[ClesStat]{AideLecture}; DonneesSup:=\useKV[ClesStat]{DonneesSup}; Reponses:=\useKV[ClesStat]{Reponses}; + LegendeVide=\useKV[ClesStat]{LegendeVide}; epaisseurbatons=\useKV[ClesStat]{EpaisseurBatons}; Qualitatif=\useKV[ClesStat]{Qualitatif}; Tiret=\useKV[ClesStat]{Tiret}; + Retour=false; color CoulDefaut; CoulDefaut=\useKV[ClesStat]{CouleurDefaut}; Depart=\useKV[ClesStat]{Depart}; - % + % pair A[],B[],P[]; vardef toto(text t)=%points quantitatif n:=0; @@ -489,11 +505,25 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis } % Construction du graphique en bâtons -\newcommand\MPStatNew[2]{% +\newcommand\MPStatNew[3]{% \ifluatex \mplibforcehmode \begin{mplibcode} \MPStatNewCode + % + vardef Test(expr nb)= + Retour:=false; + op:=0; + for l_=#3: + if l_=nb: + op:=op+1; + fi; + endfor; + if op>0: + Retour:=true; + fi; + enddef; + % % on r\'ecup\`ere les couleurs color Col[]; n:=0; @@ -517,7 +547,10 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis fi; if Reponses: if DonneesSup: + Test(l); + if Retour=false: label.top(TEX("\num{"&decimal(ypart(p_))&"}"),P[l]); + fi; else: if Tiret: trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); @@ -536,7 +569,10 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis if numeric p_: if Reponses: if DonneesSup: + Test(l); + if Retour=false: label.top(TEX("\num{"&decimal(p_)&"}"),P[l]); + fi; else: if Tiret: trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); @@ -966,7 +1002,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis if op>0: Retour:=true; fi; - enddef; + enddef; Figure(-10u,-10u,10u,10u); toto(#1); if Legende: diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCTrigonometrie.tex b/Master/texmf-dist/tex/latex/profcollege/PfCTrigonometrie.tex index 701637141e5..e562486a581 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCTrigonometrie.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCTrigonometrie.tex @@ -3,8 +3,8 @@ %%% \def\MPFigTrigo#1#2#3#4#5#6#7#8{% \ifluatex - \mplibcodeinherit{enable} - \mplibforcehmode +% \mplibcodeinherit{enable} + \mplibforcehmode \begin{mplibcode} u:=\useKV[ClesTrigo]{Echelle}; pair A,B,C,O,I,D,E,F;% @@ -99,7 +99,7 @@ fi; fi; \end{mplibcode} - \mplibcodeinherit{disable} +% \mplibcodeinherit{disable} \else \begin{mpost}[mpsettings={u:=\useKV[ClesTrigo]{Echelle};}] pair A,B,C,O,I,D,E,F;% diff --git a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty index 80dca0a8dfe..c80726c53a4 100644 --- a/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty +++ b/Master/texmf-dist/tex/latex/profcollege/ProfCollege.sty @@ -2,9 +2,9 @@ % licence : Released under the LaTeX Project Public License v1.3c % or later, see http://www.latex-project.org/lppl.txtf \NeedsTeXFormat{LaTeX2e}% -\def\filedate{2023/05/01}% +\def\filedate{2023/05/15}% \let\PfCfiledate\filedate% -\def\fileversion{0.99-z-k}% +\def\fileversion{0.99-z-l}% \let\PfCfileversion\fileversion% \ProvidesPackage{ProfCollege}[\filedate\space v\fileversion\space Aide pour utiliser LaTeX au college]% @@ -45,6 +45,9 @@ \DeclareSIUnit{\octet}{o}% \DeclareSIUnit{\fahrenheit}{\text{\textdegree}F}% \DeclareSIUnit{\EuRo}{€}% +\DeclareSIUnit{\Dollar}{\$}% +\DeclareSIUnit{\LivreSterling}{£}% + \RequirePackage[table,svgnames]{xcolor}%Gestion des couleurs \RequirePackage{xstring}%Gestion de chaines de caractères @@ -213,18 +216,17 @@ \newcommand\PfCfrac[2]{% \ooalign{$\genfrac{}{}{0pt}{0}{#1}{#2}$\cr\PfCdotover\cr}% }% -\makeatother% -\newcommand\MultiCol[2]{% +\NewDocumentCommand\MultiCol{O{}mm}{% \setsepchar[*]{/}% - \readlist*\ListeNombreCol{#1}% + \readlist*\ListeNombreCol{#2}% \setsepchar[*]{§}% - \readlist*\ListeContenuCol{#2}% - \xintFor* ##1 in {\xintSeq {1}{\ListeNombreCollen}}\do{% - \begin{minipage}{\ListeNombreCol[##1]\linewidth}% + \readlist*\ListeContenuCol{#3}% + \xintFor* ##1 in {\xintSeq{1}{\ListeNombreCollen}}\do{% + \begin{minipage}[#1]{\ListeNombreCol[##1]\linewidth}% \ListeContenuCol[##1]% \end{minipage}% - \xintifboolexpr{##1<\ListeNombreCollen}{\hfill}{}% + \xintifboolexpr{##1<\ListeNombreCollen}{\hfill\vrule width \columnseprule\hfill}{}% }% }% @@ -569,6 +571,8 @@ }%\emoticon }%\raisebox } +\input{PfCErathostene} +\input{PfCDobble} \input{PfCPavage} \input{PfCNonogramme} \input{PfCJeuRangement} diff --git a/Master/texmf-dist/tex/latex/profcollege/dobblePfC.lua b/Master/texmf-dist/tex/latex/profcollege/dobblePfC.lua new file mode 100644 index 00000000000..83cf8f62185 --- /dev/null +++ b/Master/texmf-dist/tex/latex/profcollege/dobblePfC.lua @@ -0,0 +1,82 @@ +math.randomseed(os.time()) + +-- p=5, nombre de symboles "1+p+p^2=31" +symbole = {} + +function dobble(p) + -- p : nombre premier (génération de 1+p+p² cartes à partir + -- du même nombre de symboles + -- on va générer un tableau où chaque case correspond + -- à une carte et contient la liste des numéros de symbole à mettre + for i=1,7 do + symbole[i] = "\\PfCListeSymboleDobble["..i.."]" + end + local cartes={}; + -- première carte + cartes[0]={}; + for i=0,p do + cartes[0][i]=i; + end + printcard(cartes[0],p); + -- p+p*p suivantes + for i=1,p do + -- p premières + cartes[i]={}; + for j=0,p do + if j==0 then + cartes[i][j]=0; + else + -- on place les symboles aléatoirement + table.insert(cartes[i],math.random(j),i*p+j); + end + end + printcard(cartes[i],p); + -- p*p suivantes + for j=1,p do + cartes[p+(i-1)*p+j]={}; + for k=0,p do + if k==0 then + cartes[p+(i-1)*p+j][k]=i; + else + -- on place les symboles aléatoirement + table.insert(cartes[p+(i-1)*p+j],math.random(k),(k)*p+((k*i+j-1)%p)+1); + end + end + printcard(cartes[p+(i-1)*p+j],p); + end + end + return cartes; +end + + +function printcard(carte,p) + -- prend une carte en entrée (tableau de p+1 éléments) + -- et génère le code tex d'une page à partir des images + -- nommées suivant le prefixe + tex.sprint("\\newpage\\begin{tikzpicture}[remember picture, overlay]\\coordinate(Or) at (current page.north west);"); + -- cadre de la carte + tex.sprint("\\ifboolKV[ClesDobble]{Cercle}{\\draw[line width=.2cm,PfCDobbleColor] (4,-4) circle (3.9cm);}{\\draw[line width=.2cm,PfCDobbleColor] ($(Or)+(0.1,-0.1)$) rectangle ($(Or)+(7.9,-7.9)$);}"); + -- entier aléatoire pour l'élément au centre + local has=intrand(p+1); + local compt=0; + for i=0,p do + -- l'image au contre + if i== has then + tex.sprint("\\node[scale="..scalerand(0.7,1)..",rotate="..intrand(360).."] at ($(Or)+(4,-4)$) {"..symbole[carte[i]+1].."};"); + else + -- les autres tout le tour, taille aléatoire, rayon variant, rotation aléatoire + tex.sprint("\\node[scale="..scalerand(0.7,1)..",rotate="..intrand(360).."] at ($("..(360/(p)*compt)..":"..scalerand(2.4,2.5)..")+(Or)+(4,-4)$) {"..symbole[carte[i]+1].."};"); + compt=compt+1; + end + end + tex.sprint("\\end{tikzpicture}"); +end + + +function intrand(p) -- retourne un entier entre 0 et p-1 + return math.floor(p*math.random()); +end + +function scalerand(a,b) -- retourne un nombre aléatoire entre a et b + return a+(b-a)*math.random(); +end -- cgit v1.2.3