summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/proflycee
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-01-03 20:48:33 +0000
committerKarl Berry <karl@freefriends.org>2023-01-03 20:48:33 +0000
commitd1a0bd826619d5cb07de57865ef733b300e52bbe (patch)
tree8667f9b9e6fa66582539b30eb59c211a297e6701 /Master/texmf-dist/tex/latex/proflycee
parent5f82dffae899339de8b7034e11db9b3f6c31acb9 (diff)
proflycee (3jan23)
git-svn-id: svn://tug.org/texlive/trunk@65449 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/proflycee')
-rw-r--r--Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty48
1 files changed, 46 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
index c16b0782198..211b16dcb16 100644
--- a/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
+++ b/Master/texmf-dist/tex/latex/proflycee/ProfLycee.sty
@@ -3,7 +3,8 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2022/12/30 2.1.3 Aide pour l'utilisation de LaTeX en lycee]
+\ProvidesPackage{ProfLycee}[2023/01/02 2.1.4 Aide pour l'utilisation de LaTeX en lycee]
+% 2.1.4 Ajout d'une commande pour résoudre de manière approchée une équation f(x)=k
% 2.1.3 Ajout de l'option auto-tabs-gobble sur piton (v1.0) + correction d'un bug sur CodePiton
% 2.1.2 Ajout d'une commande pour déterminer la mesure principale d'un angle + option <ElargirOx/y> pour les axes
% 2.1.1 Ajout d'une section pour les tracés de repère et courbe, en tikz
@@ -89,7 +90,8 @@
\RequirePackage{hvlogos}
\RequirePackage{fancyvrb}
\RequirePackage{siunitx} %test avec v3
-\sisetup{locale=FR,output-decimal-marker={,},%
+\sisetup{%
+ locale=FR,output-decimal-marker={,},%
mode = match, propagate-math-font = true,%
reset-math-version = false, reset-text-family = false,%
reset-text-series = false, reset-text-shape = false,%
@@ -3574,4 +3576,46 @@
}%
}
+%================DICHOTOMIE============== OK!
+\defKV[SolDichoto]{%
+ Precision=\xdef\DICHOTOstep{#1},%
+ Intervalle=\xdef\DICHOTOinterv{#1},%
+ Variable=\xdef\DICHOTOvar{#1}
+}
+
+\setKVdefault[SolDichoto]{%
+ Precision=2,%
+ Variable=x,%
+ Intervalle={0:10}
+}
+
+\NewDocumentCommand\ResolutionApprochee{ O{} m O{masolution} }{%1=options,2=equation,3=macro
+ \useKVdefault[SolDichoto]%
+ %extraction fonction + valeur
+ \setKV[SolDichoto]{#1}%
+ \IfSubStr{#2}{=}%on coupe mmb gauche / mmb droit
+ {\StrCut{#2}{=}{\SolDiFCT}{\SolDiVal}}%
+ {\xdef\SolDiFCT{#2}\xdef\SolDiVal{0}}%
+ %création des variables temporaires
+ \xintdeffloatfunc dichotovarfct(\DICHOTOvar) := \SolDiFCT ;%
+ \StrCut{\DICHOTOinterv}{:}{\varvala}{\varvalb}%
+ \xdef\varstep{\fpeval{10**(-\DICHOTOstep-1)}}%un chiffre en plus :-)
+ %boucles
+ \whiledo{\xintGt{\xintfloateval{\varvalb-\varvala-\varstep}}{0} = 1}%
+ {%
+ \xdef\varvalm{\xintfloateval{(\varvala+\varvalb)*0.5}}%
+ \xintifboolexpr{\xintGt{\xintfloateval{(dichotovarfct(\varvala)-\SolDiVal)*(dichotovarfct(\varvalm)-\SolDiVal)}}{0}==1}%
+ {\xdef\varvala{\fpeval{\varvalm}}}%
+ {\xdef\varvalb{\fpeval{\varvalm}}}%
+ }%
+ \xdef\varvalm{\xintfloateval{(\varvala+\varvalb)*0.5}}%
+ \xdef\vartmpmd{\fpeval{floor(\varvalm,\DICHOTOstep)}}%
+ \xdef\vartmpme{\fpeval{\vartmpmd+10**(-\DICHOTOstep)}}%
+ %les variables créées
+ \expandafter\def\csname#3d\endcsname{\fpeval{\vartmpmd}}%
+ \expandafter\def\csname#3e\endcsname{\fpeval{\vartmpme}}%
+ %valeur approchée
+ \expandafter\def\csname#3a\endcsname{\fpeval{round(\varvalm,\DICHOTOstep)}}%
+}
+
\endinput \ No newline at end of file