| 1 |
% tkz-grapheur-fr.tex |
| 2 |
% Copyright 2026 Cédric Pierquet |
| 3 |
% Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt |
| 4 |
% macros [fr] de tkz-grapheur-fr |
| 5 |
|
| 6 |
%\makeatletter |
| 7 |
|
| 8 |
%====COMMANDE POUR NB DECIMAL ALEA ENTRE BORNES |
| 9 |
\NewDocumentCommand\ChoisirNbAlea{ s O{0} m m O{\monbnalea} }{% |
| 10 |
\def\tmpborneinf{\xinteval{floor(#3)}}% |
| 11 |
\def\tmpbornesup{\xinteval{ceil(#4)}}% |
| 12 |
\xintifboolexpr{#2 == 0}% |
| 13 |
{% |
| 14 |
\xdef#5{\fpeval{randint(\tmpborneinf,\tmpbornesup)}}% |
| 15 |
}% |
| 16 |
{% |
| 17 |
\def\tmptest{0}% |
| 18 |
\whiledo{\tmptest=0}{% |
| 19 |
\xintifboolexpr{(\tmpbornesup-\tmpborneinf) == 1}% |
| 20 |
{% |
| 21 |
\xdef\tmpresalea{\fpeval{\tmpborneinf+round(rand(),#2)}}% |
| 22 |
}% |
| 23 |
{% |
| 24 |
\xdef\tmpresalea{\fpeval{round(randint(\tmpborneinf,\tmpbornesup)+rand(),#2)}}% |
| 25 |
}% |
| 26 |
\IfBooleanTF{#1}% |
| 27 |
{% |
| 28 |
\xintifboolexpr{\tmpresalea < #4 'and' \tmpresalea > #3 }{\def\tmptest{1}}{\def\tmptest{0}}% |
| 29 |
}% |
| 30 |
{% |
| 31 |
\xintifboolexpr{\tmpresalea <= #4 'and' \tmpresalea >= #3 }{\def\tmptest{1}}{\def\tmptest{0}}% |
| 32 |
}% |
| 33 |
}% |
| 34 |
\xdef#5{\tmpresalea}% |
| 35 |
}% |
| 36 |
} |
| 37 |
|
| 38 |
%====PATCH NUM |
| 39 |
\@ifundefined{ArrondirNum}% |
| 40 |
{% |
| 41 |
\NewDocumentCommand\ArrondirNum{ s O{2} D<>{} m}{% |
| 42 |
\IfBooleanTF{#1}% |
| 43 |
{% |
| 44 |
\xintfloateval{round(#4,#2)}\relax% |
| 45 |
}% |
| 46 |
{% |
| 47 |
\num[#3]{\xintfloateval{round(#4,#2)}}\relax% |
| 48 |
}% |
| 49 |
}% |
| 50 |
}% |
| 51 |
{% |
| 52 |
\RenewDocumentCommand\ArrondirNum{ s O{2} m}{% |
| 53 |
\IfBooleanTF{#1}% |
| 54 |
{% |
| 55 |
\xintfloateval{round(#4,#2)}\relax% |
| 56 |
}% |
| 57 |
{% |
| 58 |
\num[#3]{\xintfloateval{round(#4,#2)}}\relax% |
| 59 |
}% |
| 60 |
}% |
| 61 |
}% |
| 62 |
|
| 63 |
%===COMMANDE INTERNE POUR FORMATER EN FRACTIONS |
| 64 |
\NewDocumentCommand\FormatterFraction{ s O{} m }{% |
| 65 |
%*=moins sur le numérateur |
| 66 |
%2=argument.optionnel[d/t/dec=...] |
| 67 |
%3=argument mandataire {calcul ou fraction} |
| 68 |
\def\calculargument{\xintPRaw{\xintIrr{\xinteval{#3}}}}%on calcule et on transforme en A/B |
| 69 |
\IfSubStr{\calculargument}{/}%on teste si le symbole / apparaît |
| 70 |
{%si oui := fraction |
| 71 |
\StrBefore{\calculargument}{/}[\numerateur]%on extrait le numérateur |
| 72 |
\StrBehind{\calculargument}{/}[\denominateur]%on extrait le dénominateur |
| 73 |
\ifblank{#2}% |
| 74 |
{% |
| 75 |
\IfBooleanTF{#1}% |
| 76 |
{\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}% |
| 77 |
{% |
| 78 |
\ifthenelse{\numerateur < 0}% |
| 79 |
{\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}% |
| 80 |
{\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}% |
| 81 |
}% |
| 82 |
}% |
| 83 |
{}%si l'argument optionnel est vide |
| 84 |
\IfStrEq{#2}{d}% |
| 85 |
{% |
| 86 |
\IfBooleanTF{#1}% |
| 87 |
{\ensuremath{\displaystyle\frac{\num{\numerateur}}{\num{\denominateur}}}}% |
| 88 |
{% |
| 89 |
\ifthenelse{\numerateur < 0}% |
| 90 |
{\ensuremath{-\displaystyle\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}% |
| 91 |
{\ensuremath{\displaystyle\frac{\num{\numerateur}}{\num{\denominateur}}}}% |
| 92 |
}% |
| 93 |
}% |
| 94 |
{}%si l'argument optionnel est vide |
| 95 |
\IfStrEq{#2}{t}% |
| 96 |
{% |
| 97 |
\IfBooleanTF{#1}% |
| 98 |
{\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}% |
| 99 |
{% |
| 100 |
\ifthenelse{\numerateur < 0}% |
| 101 |
{\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}% |
| 102 |
{\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}% |
| 103 |
}% |
| 104 |
}% |
| 105 |
{}%si l'argument optionnel est vide |
| 106 |
\IfStrEq{#2}{n}% |
| 107 |
{% |
| 108 |
\ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}% |
| 109 |
}% |
| 110 |
{}%si l'argument optionnel est vide |
| 111 |
}{%si non := entier |
| 112 |
\num{\calculargument}%on affiche l'entier, avec le package siunitx |
| 113 |
}% |
| 114 |
} |
| 115 |
|
| 116 |
%affichage d'un label en radians |
| 117 |
\NewDocumentCommand\FormatterTrigo{ O{t} m }{%étoilée en dfrac |
| 118 |
\IfStrEq{#2}{0}%cas où l'argument vaut 0 |
| 119 |
{\def\restmp{0}}% |
| 120 |
{% |
| 121 |
\StrDel{#2}{*}[\restmpsansmoins]% |
| 122 |
\StrSubstitute{\restmpsansmoins}{pi}{\pi}[\restmppi]% |
| 123 |
\IfSubStr{#2}{/}% |
| 124 |
{% |
| 125 |
\StrCut{\restmppi}{/}\tmpnum\tmpdenom% |
| 126 |
\IfSubStr{\tmpnum}{-}% |
| 127 |
{% |
| 128 |
\StrDel{\tmpnum}{-}[\restmppinum]% |
| 129 |
\IfStrEqCase{#1}{% |
| 130 |
{t}{\def\restmp{-\frac{\restmppinum}{\tmpdenom}}}% |
| 131 |
{d}{\def\restmp{-\displaystyle\frac{\restmppinum}{\tmpdenom}}}% |
| 132 |
{n}{\def\restmp{\nicefrac{-\restmppinum}{\tmpdenom}}}% |
| 133 |
}% |
| 134 |
}% |
| 135 |
{% |
| 136 |
\IfStrEqCase{#1}{% |
| 137 |
{t}{\def\restmp{\frac{\tmpnum}{\tmpdenom}}}% |
| 138 |
{d}{\def\restmp{\displaystyle\frac{\tmpnum}{\tmpdenom}}}% |
| 139 |
{n}{\def\restmp{\nicefrac{\tmpnum}{\tmpdenom}}}% |
| 140 |
}% |
| 141 |
}% |
| 142 |
}% |
| 143 |
{% |
| 144 |
\def\restmp{\restmppi}% |
| 145 |
}% |
| 146 |
}% |
| 147 |
\ensuremath{\restmp}% |
| 148 |
} |
| 149 |
|
| 150 |
%====FORMATAGE DES RACINES SIMPLES |
| 151 |
\NewDocumentCommand\FormatterRacine{ O{t} m }{% |
| 152 |
\IfStrEq{#2}{0}%cas où l'argument vaut 0 |
| 153 |
{\ensuremath{0}}% |
| 154 |
{% |
| 155 |
\IfSubStr{#2}{sqrt}% |
| 156 |
{% |
| 157 |
\StrDel{#2}{*}[\tmpargbrut]% |
| 158 |
\StrBetween[1,1]{\tmpargbrut}{sqrt(}{)}[\tmpargnumrac]% |
| 159 |
\StrBefore{\tmpargbrut}{sqrt}[\tmparavantrac]% |
| 160 |
\IfStrEqCase{\tmparavantrac}{ |
| 161 |
{}{\xdef\tmparavantrac{}}% |
| 162 |
{-}{\xdef\tmparavantrac{-}}% |
| 163 |
}[\xdef\tmparavantrac{\num{\tmparavantrac}}]% |
| 164 |
\IfSubStr{\tmpargbrut}{/}% |
| 165 |
{% |
| 166 |
\StrBehind{\tmpargbrut}{/}[\tmpargdenomrac]% |
| 167 |
\IfStrEqCase{#1}{% |
| 168 |
{d}{% |
| 169 |
\ensuremath{\displaystyle\frac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}% |
| 170 |
}% |
| 171 |
{t}{% |
| 172 |
\ensuremath{\frac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}% |
| 173 |
}% |
| 174 |
{n}{% |
| 175 |
\ensuremath{\nicefrac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}% |
| 176 |
}% |
| 177 |
}% |
| 178 |
}% |
| 179 |
{% |
| 180 |
\ensuremath{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}% |
| 181 |
}% |
| 182 |
}% |
| 183 |
{% |
| 184 |
\FormatterFraction[#1]{#2}% |
| 185 |
}% |
| 186 |
}% |
| 187 |
} |
| 188 |
|
| 189 |
%====COMMANDE INTERNE DE CONVERSION |
| 190 |
\ExplSyntaxOn |
| 191 |
\NewDocumentCommand\ConvertirPtToCm{ m } { \dim_to_decimal_in_unit:nn { #1 } { 1 cm } } |
| 192 |
\ExplSyntaxOff |
| 193 |
|
| 194 |
%====RECUPERER COORDONNEES NOEUD |
| 195 |
\NewDocumentCommand\RecupererAbscisse{ m O{\monabs} }{% |
| 196 |
\path #1; |
| 197 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 198 |
\xdef#2{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 199 |
} |
| 200 |
\NewDocumentCommand\RecupererOrdonnee{ m O{\monordo} }{% |
| 201 |
\path #1; |
| 202 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 203 |
\xdef#2{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 204 |
} |
| 205 |
|
| 206 |
\NewDocumentCommand\RecupererCoordonnees{ m O{\monabs} O{\monordo} }{% |
| 207 |
\RecupererAbscisse{#1}[#2]% |
| 208 |
\RecupererOrdonnee{#1}[#3]% |
| 209 |
} |
| 210 |
|
| 211 |
%===UNITÉS |
| 212 |
\newcommand\DistanceEntreNoeuds[3][\MyTmpDist]{% |
| 213 |
\pgfpointdiff{\pgfpointanchor{#2}{center}} |
| 214 |
{\pgfpointanchor{#3}{center}} |
| 215 |
% no need to use a new dimen |
| 216 |
\pgf@xa=\pgf@x |
| 217 |
\pgf@ya=\pgf@y |
| 218 |
% to convert from pt to cm |
| 219 |
\pgfmathparse{veclen(\pgf@xa,\pgf@ya)/28.45274} |
| 220 |
\global\let#1\pgfmathresult %macro globale |
| 221 |
} |
| 222 |
|
| 223 |
\newcommand\TikZUnites{ |
| 224 |
\coordinate (@0) at (\pflOx,\pflOy) ; |
| 225 |
\coordinate (@X) at ({\pflOx+1},\pflOy) ; |
| 226 |
\coordinate (@Y) at ({\pflOx},{\pflOy+1}) ; |
| 227 |
\DistanceEntreNoeuds[\pflxunit]{@0}{@X} |
| 228 |
\DistanceEntreNoeuds[\pflyunit]{@0}{@Y} |
| 229 |
} |
| 230 |
|
| 231 |
%TailleGrad=\setlength\pflthickgrad{#1},% |
| 232 |
\defKV[GraphiqueTikz]{% |
| 233 |
TailleGrad=\def\pfltmpthickgrad{#1},% |
| 234 |
Xmin=\def\pflxmintmp{#1},% |
| 235 |
Xmax=\def\pflxmaxtmp{#1},% |
| 236 |
Ymin=\def\pflymintmp{#1},% |
| 237 |
Ymax=\def\pflymaxtmp{#1},% |
| 238 |
Taille=\def\pflgraphdims{#1},% |
| 239 |
Largeur=\def\pflgraphwidth{#1},% |
| 240 |
Hauteur=\def\pflgraphheight{#1},% |
| 241 |
Theme=\def\pflgraphthem{#1},% |
| 242 |
NomFigure=\def\pflgraphnom{#1},% |
| 243 |
XYratio=\def\pflgraphratio{#1},% |
| 244 |
Origx=\def\pflOxtmp{#1},% |
| 245 |
Origy=\def\pflOytmp{#1},% |
| 246 |
Xgrille=\def\pflgrillextmp{#1},% |
| 247 |
Xgrillei=\def\pflgrillexitmp{#1},% |
| 248 |
Xgrilles=\def\pflgrillexstmp{#1},% |
| 249 |
Ygrille=\def\pflgrilleytmp{#1},% |
| 250 |
Ygrillei=\def\pflgrilleyitmp{#1},% |
| 251 |
Ygrilles=\def\pflgrilleystmp{#1}% |
| 252 |
} |
| 253 |
\setKVdefault[GraphiqueTikz]{% |
| 254 |
AffCadre=false,% |
| 255 |
TailleGrad=3pt,% |
| 256 |
Xmin=-3,% |
| 257 |
Xmax=3,% |
| 258 |
Ymin=-3,% |
| 259 |
Ymax=3,% |
| 260 |
Taille={},% |
| 261 |
Largeur={},% |
| 262 |
Hauteur={},% |
| 263 |
Theme={}, |
| 264 |
Milli=false,% |
| 265 |
NomFigure={},% |
| 266 |
XYratio={1},% |
| 267 |
Origx={0},% |
| 268 |
Origy={0},% |
| 269 |
Xgrille={1},% |
| 270 |
Xgrillei={1},% |
| 271 |
Xgrilles={0.5},% |
| 272 |
Ygrille={1},% |
| 273 |
Ygrillei={1},% |
| 274 |
Ygrilles={0.5}% |
| 275 |
} |
| 276 |
|
| 277 |
\newlength\tmptkzgheight |
| 278 |
\newlength\tmptkzgwidth |
| 279 |
|
| 280 |
\NewDocumentEnvironment{GraphiqueTikz}{ O{} D<>{} }% |
| 281 |
%1 = options tikz, classiques |
| 282 |
%2 = clés spécifiques |
| 283 |
{% |
| 284 |
\restoreKV[GraphiqueTikz]% |
| 285 |
\setKV[GraphiqueTikz]{#2}% |
| 286 |
%les graduations |
| 287 |
\IfSubStr{\pfltmpthickgrad}{/}% |
| 288 |
{% |
| 289 |
\StrCut{\pfltmpthickgrad}{/}{\pfltmpthickgradu}{\pfltmpthickgradd}% |
| 290 |
\setlength\pflthickgradu{\pfltmpthickgradu}% |
| 291 |
\setlength\pflthickgradd{\pfltmpthickgradd}% |
| 292 |
}% |
| 293 |
{% |
| 294 |
\setlength\pflthickgradu{\pfltmpthickgrad}% |
| 295 |
\setlength\pflthickgradd{\pfltmpthickgrad}% |
| 296 |
}% |
| 297 |
%l'environnement |
| 298 |
\IfStrEq{\pflgraphdims}{}% |
| 299 |
{%pas de Taille |
| 300 |
\IfStrEq{\pflgraphwidth}{}% |
| 301 |
{%pas de Largeur |
| 302 |
\IfStrEq{\pflgraphheight}{}% |
| 303 |
{%rien du tout → classique |
| 304 |
\begin{tikzpicture}[#1]% |
| 305 |
}% |
| 306 |
{%Hauteur seule + XYratio obligatoire |
| 307 |
\setlength\tmptkzgheight{\pflgraphheight}% |
| 308 |
\setlength\pflglobalheight{\fpeval{(\tmptkzgheight)/(\pflymaxtmp-\pflymintmp)}pt}% |
| 309 |
\setlength\pflglobalwidth{\fpeval{1/(\pflgraphratio)}\pflglobalheight}% |
| 310 |
\begin{tikzpicture}[x=\pflglobalwidth,y=\pflglobalheight, |
| 311 |
Xmin=\pflxmintmp,Xmax=\pflxmaxtmp, |
| 312 |
Ymin=\pflymintmp,Ymax=\pflymaxtmp, |
| 313 |
Xgrille=\pflgrillextmp,Xgrillei=\pflgrillexitmp,Xgrilles=\pflgrillexstmp, |
| 314 |
Ygrille=\pflgrilleytmp,Ygrillei=\pflgrilleyitmp,Ygrilles=\pflgrilleystmp, |
| 315 |
Origx=\pflOxtmp,Origy=\pflOytmp,#1]% |
| 316 |
}% |
| 317 |
}% |
| 318 |
{%Largeur seule |
| 319 |
\setlength\tmptkzgwidth{\pflgraphwidth}% |
| 320 |
\setlength\pflglobalwidth{\fpeval{(\tmptkzgwidth)/(\pflxmaxtmp-\pflxmintmp)}pt}% |
| 321 |
\IfStrEq{\pflgraphheight}{}% |
| 322 |
{%Largeur + XYratio |
| 323 |
\setlength\pflglobalheight{\fpeval{\pflgraphratio}\pflglobalwidth}% |
| 324 |
}% |
| 325 |
{%Largeur + Hauteur explicites |
| 326 |
\setlength\tmptkzgheight{\pflgraphheight}% |
| 327 |
\setlength\pflglobalheight{\fpeval{(\tmptkzgheight)/(\pflymaxtmp-\pflymintmp)}pt}% |
| 328 |
}% |
| 329 |
\begin{tikzpicture}[x=\pflglobalwidth,y=\pflglobalheight, |
| 330 |
Xmin=\pflxmintmp,Xmax=\pflxmaxtmp, |
| 331 |
Ymin=\pflymintmp,Ymax=\pflymaxtmp, |
| 332 |
Xgrille=\pflgrillextmp,Xgrillei=\pflgrillexitmp,Xgrilles=\pflgrillexstmp, |
| 333 |
Ygrille=\pflgrilleytmp,Ygrillei=\pflgrilleyitmp,Ygrilles=\pflgrilleystmp, |
| 334 |
Origx=\pflOxtmp,Origy=\pflOytmp,#1]% |
| 335 |
}% |
| 336 |
}% |
| 337 |
{%Taille=w/h → priorité absolue |
| 338 |
\StrCut{\pflgraphdims}{/}{\pfltmpwidth}{\pfltmpheight}% |
| 339 |
\setlength\pflglobalwidth{\fpeval{(\pfltmpwidth)/(\pflxmaxtmp-\pflxmintmp)}pt}% |
| 340 |
\setlength\pflglobalheight{\fpeval{(\pfltmpheight)/(\pflymaxtmp-\pflymintmp)}pt}% |
| 341 |
\begin{tikzpicture}[x=\pflglobalwidth,y=\pflglobalheight, |
| 342 |
Xmin=\pflxmintmp,Xmax=\pflxmaxtmp, |
| 343 |
Ymin=\pflymintmp,Ymax=\pflymaxtmp, |
| 344 |
Xgrille=\pflgrillextmp,Xgrillei=\pflgrillexitmp,Xgrilles=\pflgrillexstmp, |
| 345 |
Ygrille=\pflgrilleytmp,Ygrillei=\pflgrilleyitmp,Ygrilles=\pflgrilleystmp, |
| 346 |
Origx=\pflOxtmp,Origy=\pflOytmp,#1]% |
| 347 |
}% |
| 348 |
%thèmes personnalisés |
| 349 |
\IfStrEqCase{\pflgraphthem}{% |
| 350 |
{standard}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepdefault!75}}\tikzset{pflgrilles/.style={line width=\pflthickgrids,pflgrillesdefault}}\tikzset{pflgrillei/.style={line width=\pflthickgridi,pflgrilleidefault}}}% |
| 351 |
{gris}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepgray!75}}\tikzset{pflgrilles/.style={line width=\pflthickgrids,pflgrillesgray}}\tikzset{pflgrillei/.style={line width=\pflthickgridi,pflgrilleigray}}}% |
| 352 |
{bleu}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepblue!75}}\tikzset{pflgrilles/.style={line width=\pflthickgrids,pflgrillesblue}}\tikzset{pflgrillei/.style={line width=\pflthickgridi,pflgrilleiblue}}}% |
| 353 |
{vert}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepgreen!75}}\tikzset{pflgrilles/.style={line width=\pflthickgrids,pflgrillesgreen}}\tikzset{pflgrillei/.style={line width=\pflthickgridi,pflgrilleigreen}}}% |
| 354 |
{chaud}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepwarm!75}}\tikzset{pflgrilles/.style={line width=\pflthickgrids,pflgrilleswarm}}\tikzset{pflgrillei/.style={line width=\pflthickgridi,pflgrilleiwarm}}}% |
| 355 |
{contraste}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepcontrast!75}}\tikzset{pflgrilles/.style={line width=\pflthickgrids,pflgrillescontrast}}\tikzset{pflgrillei/.style={line width=\pflthickgridi,pflgrilleicontrast}}}% |
| 356 |
{seyes}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepseyes}}\tikzset{pflgrilles/.style={line width=\pflthickgrids,pflgrillesseyes}}\tikzset{pflgrillei/.style={line width=\pflthickgridi,pflgrilleiseyes}}}% |
| 357 |
}% |
| 358 |
%unités x/y pour des calculs de coordonnées (dommage vu que dans certains cas on les connais déjà :-/) |
| 359 |
\TikZUnites |
| 360 |
%noeuds fenêtre + axes |
| 361 |
\IfStrEq{\pflgraphnom}{}% |
| 362 |
{% |
| 363 |
\coordinate (graphe-ne) at ({\pflxmax},{\pflymax}) ; |
| 364 |
\coordinate (graphe-nw) at ({\pflxmin},{\pflymax}) ; |
| 365 |
\coordinate (graphe-se) at ({\pflxmax},{\pflymin}) ; |
| 366 |
\coordinate (graphe-sw) at ({\pflxmin},{\pflymin}) ; |
| 367 |
\coordinate (graphe-n) at ($(graphe-ne)!0.5!(graphe-nw)$) ; |
| 368 |
\coordinate (graphe-e) at ($(graphe-ne)!0.5!(graphe-se)$) ; |
| 369 |
\coordinate (graphe-s) at ($(graphe-se)!0.5!(graphe-sw)$) ; |
| 370 |
\coordinate (graphe-w) at ($(graphe-sw)!0.5!(graphe-nw)$) ; |
| 371 |
\coordinate (graphe-c) at ($(graphe-sw)!0.5!(graphe-ne)$) ; |
| 372 |
\coordinate (axeox-w) at ({\pflxmin},{\pflOy}) ; |
| 373 |
\coordinate (axeox-e) at ({\pflxmax},{\pflOy}) ; |
| 374 |
\coordinate (axeoy-s) at ({\pflOx},{\pflymin}) ; |
| 375 |
\coordinate (axeoy-n) at ({\pflOx},{\pflymax}) ; |
| 376 |
\coordinate (axes-orig) at ({\pflOx},{\pflOy}) ; |
| 377 |
}% |
| 378 |
{% |
| 379 |
\coordinate (\pflgraphnom-graphe-ne) at ({\pflxmax},{\pflymax}) ; |
| 380 |
\coordinate (\pflgraphnom-graphe-nw) at ({\pflxmin},{\pflymax}) ; |
| 381 |
\coordinate (\pflgraphnom-graphe-se) at ({\pflxmax},{\pflymin}) ; |
| 382 |
\coordinate (\pflgraphnom-graphe-sw) at ({\pflxmin},{\pflymin}) ; |
| 383 |
\coordinate (\pflgraphnom-graphe-n) at ($(\pflgraphnom-graphe-ne)!0.5!(\pflgraphnom-graphe-nw)$) ; |
| 384 |
\coordinate (\pflgraphnom-graphe-e) at ($(\pflgraphnom-graphe-ne)!0.5!(\pflgraphnom-graphe-se)$) ; |
| 385 |
\coordinate (\pflgraphnom-graphe-s) at ($(\pflgraphnom-graphe-se)!0.5!(\pflgraphnom-graphe-sw)$) ; |
| 386 |
\coordinate (\pflgraphnom-graphe-w) at ($(\pflgraphnom-graphe-sw)!0.5!(\pflgraphnom-graphe-nw)$) ; |
| 387 |
\coordinate (\pflgraphnom-graphe-c) at ($(\pflgraphnom-graphe-sw)!0.5!(\pflgraphnom-graphe-ne)$) ; |
| 388 |
\coordinate (\pflgraphnom-axeox-w) at ({\pflxmin},{\pflOy}) ; |
| 389 |
\coordinate (\pflgraphnom-axeox-e) at ({\pflxmax},{\pflOy}) ; |
| 390 |
\coordinate (\pflgraphnom-axeoy-s) at ({\pflOx},{\pflymin}) ; |
| 391 |
\coordinate (\pflgraphnom-axeoy-n) at ({\pflOx},{\pflymax}) ; |
| 392 |
\coordinate (\pflgraphnom-axes-orig) at ({\pflOx},{\pflOy}) ; |
| 393 |
}% |
| 394 |
%noeuds utiles pour les calculs |
| 395 |
\coordinate (bbxTop) at (current bounding box.north) ; |
| 396 |
\coordinate (bbxBottom) at (current bounding box.south) ; |
| 397 |
\ifboolKV[GraphiqueTikz]{AffCadre}{\draw[pflcadre] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}{}% |
| 398 |
%back to normal |
| 399 |
}% |
| 400 |
{% |
| 401 |
\end{tikzpicture}% |
| 402 |
} |
| 403 |
|
| 404 |
%====AXES |
| 405 |
\defKV[GraphiqueTikzAxes]{ |
| 406 |
Format=\def\pflformataxes{#1},% |
| 407 |
Rotation=\def\pfllanglelabel{#1}% |
| 408 |
} |
| 409 |
\setKVdefault[GraphiqueTikzAxes]{% |
| 410 |
Grille=true,% |
| 411 |
Grille Intermediaire=false,% |
| 412 |
Elargir=0,% |
| 413 |
Grads=true,% |
| 414 |
Origine=false,% |
| 415 |
Police={},% |
| 416 |
Format=num,% |
| 417 |
Traits=true,% |
| 418 |
Dernier=false,% |
| 419 |
Derriere=false,% |
| 420 |
Devant=false,% |
| 421 |
Fleches=true,% |
| 422 |
Puissance=true,% |
| 423 |
AxeOy=true,% |
| 424 |
Rotation=0% |
| 425 |
} |
| 426 |
|
| 427 |
\NewDocumentCommand\FormatterValeurAxex{ m m }{% |
| 428 |
\IfStrEqCase{#1}{% |
| 429 |
{num}{\num{#2}}% |
| 430 |
{annee}{#2}% |
| 431 |
{year}{#2}% |
| 432 |
{frac}{\FormatterFraction{#2}}% |
| 433 |
{dfrac}{\FormatterFraction[d]{#2}}% |
| 434 |
{nfrac}{\FormatterFraction[n]{#2}}% |
| 435 |
{trig}{\FormatterTrigo{#2}}% |
| 436 |
{dtrig}{\FormatterTrigo[d]{#2}}% |
| 437 |
{ntrig}{\FormatterTrigo[n]{#2}}% |
| 438 |
{sqrt}{\FormatterRacine{#2}}% |
| 439 |
{dsqrt}{\FormatterRacine[d]{#2}}% |
| 440 |
{nsqrt}{\FormatterRacine[n]{#2}}% |
| 441 |
}[#2]% |
| 442 |
} |
| 443 |
|
| 444 |
\NewDocumentCommand\FormatterValeurAxey{ m m }{% |
| 445 |
\IfStrEqCase{#1}{% |
| 446 |
{num}{\num{#2}}% |
| 447 |
{annee}{#2}% |
| 448 |
{year}{#2}% |
| 449 |
{frac}{\FormatterRacine{#2}}% |
| 450 |
{dfrac}{\FormatterFraction[d]{#2}}% |
| 451 |
{nfrac}{\FormatterFraction[n]{#2}}% |
| 452 |
{trig}{\FormatterTrigo{#2}}% |
| 453 |
{dtrig}{\FormatterTrigo[d]{#2}}% |
| 454 |
{ntrig}{\FormatterTrigo[n]{#2}}% |
| 455 |
{sqrt}{\FormatterRacine{#2}}% |
| 456 |
{dsqrt}{\FormatterRacine[d]{#2}}% |
| 457 |
{nsqrt}{\FormatterRacine[n]{#2}}% |
| 458 |
}[#2]% |
| 459 |
} |
| 460 |
|
| 461 |
\NewDocumentCommand\TracerAxesGrilles{ s O{} m D<>{#3} m D<>{#5} }{% |
| 462 |
\restoreKV[GraphiqueTikzAxes]% |
| 463 |
\setKV[GraphiqueTikzAxes]{#2}% |
| 464 |
%nœuds axes élargis |
| 465 |
\IfStrEq{\pflgraphnom}{}% |
| 466 |
{% |
| 467 |
\coordinate (axeox-ee) at ([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{\pflOy}) ; |
| 468 |
\coordinate (axeoy-nn) at ([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 469 |
}% |
| 470 |
{% |
| 471 |
\coordinate (\pflgraphnom-axeox-ee) at ([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{\pflOy}) ; |
| 472 |
\coordinate (\pflgraphnom-axeoy-nn) at ([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 473 |
}% |
| 474 |
%cas particuliers sous/sur impression |
| 475 |
\ifboolKV[GraphiqueTikzAxes]{Derriere}% |
| 476 |
{% |
| 477 |
\setKV[GraphiqueTikzAxes]{Grads=false} |
| 478 |
}% |
| 479 |
{}% |
| 480 |
\ifboolKV[GraphiqueTikzAxes]{Devant}% |
| 481 |
{% |
| 482 |
\setKV[GraphiqueTikzAxes]{Grille=false} |
| 483 |
}% |
| 484 |
{}% |
| 485 |
%suite |
| 486 |
\IfSubStr{\pflformataxes}{/}% |
| 487 |
{% |
| 488 |
\StrCut{\pflformataxes}{/}{\pflformataxex}{\pflformataxey}% |
| 489 |
}% |
| 490 |
{% |
| 491 |
\xdef\pflformataxex{\pflformataxes}\xdef\pflformataxey{\pflformataxes}% |
| 492 |
}% |
| 493 |
\ifboolKV[GraphiqueTikzAxes]{Grille}% |
| 494 |
{% |
| 495 |
\ifboolKV[GraphiqueTikz]{Milli}% |
| 496 |
{% |
| 497 |
\draw[pflgrilles,xstep=\fpeval{0.1*\pflgrillex},ystep=\fpeval{0.1*\pflgrilley}] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax}); |
| 498 |
\draw[pflgrillei,xstep=\fpeval{0.5*\pflgrillex},ystep=\fpeval{0.5*\pflgrilley}] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax}); |
| 499 |
}% |
| 500 |
{% |
| 501 |
\draw[pflgrilles,xstep=\pflgrillexs,ystep=\pflgrilleys] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax}); |
| 502 |
}% |
| 503 |
\ifboolKV[GraphiqueTikzAxes]{Grille Intermediaire}% |
| 504 |
{% |
| 505 |
\draw[pflgrillei,xstep=\pflgrillexi,ystep=\pflgrilleyi] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax}); |
| 506 |
}% |
| 507 |
{}% |
| 508 |
\draw[pflgrillep,xstep=\pflgrillex,ystep=\pflgrilley] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax}); |
| 509 |
\ifboolKV[GraphiqueTikzAxes]{Dernier}% |
| 510 |
{% |
| 511 |
\draw[pflgrillep] ({\pflxmin},{\pflymax})--({\pflxmax},{\pflymax}) ; |
| 512 |
\draw[pflgrillep] ({\pflxmax},{\pflymin})--({\pflxmax},{\pflymax}) ; |
| 513 |
}% |
| 514 |
{}% |
| 515 |
}% |
| 516 |
{}% |
| 517 |
%axes |
| 518 |
\ifboolKV[GraphiqueTikzAxes]{Fleches}% |
| 519 |
{% |
| 520 |
\draw[pflaxes] ({\pflxmin},{\pflOy}) -- ([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{\pflOy}) ; |
| 521 |
\ifboolKV[GraphiqueTikzAxes]{AxeOy}% |
| 522 |
{% |
| 523 |
\draw[pflaxes] ({\pflOx},{\pflymin}) -- ([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 524 |
}% |
| 525 |
{}% |
| 526 |
}% |
| 527 |
{% |
| 528 |
\draw[pflaxessansfleche] ({\pflxmin},{\pflOy}) -- ([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{\pflOy}) ; |
| 529 |
\ifboolKV[GraphiqueTikzAxes]{AxeOy}% |
| 530 |
{% |
| 531 |
\draw[pflaxessansfleche] ({\pflOx},{\pflymin}) -- ([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 532 |
}% |
| 533 |
{}% |
| 534 |
}% |
| 535 |
\IfEq{#3}{auto}% |
| 536 |
{% |
| 537 |
\xdef\tmprangexvalues{\xintfloateval{seq(i,i=\pflxmin..[\pflgrillex]..\pflxmax)}}\StrDel{\tmprangexvalues}{ }[\tmprangexvalues]% |
| 538 |
\xdef\pflformataxex{num}% |
| 539 |
}% |
| 540 |
{% |
| 541 |
\xdef\tmprangexvalues{#3}% |
| 542 |
}% |
| 543 |
\IfEq{#5}{auto}% |
| 544 |
{% |
| 545 |
\xdef\tmprangeyvalues{\xintfloateval{seq(i,i=\pflymin..[\pflgrilley]..\pflymax)}}\StrDel{\tmprangeyvalues}{ }[\tmprangeyvalues]% |
| 546 |
\xdef\pflformataxey{num}% |
| 547 |
}% |
| 548 |
{% |
| 549 |
\xdef\tmprangeyvalues{#5}% |
| 550 |
}% |
| 551 |
\foreach \x in \tmprangexvalues {\draw[pfltrait] ([yshift=\pflthickgradu]{\x},{\pflOy}) -- ([yshift=-\pflthickgradd]{\x},{\pflOy}) ;}% ++(0,{-2\pflthickgrad}) ;} |
| 552 |
\ifboolKV[GraphiqueTikzAxes]{AxeOy}% |
| 553 |
{% |
| 554 |
\foreach \y in \tmprangeyvalues {\draw[pfltrait] ([xshift=\pflthickgradu]{\pflOx},{\y}) -- ([xshift=-\pflthickgradd]{\pflOx},{\y}) ;}%++({-2\pflthickgrad},0) ;} |
| 555 |
}% |
| 556 |
{}% |
| 557 |
\ifboolKV[GraphiqueTikzAxes]{Grads}% |
| 558 |
{% |
| 559 |
%origine |
| 560 |
\ifboolKV[GraphiqueTikzAxes]{Origine}% |
| 561 |
{% |
| 562 |
\draw ({\pflOx},{\pflOy}) node[pflnoeud,below left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\pflOx}} ; |
| 563 |
}% |
| 564 |
{}% |
| 565 |
%graduations x, sauf si auto... |
| 566 |
\foreach \x in \tmprangexvalues {% |
| 567 |
\IfBooleanTF{#1}% |
| 568 |
{% |
| 569 |
\xintifboolexpr{\x == \pflOx}{}{\draw ([yshift={-\pflthickgradd}]{\x},{\pflOy}) node[pflnoeud,below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\x}} ;} |
| 570 |
}% |
| 571 |
{% |
| 572 |
\draw ([yshift={-\pflthickgradd}]{\x},{\pflOy}) node[pflnoeud,below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\x}} ; |
| 573 |
}% |
| 574 |
}% |
| 575 |
\ifboolKV[GraphiqueTikzAxes]{AxeOy}% |
| 576 |
{% |
| 577 |
\foreach \y in \tmprangeyvalues {% |
| 578 |
\IfBooleanTF{#1}% |
| 579 |
{% |
| 580 |
\xintifboolexpr{\y == \pflOy}{}{\draw ([xshift={-\pflthickgradd}]{\pflOx},{\y}) node[pflnoeud,left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxey{\pflformataxey}{\y}} ;} |
| 581 |
}% |
| 582 |
{% |
| 583 |
\draw ([xshift={-\pflthickgradd}]{\pflOx},{\y}) node[pflnoeud,left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxey{\pflformataxey}{\y}} ; |
| 584 |
}% |
| 585 |
}% |
| 586 |
}% |
| 587 |
{}% |
| 588 |
}% |
| 589 |
{ |
| 590 |
\ifboolKV[GraphiqueTikzAxes]{Origine}% |
| 591 |
{% |
| 592 |
\draw ({\pflOx},{\pflOy}) node[pflnoeud,below left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\pflOx}} ; |
| 593 |
}% |
| 594 |
{}% |
| 595 |
}% |
| 596 |
} |
| 597 |
|
| 598 |
\NewDocumentCommand\TracerAxesGrillePol{ O{} m m }{% |
| 599 |
\restoreKV[GraphiqueTikzAxes]% |
| 600 |
\setKV[GraphiqueTikzAxes]{#1}% |
| 601 |
%cercles secondaires |
| 602 |
\foreach \r in {\pflpolgrids,\fpeval{2*\pflpolgrids},...,\pflpolrayonmax}{% |
| 603 |
\draw[pflgrilles] (0,0) circle[radius=\r] ; |
| 604 |
}% |
| 605 |
%cercles ppaux |
| 606 |
\foreach \r in {\pflpolgrid,\fpeval{2*\pflpolgrid},...,\pflpolrayonmax}{% |
| 607 |
\draw[pflgrillep] (0,0) circle[radius=\r] ; |
| 608 |
}% |
| 609 |
%droites radiales secondaires |
| 610 |
\foreach \a in {0,\pflgrillets,...,180}{% |
| 611 |
\draw[pflgrilles] ({-(\pflpolrayonmax)*cos(\a)},{-(\pflpolrayonmax)*sin(\a)}) -- |
| 612 |
({(\pflpolrayonmax)*cos(\a)},{(\pflpolrayonmax)*sin(\a)}) ; |
| 613 |
}% |
| 614 |
%droites radiales ppales |
| 615 |
\foreach \a in {0,\pflgrillet,...,180}{% |
| 616 |
\draw[pflgrillep] ({-(\pflpolrayonmax)*cos(\a)},{-(\pflpolrayonmax)*sin(\a)}) -- |
| 617 |
({(\pflpolrayonmax)*cos(\a)},{(\pflpolrayonmax)*sin(\a)}) ; |
| 618 |
}% |
| 619 |
%ensuite les axes, via la macro principale |
| 620 |
\TracerAxesGrilles[#1,Grille=false]{#2}{#3} |
| 621 |
} |
| 622 |
|
| 623 |
%===DEFINIR POINTS |
| 624 |
\setKVdefault[GraphiqueTikzDefPoints]{Couleur=black,Aff=false,Style=o} |
| 625 |
|
| 626 |
\NewDocumentCommand\DefinirPts{ O{} m }{% |
| 627 |
\restoreKV[GraphiqueTikzDefPoints]% |
| 628 |
\setKV[GraphiqueTikzDefPoints]{#1}% |
| 629 |
\foreach \tmpnamept/\tmpxpt/\tmpypt in {#2}{% |
| 630 |
\coordinate (\tmpnamept) at ({\tmpxpt},{\tmpypt}) ; |
| 631 |
\ifboolKV[GraphiqueTikzDefPoints]{Aff}% |
| 632 |
{% |
| 633 |
\MarquerPts*[Style={\useKV[GraphiqueTikzDefPoints]{Style}},Couleur={\useKV[GraphiqueTikzDefPoints]{Couleur}}]{(\tmpnamept)} |
| 634 |
}% |
| 635 |
{}% |
| 636 |
} |
| 637 |
} |
| 638 |
|
| 639 |
\defKV[GraphiqueTikzMarkPoints]{% |
| 640 |
Couleur=\def\pflcouleurpoints{#1},% |
| 641 |
Style=\def\pflstylepoints{#1} |
| 642 |
} |
| 643 |
\setKVdefault[GraphiqueTikzMarkPoints]{% |
| 644 |
Couleur=black,% |
| 645 |
Taillec=2pt,% |
| 646 |
Taillex=2pt,% |
| 647 |
Tailleo=1.75pt,% |
| 648 |
Style=o,% |
| 649 |
Traits=false,% |
| 650 |
ModeTransfo={} |
| 651 |
} |
| 652 |
\NewDocumentCommand\MarquerPts{ s O{} D<>{\normalfont\normalsize} m }{% |
| 653 |
%étoilée = sans label |
| 654 |
%2=clés |
| 655 |
%3=points |
| 656 |
\restoreKV[GraphiqueTikzMarkPoints]% |
| 657 |
\setKV[GraphiqueTikzMarkPoints]{#2}% |
| 658 |
\IfBooleanTF{#1}% |
| 659 |
{% |
| 660 |
\IfStrEq{\pflstylepoints}{x}% |
| 661 |
{% |
| 662 |
\foreach \Point in {#4} {% |
| 663 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 664 |
{% |
| 665 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 666 |
}% |
| 667 |
{}% |
| 668 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/45} ; |
| 669 |
}% |
| 670 |
}% |
| 671 |
{}% |
| 672 |
\IfStrEq{\pflstylepoints}{+}% |
| 673 |
{% |
| 674 |
\foreach \Point in {#4} {% |
| 675 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 676 |
{% |
| 677 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 678 |
}% |
| 679 |
{}% |
| 680 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/90} ; |
| 681 |
}% |
| 682 |
}% |
| 683 |
{}% |
| 684 |
\IfStrEq{\pflstylepoints}{c}% |
| 685 |
{% |
| 686 |
\foreach \Point in {#4} {% |
| 687 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 688 |
{% |
| 689 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 690 |
}% |
| 691 |
{}% |
| 692 |
\filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Taillec}}/0} ; |
| 693 |
}% |
| 694 |
}% |
| 695 |
{}% |
| 696 |
\IfStrEq{\pflstylepoints}{d}% |
| 697 |
{% |
| 698 |
\foreach \Point in {#4} {% |
| 699 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 700 |
{% |
| 701 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 702 |
}% |
| 703 |
{}% |
| 704 |
\filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}/45} ; |
| 705 |
}% |
| 706 |
}% |
| 707 |
{}% |
| 708 |
\IfStrEq{\pflstylepoints}{o}% |
| 709 |
{% |
| 710 |
\IfSubStr{\pflcouleurpoints}{/}% |
| 711 |
{% |
| 712 |
\StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}% |
| 713 |
\foreach \Point in {#4} {% |
| 714 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 715 |
{% |
| 716 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 717 |
}% |
| 718 |
{}% |
| 719 |
\filldraw[pfltrait,fill=\pflcouleurpointsB,draw=\pflcouleurpointsA] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ; |
| 720 |
}% |
| 721 |
}% |
| 722 |
{% |
| 723 |
\foreach \Point in {#4} {% |
| 724 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 725 |
{% |
| 726 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 727 |
}% |
| 728 |
{}% |
| 729 |
\filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ; |
| 730 |
}% |
| 731 |
}% |
| 732 |
}% |
| 733 |
{}% |
| 734 |
\IfStrEq{\pflstylepoints}{ggb}% |
| 735 |
{% |
| 736 |
\IfSubStr{\pflcouleurpoints}{/}% |
| 737 |
{% |
| 738 |
\StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}% |
| 739 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 740 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 741 |
{% |
| 742 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 743 |
}% |
| 744 |
{}% |
| 745 |
\draw[pflpointggb,\pflcouleurpointsA,fill=\pflcouleurpointsB] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ; |
| 746 |
}% |
| 747 |
}% |
| 748 |
{% |
| 749 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 750 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 751 |
{% |
| 752 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 753 |
}% |
| 754 |
{}% |
| 755 |
\filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] ; |
| 756 |
}% |
| 757 |
}% |
| 758 |
}% |
| 759 |
{}% |
| 760 |
}% |
| 761 |
{%avec label |
| 762 |
\IfStrEq{\pflstylepoints}{x}% |
| 763 |
{% |
| 764 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 765 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 766 |
{% |
| 767 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 768 |
}% |
| 769 |
{}% |
| 770 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/45} node[pflnoeud,\Pos,font=#3] {\Label} ; |
| 771 |
}% |
| 772 |
}% |
| 773 |
{}% |
| 774 |
\IfStrEq{\pflstylepoints}{+}% |
| 775 |
{% |
| 776 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 777 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 778 |
{% |
| 779 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 780 |
}% |
| 781 |
{}% |
| 782 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcroix={\useKV[GraphiqueTikzMarkPoints]{Taillex}}/90} node[pflnoeud,\Pos,font=#3] {\Label} ; |
| 783 |
}% |
| 784 |
}% |
| 785 |
{}% |
| 786 |
\IfStrEq{\pflstylepoints}{c}% |
| 787 |
{% |
| 788 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 789 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 790 |
{% |
| 791 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 792 |
}% |
| 793 |
{}% |
| 794 |
\filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Taillec}}/0} node[pflnoeud,\Pos,{\useKV[GraphiqueTikzMarkPoints]{Couleur}},font=#3] {\Label} ; |
| 795 |
}% |
| 796 |
}% |
| 797 |
{}% |
| 798 |
\IfStrEq{\pflstylepoints}{d}% |
| 799 |
{% |
| 800 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 801 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 802 |
{% |
| 803 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 804 |
}% |
| 805 |
{}% |
| 806 |
\filldraw[draw=none,fill={\useKV[GraphiqueTikzMarkPoints]{Couleur}}] \Point pic{pflptcarre={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}/45} node[pflnoeud,\Pos,{\useKV[GraphiqueTikzMarkPoints]{Couleur}},font=#3] {\Label} ; |
| 807 |
}% |
| 808 |
}% |
| 809 |
{}% |
| 810 |
\IfStrEq{\pflstylepoints}{o}% |
| 811 |
{% |
| 812 |
\IfSubStr{\pflcouleurpoints}{/}% |
| 813 |
{% |
| 814 |
\StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}% |
| 815 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 816 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 817 |
{% |
| 818 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 819 |
}% |
| 820 |
{}% |
| 821 |
\draw[pfltrait,\pflcouleurpointsA,fill=\pflcouleurpointsB] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] node[pflnoeud,\Pos,font=#3] {\Label} ; |
| 822 |
}% |
| 823 |
}% |
| 824 |
{% |
| 825 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 826 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 827 |
{% |
| 828 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 829 |
}% |
| 830 |
{}% |
| 831 |
\filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] node[pflnoeud,\Pos,font=#3] {\Label} ; |
| 832 |
}% |
| 833 |
}% |
| 834 |
}% |
| 835 |
{}% |
| 836 |
\IfStrEq{\pflstylepoints}{ggb}% |
| 837 |
{% |
| 838 |
\IfSubStr{\pflcouleurpoints}{/}% |
| 839 |
{% |
| 840 |
\StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}% |
| 841 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 842 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 843 |
{% |
| 844 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 845 |
}% |
| 846 |
{}% |
| 847 |
\draw[pflpointggb,\pflcouleurpointsA,fill=\pflcouleurpointsB] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] node[pflnoeud,\Pos,font=#3] {\Label} ; |
| 848 |
}% |
| 849 |
}% |
| 850 |
{% |
| 851 |
\foreach \Point/\Label/\Pos in {#4} {% |
| 852 |
\ifboolKV[GraphiqueTikzMarkPoints]{Traits}% |
| 853 |
{% |
| 854 |
\draw[{\useKV[GraphiqueTikzMarkPoints]{Couleur}},pfltraitantec] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 855 |
}% |
| 856 |
{}% |
| 857 |
\filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphiqueTikzMarkPoints]{Tailleo}}] node[pflnoeud,\Pos,font=#3] {\Label} ; |
| 858 |
}% |
| 859 |
}% |
| 860 |
}% |
| 861 |
{}% |
| 862 |
}% |
| 863 |
} |
| 864 |
|
| 865 |
%===AJOUTER DES VALEURS MANUELLEMENT |
| 866 |
\NewDocumentCommand\RajouterValeursAxeX{ O{} m m }{% |
| 867 |
\restoreKV[GraphiqueTikzAxes]% |
| 868 |
\setKV[GraphiqueTikzAxes]{#1}% |
| 869 |
\ifboolKV[GraphiqueTikzAxes]{Traits}{\foreach \x in {#2}{\draw[pfltrait] ([yshift=\pflthickgradu]{\x},{\pflOy})--++(0,{-\pflthickgradu-\pflthickgradd}) ;}}{}% |
| 870 |
\setsepchar{,}% |
| 871 |
\readlist*\LstValX{#2}% |
| 872 |
\readlist*\LstValFmtX{#3}% |
| 873 |
\foreach \i in {1,...,\LstValXlen}{% |
| 874 |
\itemtomacro\LstValX[\i]\mavalx% |
| 875 |
\itemtomacro\LstValFmtX[\i]\mavalfmtx% |
| 876 |
\draw ([yshift={-\pflthickgradd}]{\mavalx},{\pflOy}) node[pflnoeud,below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\mavalfmtx} ; |
| 877 |
}% |
| 878 |
} |
| 879 |
|
| 880 |
\NewDocumentCommand\RajouterValeursAxeY{ O{} m m }{% |
| 881 |
\restoreKV[GraphiqueTikzAxes]% |
| 882 |
\setKV[GraphiqueTikzAxes]{#1}% |
| 883 |
\ifboolKV[GraphiqueTikzAxes]{Traits}{\foreach \y in {#2}{\draw[pfltrait] ([xshift=\pflthickgradu]{\pflOx},{\y})--++({-\pflthickgradu-\pflthickgradd},0) ;}}{}% |
| 884 |
\setsepchar{,}% |
| 885 |
\readlist*\LstValY{#2}% |
| 886 |
\readlist*\LstValFmtY{#3}% |
| 887 |
\foreach \i in {1,...,\LstValYlen}{% |
| 888 |
\itemtomacro\LstValY[\i]\mavaly% |
| 889 |
\itemtomacro\LstValFmtY[\i]\mavalfmty% |
| 890 |
\draw ([xshift={-\pflthickgradd}]{\pflOx},{\mavaly}) node[pflnoeud,left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\mavalfmty} ; |
| 891 |
}% |
| 892 |
} |
| 893 |
|
| 894 |
\NewDocumentCommand\RajouterLabelsAxeX{ O{} m m }{% |
| 895 |
\restoreKV[GraphiqueTikzAxes]% |
| 896 |
\setKV[GraphiqueTikzAxes]{#1}% |
| 897 |
\ifboolKV[GraphiqueTikzAxes]{Traits}{\foreach \x in {#2}{\draw[pfltrait] ([yshift=\pflthickgradu]{\x},{\pflOy})--++(0,{-\pflthickgradu-\pflthickgradd}) ;}}{}% |
| 898 |
\IfEq{\pfllanglelabel}{0}% |
| 899 |
{% |
| 900 |
\tikzset{pfllegendelabelsqualix/.style={font=\small,below}} |
| 901 |
}% |
| 902 |
{% |
| 903 |
\xintifboolexpr{ \pfllanglelabel > 0 }% |
| 904 |
{% |
| 905 |
\tikzset{pfllegendelabelsqualix/.style={font=\small,rotate=\pfllanglelabel,anchor=east}} |
| 906 |
}% |
| 907 |
{% |
| 908 |
\tikzset{pfllegendelabelsqualix/.style={font=\small,rotate=\pfllanglelabel,anchor=west}} |
| 909 |
}% |
| 910 |
}% |
| 911 |
\setsepchar{,}% |
| 912 |
\readlist*\LstValX{#2}% |
| 913 |
\readlist*\LstValFmtX{#3}% |
| 914 |
\foreach \i in {1,...,\LstValXlen}{% |
| 915 |
\itemtomacro\LstValX[\i]\mavalx% |
| 916 |
\itemtomacro\LstValFmtX[\i]\mavalfmtx% |
| 917 |
\draw ([yshift={-\pflthickgradd}]{\mavalx},{\pflOy}) node[pfllegendelabelsqualix,font={\useKV[GraphiqueTikzAxes]{Police}}] {\mavalfmtx} ; |
| 918 |
}% |
| 919 |
} |
| 920 |
|
| 921 |
\NewDocumentCommand\RajouterLabelsAxeY{ O{} m m }{% |
| 922 |
\restoreKV[GraphiqueTikzAxes]% |
| 923 |
\setKV[GraphiqueTikzAxes]{#1}% |
| 924 |
\ifboolKV[GraphiqueTikzAxes]{Traits}{\foreach \y in {#2}{\draw[pfltrait] ([xshift=\pflthickgradu]{\pflOx},{\y})--++({-\pflthickgradu-\pflthickgradd},0) ;}}{}% |
| 925 |
\IfEq{\pfllanglelabel}{0}% |
| 926 |
{% |
| 927 |
\tikzset{pfllegendelabelsqualiy/.style={font=\small,left}} |
| 928 |
}% |
| 929 |
{% |
| 930 |
\tikzset{pfllegendelabelsqualiy/.style={font=\small,left,rotate=\pfllanglelabel,anchor=east}} |
| 931 |
}% |
| 932 |
\setsepchar{,}% |
| 933 |
\readlist*\LstValY{#2}% |
| 934 |
\readlist*\LstValFmtY{#3}% |
| 935 |
\foreach \i in {1,...,\LstValYlen}{% |
| 936 |
\itemtomacro\LstValY[\i]\mavaly% |
| 937 |
\itemtomacro\LstValFmtY[\i]\mavalfmty% |
| 938 |
\draw ([xshift={-\pflthickgradd}]{\pflOx},{\mavaly}) node[pfllegendelabelsqualiy,font={\useKV[GraphiqueTikzAxes]{Police}}] {\mavalfmty} ; |
| 939 |
}% |
| 940 |
} |
| 941 |
|
| 942 |
\NewDocumentCommand\GenererPolynomeLagrange{ O{polylagrange} m m }{% (merci jfb pour son aide !!!!!!!!!!) syntaxe particulière |
| 943 |
% #1 = argument optionnel, nom du polynôme complet polylagrange |
| 944 |
% #2 = liste séparée par virgules x_1, ..., x_N |
| 945 |
% #3 = liste séparée par virgules y_1, ..., y_N |
| 946 |
% ------------------------------- |
| 947 |
% #2 et #3 peuvent être n'importe quoi dont l'expansion complète |
| 948 |
% donne le même nombre de termes séparés par des virgules. |
| 949 |
% De plus ils peuvent utiliser la syntaxe de xint. |
| 950 |
% ------------------------------- |
| 951 |
\xintdeffloatvar tmp_List_X = [#2];% |
| 952 |
\xintdeffloatvar tmp_List_Y = [#3];% |
| 953 |
% récupérer la longueur |
| 954 |
\edef\tmpN{\xinteval{len(*tmp_List_X)}}% |
| 955 |
% assigner les entrées à des variables temporaires |
| 956 |
\xintdeffloatvar \xintiloop [1+1] tmp_x_\xintiloopindex |
| 957 |
\ifnum\xintiloopindex<\tmpN\space,\repeat=*tmp_List_X;% |
| 958 |
\xintdeffloatvar \xintiloop [1+1] tmp_y_\xintiloopindex |
| 959 |
\ifnum\xintiloopindex<\tmpN\space,\repeat=*tmp_List_Y;% |
| 960 |
% Définition de polynômes interpolateurs élémentaires |
| 961 |
% Attention lorsque l'on va définir le polynôme final |
| 962 |
% comme combinaison linéaire, les polynômes élémentaires |
| 963 |
% resteront présents par leurs symboles car ils auront |
| 964 |
% une indéterminée comme variable. |
| 965 |
% Il faut donc que leurs noms soient dans le même namespace |
| 966 |
% que le polynôme final. C'est donc ici #1 le name space. (OK !) |
| 967 |
\xintFor* ##1 in {\xintSeq{1}{\tmpN}}\do{% |
| 968 |
\xintdeffloatfunc #1_##1(x) = |
| 969 |
iter(1; (i==##1)?{omit}{@*(x - tmp_x_\xintiieval{i})}, i=1..\tmpN)/ |
| 970 |
iter(1; (i==##1)?{omit}{@*(tmp_x_##1 - tmp_x_\xintiieval{i})}, i=1..\tmpN);% |
| 971 |
}% |
| 972 |
% Définition du polynôme somme des y_i * L_i(x) \xintdeffunc Lagrange(x) |
| 973 |
\xintdeffloatfunc #1(x) = add(tmp_y_\xinteval{i} * #1_\xinteval{i}(x), i=1..\tmpN);% |
| 974 |
} |
| 975 |
\NewCommandCopy\DefineLagrangeCurve\GenererPolynomeLagrange |
| 976 |
|
| 977 |
\NewDocumentCommand\MarquerPtsLagrange{ s O{} D<>{\normalfont\normalsize} m m }{% |
| 978 |
%#4 & #5 = liste des points, comme pour générer |
| 979 |
\setsepchar{,}% |
| 980 |
\readlist*\lagrangepointsabs{#4}% |
| 981 |
\readlist*\lagrangepointsordo{#5}% |
| 982 |
\foreach \i in {1,...,\lagrangepointsabslen}{% |
| 983 |
\IfBooleanTF{#1}% |
| 984 |
{\MarquerPts*[#2]<#3>{({\lagrangepointsabs[\i]},{\lagrangepointsordo[\i]})}}% |
| 985 |
{\MarquerPts[#2]<#3>{({\lagrangepointsabs[\i]},{\lagrangepointsordo[\i]})}}% |
| 986 |
}% |
| 987 |
} |
| 988 |
|
| 989 |
%====FONCTIONS ET COURBES 'classique + interpo + spline + dérivée + primitive' |
| 990 |
\defKV[GraphiqueTikzCourbe]{% |
| 991 |
Pas=\def\pflstepcurve{#1},% |
| 992 |
Nom=\def\pflnamecurve{#1},% |
| 993 |
StyleTrace=\def\pflstylecurve{#1},% |
| 994 |
DeltaVI=\def\pfldeltavi{#1},% |
| 995 |
h=\def\pflhderiv{#1},% |
| 996 |
ValeursInterdites=\def\pflvalsinterdites{#1},% |
| 997 |
Sens=\def\pflsensparab{#1} |
| 998 |
} |
| 999 |
\setKVdefault[GraphiqueTikzCourbe]{% |
| 1000 |
Couleur=black,% |
| 1001 |
Debut={\pflxmin},% |
| 1002 |
Fin={\pflxmax},% |
| 1003 |
Pas={},% |
| 1004 |
Clip=true,% |
| 1005 |
Nom={},% |
| 1006 |
Trace=false,% |
| 1007 |
Tension=0.5,% |
| 1008 |
StyleTrace={},% |
| 1009 |
RestreindreY=false,% |
| 1010 |
Restreindre=false,% |
| 1011 |
h={},% |
| 1012 |
DeltaVI={auto},% |
| 1013 |
Spline=false,% |
| 1014 |
ValeursInterdites={},% |
| 1015 |
Sens=V,% |
| 1016 |
DefGlobale=false |
| 1017 |
} |
| 1018 |
|
| 1019 |
\NewDocumentCommand\DefinirFonction{ O{} D<>{f} m }{%old version |
| 1020 |
\restoreKV[GraphiqueTikzCourbe]% |
| 1021 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 1022 |
\xintdeffloatfunc #2(x) := #3 ; |
| 1023 |
\IfStrEq{\pflstepcurve}{}% |
| 1024 |
{% |
| 1025 |
\IfStrEq{\pflvalsinterdites}{}% |
| 1026 |
{% |
| 1027 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}% |
| 1028 |
}% |
| 1029 |
{% |
| 1030 |
|
| 1031 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/250}}% |
| 1032 |
}% |
| 1033 |
}% |
| 1034 |
{}% |
| 1035 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{} |
| 1036 |
%suite |
| 1037 |
\ifboolKV[GraphiqueTikzCourbe]{Trace}% |
| 1038 |
{% |
| 1039 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1040 |
plot[smooth] coordinates {% |
| 1041 |
\xintthecoords\xintfloatexpr seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1042 |
\relax} |
| 1043 |
; |
| 1044 |
}% |
| 1045 |
{% |
| 1046 |
\path[draw=none,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {% |
| 1047 |
\xintthecoords\xintfloatexpr |
| 1048 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1049 |
\relax |
| 1050 |
}; |
| 1051 |
}% |
| 1052 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{} |
| 1053 |
} |
| 1054 |
|
| 1055 |
\NewDocumentCommand\DefinirCourbe{ O{} D<>{f} m }{% |
| 1056 |
\restoreKV[GraphiqueTikzCourbe]% |
| 1057 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 1058 |
\ifboolKV[GraphiqueTikzCourbe]{DefGlobale}{\xintglobaldefstrue}{}% |
| 1059 |
\xintdeffloatfunc #2(x) := #3 ; |
| 1060 |
\ifboolKV[GraphiqueTikzCourbe]{DefGlobale}{\xintglobaldefsfalse}{}% |
| 1061 |
%test dimension too large |
| 1062 |
\xdef\pfloffsetV{\xintfloateval{((\pflymax)-(\pflymin))/20}}% |
| 1063 |
\xdef\pflMinoffsetV{\xintfloateval{(\pflymin)-(\pfloffsetV)}}% |
| 1064 |
\xdef\pflMaxoffsetV{\xintfloateval{(\pflymax)+(\pfloffsetV)}}% |
| 1065 |
%bifurcation BI/noVI |
| 1066 |
\IfStrEq{\pflvalsinterdites}{}% |
| 1067 |
{%si pas de VI, code direct |
| 1068 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}% |
| 1069 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{} |
| 1070 |
\ifboolKV[GraphiqueTikzCourbe]{Trace}% |
| 1071 |
{% |
| 1072 |
\ifboolKV[GraphiqueTikzCourbe]{RestreindreY}% |
| 1073 |
{% |
| 1074 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1075 |
plot[smooth] coordinates {% |
| 1076 |
\xintthecoords\xintfloatexpr |
| 1077 |
seq((x,min(max(#2(x),\pflMinoffsetV),\pflMaxoffsetV)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1078 |
\relax |
| 1079 |
}; |
| 1080 |
}% |
| 1081 |
{% |
| 1082 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1083 |
plot[smooth] coordinates {% |
| 1084 |
\xintthecoords\xintfloatexpr |
| 1085 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1086 |
\relax |
| 1087 |
}; |
| 1088 |
}% |
| 1089 |
}% |
| 1090 |
{% |
| 1091 |
\ifboolKV[GraphiqueTikzCourbe]{RestreindreY}% |
| 1092 |
{% |
| 1093 |
\path[draw=none,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1094 |
plot[smooth] coordinates {% |
| 1095 |
\xintthecoords\xintfloatexpr |
| 1096 |
seq((x,min(max(#2(x),\pflMinoffsetV),\pflMaxoffsetV)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1097 |
\relax |
| 1098 |
}; |
| 1099 |
}% |
| 1100 |
{% |
| 1101 |
\path[draw=none,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1102 |
plot[smooth] coordinates {% |
| 1103 |
\xintthecoords\xintfloatexpr |
| 1104 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1105 |
\relax |
| 1106 |
}; |
| 1107 |
}% |
| 1108 |
}% |
| 1109 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{} |
| 1110 |
}% |
| 1111 |
{%sinon, VI, code spécifique |
| 1112 |
\IfStrEq{\pfldeltavi}{auto}% |
| 1113 |
{% |
| 1114 |
\xdef\pfldeltavi{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/250}}% |
| 1115 |
}% |
| 1116 |
{}% |
| 1117 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/250}}% |
| 1118 |
%génération des branches, si VI |
| 1119 |
\xdef\pfllistebornes{\useKV[GraphiqueTikzCourbe]{Debut}}% |
| 1120 |
\foreach \i in \pflvalsinterdites {% |
| 1121 |
%\xdef\pfllistebornes{\pfllistebornes,\xintfloateval{\i-(\pflstepcurve)},\xintfloateval{\i+(\pflstepcurve)}}%\pfldeltavi |
| 1122 |
\xdef\pfllistebornes{\pfllistebornes,\xintfloateval{\i-(\pfldeltavi)},\xintfloateval{\i+(\pfldeltavi)}}% |
| 1123 |
}% |
| 1124 |
\xdef\pfllistebornes{\pfllistebornes,\useKV[GraphiqueTikzCourbe]{Fin}}% |
| 1125 |
\setsepchar{,}% |
| 1126 |
\readlist*\tkzintlistebornes{\pfllistebornes}% |
| 1127 |
\xdef\tkzgrphnbbranches{\fpeval{\tkzintlisteborneslen/2}}% |
| 1128 |
%suite |
| 1129 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{} |
| 1130 |
\ifboolKV[GraphiqueTikzCourbe]{Trace}% |
| 1131 |
{% |
| 1132 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1133 |
\foreach \ib [evaluate=\ib as \ibdeb using {int(2*\ib-1)},evaluate=\ib as \ibfin using {int(2*\ib)}] in {1,...,\tkzgrphnbbranches}{% |
| 1134 |
plot[smooth] coordinates {% |
| 1135 |
\xintthecoords\xintfloatexpr seq((x,min(max(#2(x),\pflMinoffsetV),\pflMaxoffsetV)), x={\tkzintlistebornes[\ibdeb]}..[\pflstepcurve]..{\tkzintlistebornes[\ibfin]},{\tkzintlistebornes[\ibfin]}) \relax} |
| 1136 |
} ;% |
| 1137 |
}% |
| 1138 |
{% |
| 1139 |
\path[draw=none,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1140 |
\foreach \ib [evaluate=\ib as \ibdeb using {int(2*\ib-1)},evaluate=\ib as \ibfin using {int(2*\ib)}] in {1,...,\tkzgrphnbbranches}{% |
| 1141 |
plot[smooth] coordinates {% |
| 1142 |
\xintthecoords\xintfloatexpr seq((x,min(max(#2(x),\pflMinoffsetV),\pflMaxoffsetV)), x={\tkzintlistebornes[\ibdeb]}..[\pflstepcurve]..{\tkzintlistebornes[\ibfin]},{\tkzintlistebornes[\ibfin]}) \relax} |
| 1143 |
} ; |
| 1144 |
}% |
| 1145 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{} |
| 1146 |
}% |
| 1147 |
} |
| 1148 |
|
| 1149 |
\NewDocumentCommand\TracerCourbe{ O{} D<>{} m }{% |
| 1150 |
\restoreKV[GraphiqueTikzCourbe]% |
| 1151 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 1152 |
%test dimension too large |
| 1153 |
\xdef\pfloffsetV{\xintfloateval{((\pflymax)-(\pflymin))/20}}% |
| 1154 |
\xdef\pflMinoffsetV{\xintfloateval{(\pflymin)-(\pfloffsetV)}}% |
| 1155 |
\xdef\pflMaxoffsetV{\xintfloateval{(\pflymax)+(\pfloffsetV)}}% |
| 1156 |
%bifurcation BI/noVI |
| 1157 |
\IfStrEq{\pflvalsinterdites}{}% |
| 1158 |
{%si pas de VI, code direct |
| 1159 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}% |
| 1160 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{} |
| 1161 |
\IfStrEq{\pflnamecurve}{}% |
| 1162 |
{% |
| 1163 |
\ifboolKV[GraphiqueTikzCourbe]{RestreindreY}% |
| 1164 |
{% |
| 1165 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] |
| 1166 |
plot[smooth] coordinates {% |
| 1167 |
\xintthecoords\xintfloatexpr |
| 1168 |
seq((x,min(max(#3,\pflMinoffsetV),\pflMaxoffsetV)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1169 |
\relax |
| 1170 |
}; |
| 1171 |
}% |
| 1172 |
{% |
| 1173 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] |
| 1174 |
plot[smooth] coordinates {% |
| 1175 |
\xintthecoords\xintfloatexpr |
| 1176 |
seq((x,#3),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1177 |
\relax |
| 1178 |
}; |
| 1179 |
}% |
| 1180 |
}% |
| 1181 |
{% |
| 1182 |
\ifboolKV[GraphiqueTikzCourbe]{RestreindreY}% |
| 1183 |
{% |
| 1184 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1185 |
plot[smooth] coordinates {% |
| 1186 |
\xintthecoords\xintfloatexpr |
| 1187 |
seq((x,min(max(#3,\pflMinoffsetV),\pflMaxoffsetV)),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1188 |
\relax |
| 1189 |
}; |
| 1190 |
}% |
| 1191 |
{% |
| 1192 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1193 |
plot[smooth] coordinates {% |
| 1194 |
\xintthecoords\xintfloatexpr |
| 1195 |
seq((x,#3),x={\useKV[GraphiqueTikzCourbe]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzCourbe]{Fin}},{\useKV[GraphiqueTikzCourbe]{Fin}}) |
| 1196 |
\relax |
| 1197 |
}; |
| 1198 |
}% |
| 1199 |
}% |
| 1200 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{} |
| 1201 |
}% |
| 1202 |
{%sinon, VI, code spécifique |
| 1203 |
\IfStrEq{\pfldeltavi}{auto}% |
| 1204 |
{% |
| 1205 |
\xdef\pfldeltavi{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/250}}% |
| 1206 |
}% |
| 1207 |
{}% |
| 1208 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/250}}% |
| 1209 |
%génération des branches, si VI |
| 1210 |
\xdef\pfllistebornes{\useKV[GraphiqueTikzCourbe]{Debut}}% |
| 1211 |
\foreach \i in \pflvalsinterdites {% |
| 1212 |
%\xdef\pfllistebornes{\pfllistebornes,\xintfloateval{\i-(\pflstepcurve)},\xintfloateval{\i+(\pflstepcurve)}}%\pfldeltavi |
| 1213 |
\xdef\pfllistebornes{\pfllistebornes,\xintfloateval{\i-(\pfldeltavi)},\xintfloateval{\i+(\pfldeltavi)}}% |
| 1214 |
}% |
| 1215 |
\xdef\pfllistebornes{\pfllistebornes,\useKV[GraphiqueTikzCourbe]{Fin}}% |
| 1216 |
\setsepchar{,}% |
| 1217 |
\readlist*\tkzintlistebornes{\pfllistebornes}% |
| 1218 |
%\typeout{=== \pfllistebornes ===} |
| 1219 |
\xdef\tkzgrphnbbranches{\fpeval{\tkzintlisteborneslen/2}}% |
| 1220 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{} |
| 1221 |
\IfStrEq{\pflnamecurve}{}% |
| 1222 |
{% |
| 1223 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] |
| 1224 |
\foreach \ib [evaluate=\ib as \ibdeb using {int(2*\ib-1)},evaluate=\ib as \ibfin using {int(2*\ib)}] in {1,...,\tkzgrphnbbranches}{% |
| 1225 |
plot[smooth] coordinates {% |
| 1226 |
\xintthecoords\xintfloatexpr seq((x,min(max(#3,\pflMinoffsetV),\pflMaxoffsetV)), x={\tkzintlistebornes[\ibdeb]}..[\pflstepcurve]..{\tkzintlistebornes[\ibfin]},{\tkzintlistebornes[\ibfin]}) \relax} |
| 1227 |
} ;% |
| 1228 |
}% |
| 1229 |
{% |
| 1230 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 1231 |
\foreach \ib [evaluate=\ib as \ibdeb using {int(2*\ib-1)},evaluate=\ib as \ibfin using {int(2*\ib)}] in {1,...,\tkzgrphnbbranches}{% |
| 1232 |
plot[smooth] coordinates {% |
| 1233 |
\xintthecoords\xintfloatexpr seq((x,min(max(#3,\pflMinoffsetV),\pflMaxoffsetV)), x={\tkzintlistebornes[\ibdeb]}..[\pflstepcurve]..{\tkzintlistebornes[\ibfin]},{\tkzintlistebornes[\ibfin]}) \relax} |
| 1234 |
} ;% |
| 1235 |
}% |
| 1236 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{} |
| 1237 |
}% |
| 1238 |
} |
| 1239 |
|
| 1240 |
\defKV[GraphiqueVoisinageTikz]{% |
| 1241 |
Couleurs=\def\tkzgraphcoulvoisin{#1},% |
| 1242 |
CouleurAsymptote=\def\tkzgraphcoulasymptvoisin{#1},% |
| 1243 |
Opacite=\def\tkzgraphopacvoisin{#1},% |
| 1244 |
Entree=\def\tkzgraphentreevoisin{#1},% |
| 1245 |
LimiteEn=\def\tkzgraphvalavoisin{#1},% |
| 1246 |
TypeLimite=\def\tkzgraphtypevoisin{#1},% |
| 1247 |
DebutX=\def\tkzgraphxinitvoisin{#1},% |
| 1248 |
FinX=\def\tkzgraphxfinvoisin{#1} |
| 1249 |
} |
| 1250 |
|
| 1251 |
\setKVdefault[GraphiqueVoisinageTikz]{% |
| 1252 |
Couleurs=blue,% |
| 1253 |
CouleurAsymptote=orange,% |
| 1254 |
Opacite=0.15, |
| 1255 |
Entree=auto,% |
| 1256 |
LimiteEn=0,% |
| 1257 |
TypeLimite={L en +inf},% |
| 1258 |
Asymptote=true,% |
| 1259 |
Fleches=true,% |
| 1260 |
DebutX=\pflxmin,% |
| 1261 |
FinX=\pflxmax |
| 1262 |
} |
| 1263 |
|
| 1264 |
\NewDocumentCommand\AfficherVoisinage{ O{} D<>{cf} m m }{% |
| 1265 |
%#1 = Clés |
| 1266 |
%#2 = nom de la courbe |
| 1267 |
%#3 = limite/seuil |
| 1268 |
%#4 = epsilon si besoin |
| 1269 |
\restoreKV[GraphiqueVoisinageTikz]% |
| 1270 |
\setKV[GraphiqueVoisinageTikz]{#1}% |
| 1271 |
\IfStrEqCase{\tkzgraphtypevoisin}{% |
| 1272 |
%------------------------ |
| 1273 |
%limite finie en +infini% |
| 1274 |
{L en +inf}% |
| 1275 |
{% |
| 1276 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1277 |
{% |
| 1278 |
% path tube-haut : y = L+epsilon (droite horizontale) |
| 1279 |
% path tube-bas : y = L-epsilon (droite horizontale) |
| 1280 |
\path[pfltraitvoisinage,name path global=pfltubeH] ({\tkzgraphxinitvoisin},{#3+(#4)}) -- ({\pflxmax},{#3+(#4)}) ; |
| 1281 |
\path[pfltraitvoisinage,name path global=pfltubeB] ({\tkzgraphxinitvoisin},{#3-(#4)}) -- ({\pflxmax},{#3-(#4)}) ; |
| 1282 |
% intersections avec la courbe |
| 1283 |
\path[name intersections={of=#2 and pfltubeH,name=pflintH, total=\t}] \pgfextra{\xdef\tmpintHtot{\t}}; |
| 1284 |
\path[name intersections={of=#2 and pfltubeB,name=pflintB, total=\t}] \pgfextra{\xdef\tmpintBtot{\t}}; |
| 1285 |
% récupération des dernières abscisses% |
| 1286 |
% Cas possibles |
| 1287 |
\xintifboolexpr{\tmpintHtot > 0 'and' \tmpintBtot > 0}% |
| 1288 |
{% intersection des deux côtés → max des deux dernières abscisses |
| 1289 |
\path (pflintH-\tmpintHtot) ; |
| 1290 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1291 |
\xdef\pflxentreeH{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1292 |
\path (pflintB-\tmpintBtot) ; |
| 1293 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1294 |
\xdef\pflxentreeB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1295 |
\xdef\tmpvoisinageentreeX{\xintfloateval{max(\pflxentreeH,\pflxentreeB)}}% |
| 1296 |
}% |
| 1297 |
{\xintifboolexpr{\tmpintHtot > 0}% |
| 1298 |
{% uniquement par le haut |
| 1299 |
\path (pflintH-\tmpintHtot) ; |
| 1300 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1301 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1302 |
}% |
| 1303 |
{\xintifboolexpr{\tmpintBtot > 0}% |
| 1304 |
{% uniquement par le bas |
| 1305 |
\path (pflintB-\tmpintBtot) ; |
| 1306 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1307 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1308 |
}% |
| 1309 |
{% aucune intersection → courbe entièrement dans le tube |
| 1310 |
\xdef\tmpvoisinageentreeX{\pflxmin}% |
| 1311 |
}% |
| 1312 |
}% |
| 1313 |
}% |
| 1314 |
}% |
| 1315 |
{% |
| 1316 |
\xdef\tmpvoisinageentreeX{\tkzgraphentreevoisin}% |
| 1317 |
}% |
| 1318 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1319 |
{% |
| 1320 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({\pflxmin},{(#3)}) -- (\pflxmax,{(#3)}) ; |
| 1321 |
}% |
| 1322 |
{}% |
| 1323 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] (\tmpvoisinageentreeX,{(#3)-(#4)}) rectangle ({\pflxmax},{(#3)+(#4)}) ; |
| 1324 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)-(#4)}) -- (\pflxmax,{(#3)-(#4)}) ; |
| 1325 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)+(#4)}) -- (\pflxmax,{(#3)+(#4)}) ; |
| 1326 |
\draw[pfltraitvoisinage,densely dashed,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3-(#4)}) -- ({\tmpvoisinageentreeX},{#3+(#4)}) ; |
| 1327 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1328 |
{% |
| 1329 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3+(#4)}) --++ (0,3mm) ; |
| 1330 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3-(#4)}) --++ (0,-3mm) ; |
| 1331 |
}% |
| 1332 |
{% |
| 1333 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3+(#4)}) --++ (0,3mm) ; |
| 1334 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3-(#4)}) --++ (0,-3mm) ; |
| 1335 |
}% |
| 1336 |
}% |
| 1337 |
%------------------------ |
| 1338 |
%limite finie en -infini% |
| 1339 |
{L en -inf}% |
| 1340 |
{% |
| 1341 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1342 |
{% |
| 1343 |
% path tube-haut : y = L+epsilon (droite horizontale) |
| 1344 |
% path tube-bas : y = L-epsilon (droite horizontale) |
| 1345 |
\path[pfltraitvoisinage,name path global=pfltubeH] ({\pflxmin},{#3+(#4)}) -- ({\tkzgraphxfinvoisin},{#3+(#4)}) ; |
| 1346 |
\path[pfltraitvoisinage,name path global=pfltubeB] ({\pflxmin},{#3-(#4)}) -- ({\tkzgraphxfinvoisin},{#3-(#4)}) ; |
| 1347 |
% intersections avec la courbe |
| 1348 |
\path[name intersections={of=#2 and pfltubeH,name=pflintH, total=\t}] \pgfextra{\xdef\tmpintHtot{\t}}; |
| 1349 |
\path[name intersections={of=#2 and pfltubeB,name=pflintB, total=\t}] \pgfextra{\xdef\tmpintBtot{\t}}; |
| 1350 |
% récupération des dernières abscisses% |
| 1351 |
% Cas possibles |
| 1352 |
\xintifboolexpr{\tmpintHtot > 0 'and' \tmpintBtot > 0}% |
| 1353 |
{% intersection des deux côtés → max des deux dernières abscisses |
| 1354 |
\path (pflintH-\tmpintHtot) ; |
| 1355 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1356 |
\xdef\pflxentreeH{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1357 |
\path (pflintB-\tmpintBtot) ; |
| 1358 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1359 |
\xdef\pflxentreeB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1360 |
\xdef\tmpvoisinageentreeX{\xintfloateval{max(\pflxentreeH,\pflxentreeB)}}% |
| 1361 |
}% |
| 1362 |
{\xintifboolexpr{\tmpintHtot > 0}% |
| 1363 |
{% uniquement par le haut |
| 1364 |
\path (pflintH-\tmpintHtot) ; |
| 1365 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1366 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1367 |
}% |
| 1368 |
{\xintifboolexpr{\tmpintBtot > 0}% |
| 1369 |
{% uniquement par le bas |
| 1370 |
\path (pflintB-\tmpintBtot) ; |
| 1371 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1372 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1373 |
}% |
| 1374 |
{% aucune intersection → courbe entièrement dans le tube |
| 1375 |
\xdef\tmpvoisinageentreeX{\pflxmax}% |
| 1376 |
}% |
| 1377 |
}% |
| 1378 |
}% |
| 1379 |
}% |
| 1380 |
{% |
| 1381 |
\xdef\tmpvoisinageentreeX{\tkzgraphentreevoisin}% |
| 1382 |
}% |
| 1383 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1384 |
{% |
| 1385 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({\pflxmin},{(#3)}) -- (\pflxmax,{(#3)}) ; |
| 1386 |
}% |
| 1387 |
{}% |
| 1388 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] (\tmpvoisinageentreeX,{(#3)-(#4)}) rectangle ({\pflxmin},{(#3)+(#4)}) ; |
| 1389 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)-(#4)}) -- (\pflxmax,{(#3)-(#4)}) ; |
| 1390 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)+(#4)}) -- (\pflxmax,{(#3)+(#4)}) ; |
| 1391 |
\draw[pfltraitvoisinage,densely dashed,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3-(#4)}) -- ({\tmpvoisinageentreeX},{#3+(#4)}) ; |
| 1392 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1393 |
{% |
| 1394 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3+(#4)}) --++ (0,3mm) ; |
| 1395 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3-(#4)}) --++ (0,-3mm) ; |
| 1396 |
}% |
| 1397 |
{% |
| 1398 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3+(#4)}) --++ (0,3mm) ; |
| 1399 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3-(#4)}) --++ (0,-3mm) ; |
| 1400 |
}% |
| 1401 |
}% |
| 1402 |
%------------------------ |
| 1403 |
%limite infinie en +infini% |
| 1404 |
{+inf en +inf}% |
| 1405 |
{% |
| 1406 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1407 |
{% |
| 1408 |
% path seuil : y = #3 |
| 1409 |
\path[pfltraitvoisinage,name path global=pflseuilvoisin] ({\tkzgraphxinitvoisin},{#3}) -- ({\pflxmax},{#3}) ; |
| 1410 |
% intersections avec la courbe |
| 1411 |
\path[name intersections={of=#2 and pflseuilvoisin,name=pflintS,total=\t}] \pgfextra{\xdef\tmpintStot{\t}}; |
| 1412 |
% Cas possibles |
| 1413 |
\xintifboolexpr{\tmpintStot > 0}% |
| 1414 |
{% |
| 1415 |
\path (pflintS-\tmpintStot) ; |
| 1416 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1417 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1418 |
}% |
| 1419 |
{% |
| 1420 |
\xdef\tmpvoisinageentreeX{\pflxmin}% |
| 1421 |
}% |
| 1422 |
}% |
| 1423 |
{% |
| 1424 |
\xdef\tmpvoisinageentreeX{\tkzgraphentreevoisin}% |
| 1425 |
}% |
| 1426 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] (\tmpvoisinageentreeX,{(#3)}) rectangle ({\pflxmax},{\pflymax}) ; |
| 1427 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)}) -- (\pflxmax,{(#3)}) ; |
| 1428 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{(#3)}) -- (\tmpvoisinageentreeX,{\pflymax}) ; |
| 1429 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1430 |
{% |
| 1431 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3}) --++ (0,-3mm); |
| 1432 |
}% |
| 1433 |
{% |
| 1434 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3}) --++ (0,-3mm); |
| 1435 |
}% |
| 1436 |
}% |
| 1437 |
%limite -infinie en +infini% |
| 1438 |
{-inf en +inf}% |
| 1439 |
{% |
| 1440 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1441 |
{% |
| 1442 |
% path seuil : y = #3 |
| 1443 |
\path[pfltraitvoisinage,name path global=pflseuilvoisin] ({\pflxmin},{#3}) -- ({\tkzgraphxfinvoisin},{#3}) ; |
| 1444 |
% intersections avec la courbe |
| 1445 |
\path[name intersections={of=#2 and pflseuilvoisin,name=pflintS,total=\t}] \pgfextra{\xdef\tmpintStot{\t}}; |
| 1446 |
% Cas possibles |
| 1447 |
\xintifboolexpr{\tmpintStot > 0}% |
| 1448 |
{% |
| 1449 |
\path (pflintS-\tmpintStot) ; |
| 1450 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1451 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1452 |
}% |
| 1453 |
{% |
| 1454 |
\xdef\tmpvoisinageentreeX{\pflxmax}% |
| 1455 |
}% |
| 1456 |
}% |
| 1457 |
{% |
| 1458 |
\xdef\tmpvoisinageentreeX{\tkzgraphentreevoisin}% |
| 1459 |
}% |
| 1460 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] (\tmpvoisinageentreeX,{(#3)}) rectangle ({\pflxmax},{\pflymin}) ; |
| 1461 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)}) -- (\pflxmax,{(#3)}) ; |
| 1462 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{(#3)}) -- (\tmpvoisinageentreeX,{\pflymin}) ; |
| 1463 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1464 |
{% |
| 1465 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3}) --++ (0,3mm); |
| 1466 |
}% |
| 1467 |
{% |
| 1468 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3}) --++ (0,3mm); |
| 1469 |
}% |
| 1470 |
}% |
| 1471 |
%limite +infinie en -infini% |
| 1472 |
{+inf en -inf}% |
| 1473 |
{% |
| 1474 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1475 |
{% |
| 1476 |
% path seuil : y = #3 |
| 1477 |
\path[pfltraitvoisinage,name path global=pflseuilvoisin] ({\pflxmin},{#3}) -- ({\tkzgraphxfinvoisin},{#3}) ; |
| 1478 |
% intersections avec la courbe |
| 1479 |
\path[name intersections={of=#2 and pflseuilvoisin,name=pflintS,total=\t}] \pgfextra{\xdef\tmpintStot{\t}}; |
| 1480 |
% Cas possibles |
| 1481 |
\xintifboolexpr{\tmpintStot > 0}% |
| 1482 |
{% |
| 1483 |
\path (pflintS-\tmpintStot) ; |
| 1484 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1485 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1486 |
}% |
| 1487 |
{% |
| 1488 |
\xdef\tmpvoisinageentreeX{\pflxmin}% |
| 1489 |
}% |
| 1490 |
}% |
| 1491 |
{% |
| 1492 |
\xdef\tmpvoisinageentreeX{\tkzgraphentreevoisin}% |
| 1493 |
}% |
| 1494 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] (\tmpvoisinageentreeX,{(#3)}) rectangle ({\pflxmin},{\pflymax}) ; |
| 1495 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)}) -- (\pflxmax,{(#3)}) ; |
| 1496 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{(#3)}) -- (\tmpvoisinageentreeX,{\pflymax}) ; |
| 1497 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1498 |
{% |
| 1499 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3}) --++ (0,-3mm); |
| 1500 |
}% |
| 1501 |
{% |
| 1502 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3}) --++ (0,-3mm); |
| 1503 |
}% |
| 1504 |
}% |
| 1505 |
%limite +infinie en -infini% |
| 1506 |
{-inf en -inf}% |
| 1507 |
{% |
| 1508 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1509 |
{% |
| 1510 |
% path seuil : y = #3 |
| 1511 |
\path[pfltraitvoisinage,name path global=pflseuilvoisin] ({\pflxmin},{#3}) -- ({\tkzgraphxfinvoisin},{#3}) ; |
| 1512 |
% intersections avec la courbe |
| 1513 |
\path[name intersections={of=#2 and pflseuilvoisin,name=pflintS,total=\t}] \pgfextra{\xdef\tmpintStot{\t}}; |
| 1514 |
% Cas possibles |
| 1515 |
\xintifboolexpr{\tmpintStot > 0}% |
| 1516 |
{% |
| 1517 |
\path (pflintS-\tmpintStot) ; |
| 1518 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1519 |
\xdef\tmpvoisinageentreeX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1520 |
}% |
| 1521 |
{% |
| 1522 |
\xdef\tmpvoisinageentreeX{\pflxmax}% |
| 1523 |
}% |
| 1524 |
}% |
| 1525 |
{% |
| 1526 |
\xdef\tmpvoisinageentreeX{\tkzgraphentreevoisin}% |
| 1527 |
}% |
| 1528 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] (\tmpvoisinageentreeX,{(#3)}) rectangle ({\pflxmin},{\pflymin}) ; |
| 1529 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\pflxmin},{(#3)}) -- (\pflxmax,{(#3)}) ; |
| 1530 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{(#3)}) -- (\tmpvoisinageentreeX,{\pflymin}) ; |
| 1531 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1532 |
{% |
| 1533 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tmpvoisinageentreeX},{#3}) --++ (0,3mm); |
| 1534 |
}% |
| 1535 |
{% |
| 1536 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tmpvoisinageentreeX},{#3}) --++ (0,3mm); |
| 1537 |
}% |
| 1538 |
}% |
| 1539 |
%------------------------ |
| 1540 |
%limite infinie en a% |
| 1541 |
{+inf en a} |
| 1542 |
{% |
| 1543 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1544 |
{% |
| 1545 |
% path tube-haut : x = L+epsilon (droite verticale) |
| 1546 |
% path tube-bas : x = L-epsilon (droite verticale) |
| 1547 |
\path[pfltraitvoisinage,name path global=pfltubeG] ({#3-(#4)},{\pflymin}) -- ({#3-(#4)},{\pflymax}) ; |
| 1548 |
\path[pfltraitvoisinage,name path global=pfltubeD] ({#3+(#4)},{\pflymin}) -- ({#3+(#4)},{\pflymax}) ; |
| 1549 |
% intersections avec la courbe |
| 1550 |
\path[name intersections={of=#2 and pfltubeG,name=pflintG, total=\t}] \pgfextra{\xdef\tmpintGtot{\t}}; |
| 1551 |
\path[name intersections={of=#2 and pfltubeD,name=pflintD, total=\t}] \pgfextra{\xdef\tmpintDtot{\t}}; |
| 1552 |
% récupération des dernières abscisses% |
| 1553 |
% Cas possibles |
| 1554 |
\xintifboolexpr{\tmpintGtot > 0 'and' \tmpintDtot > 0}% |
| 1555 |
{% intersection des deux côtés → min des deux deltas... |
| 1556 |
\path (pflintG-\tmpintGtot) ; |
| 1557 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1558 |
\xdef\pflyentreeG{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1559 |
\path (pflintD-\tmpintDtot) ; |
| 1560 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1561 |
\xdef\pflyentreeD{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1562 |
\xdef\pflyentree{\xintfloateval{max(\pflyentreeG,\pflyentreeD)}}% |
| 1563 |
}% |
| 1564 |
{\xintifboolexpr{\tmpintDtot > 0}% |
| 1565 |
{% uniquement par la droite |
| 1566 |
\path (pflintD-\tmpintDtot) ; |
| 1567 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1568 |
\xdef\pflyentree{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1569 |
}% |
| 1570 |
{\xintifboolexpr{\tmpintGtot > 0}% |
| 1571 |
{% uniquement par le bas |
| 1572 |
\path (pflintG-\tmpintGtot) ; |
| 1573 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1574 |
\xdef\pflyentree{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1575 |
}% |
| 1576 |
{% aucune intersection → courbe entièrement dans le tube |
| 1577 |
\xdef\pflyentree{\pflymin}% |
| 1578 |
}% |
| 1579 |
}% |
| 1580 |
}% |
| 1581 |
}% |
| 1582 |
{% |
| 1583 |
\xdef\pflyentree{\tkzgraphentreevoisin}% |
| 1584 |
}% |
| 1585 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1586 |
{% |
| 1587 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({(#3)},{\pflymin}) -- ({(#3)},{\pflymax}) ; |
| 1588 |
}% |
| 1589 |
{}% |
| 1590 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflyentree}) rectangle ({(#3)+(#4)},{\pflymax}) ; |
| 1591 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflymin}) -- ({(#3)-(#4)},{\pflymax}) ; |
| 1592 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)+(#4)},{\pflymin}) -- ({(#3)+(#4)},{\pflymax}) ; |
| 1593 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflyentree}) -- ({(#3)+(#4)},{\pflyentree}) ; |
| 1594 |
% \draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\tmpvoisinageentreeY}) -- ({(#3)+(#4)},{\tmpvoisinageentreeY}) ; |
| 1595 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1596 |
{% |
| 1597 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3-(#4)},{\pflyentree}) --++ (-3mm,0) ; |
| 1598 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3+(#4)},{\pflyentree}) --++ (3mm,0) ; |
| 1599 |
}% |
| 1600 |
{% |
| 1601 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3-(#4)},{\pflyentree}) --++ (-3mm,0) ; |
| 1602 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3+(#4)},{\pflyentree}) --++ (3mm,0) ; |
| 1603 |
}% |
| 1604 |
}% |
| 1605 |
%------------------------ |
| 1606 |
%limite -infinie en a% |
| 1607 |
{-inf en a} |
| 1608 |
{% |
| 1609 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1610 |
{% |
| 1611 |
% path tube-haut : x = L+epsilon (droite verticale) |
| 1612 |
% path tube-bas : x = L-epsilon (droite verticale) |
| 1613 |
\path[pfltraitvoisinage,name path global=pfltubeG] ({#3-(#4)},{\pflymin}) -- ({#3-(#4)},{\pflymax}) ; |
| 1614 |
\path[pfltraitvoisinage,name path global=pfltubeD] ({#3+(#4)},{\pflymin}) -- ({#3+(#4)},{\pflymax}) ; |
| 1615 |
% intersections avec la courbe |
| 1616 |
\path[name intersections={of=#2 and pfltubeG,name=pflintG, total=\t}] \pgfextra{\xdef\tmpintGtot{\t}}; |
| 1617 |
\path[name intersections={of=#2 and pfltubeD,name=pflintD, total=\t}] \pgfextra{\xdef\tmpintDtot{\t}}; |
| 1618 |
% récupération des dernières abscisses% |
| 1619 |
% Cas possibles |
| 1620 |
\xintifboolexpr{\tmpintGtot > 0 'and' \tmpintDtot > 0}% |
| 1621 |
{% intersection des deux côtés |
| 1622 |
\path (pflintG-\tmpintGtot) ; |
| 1623 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1624 |
\xdef\pflyentreeG{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1625 |
\path (pflintD-\tmpintDtot) ; |
| 1626 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1627 |
\xdef\pflyentreeD{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1628 |
\xdef\pflyentree{\xintfloateval{min(\pflyentreeG,\pflyentreeD)}}% |
| 1629 |
}% |
| 1630 |
{\xintifboolexpr{\tmpintDtot > 0}% |
| 1631 |
{% uniquement par la droite |
| 1632 |
\path (pflintD-\tmpintDtot) ; |
| 1633 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1634 |
\xdef\pflyentree{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1635 |
}% |
| 1636 |
{\xintifboolexpr{\tmpintGtot > 0}% |
| 1637 |
{% uniquement par le bas |
| 1638 |
\path (pflintG-\tmpintGtot) ; |
| 1639 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1640 |
\xdef\pflyentree{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1641 |
}% |
| 1642 |
{% aucune intersection → courbe entièrement dans le tube |
| 1643 |
\xdef\pflyentree{\pflymax}% |
| 1644 |
}% |
| 1645 |
}% |
| 1646 |
}% |
| 1647 |
}% |
| 1648 |
{% |
| 1649 |
\xdef\pflyentree{\tkzgraphentreevoisin}% |
| 1650 |
}% |
| 1651 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1652 |
{% |
| 1653 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({(#3)},{\pflymin}) -- ({(#3)},{\pflymax}) ; |
| 1654 |
}% |
| 1655 |
{}% |
| 1656 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflyentree}) rectangle ({(#3)+(#4)},{\pflymin}) ; |
| 1657 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflymin}) -- ({(#3)-(#4)},{\pflymax}) ; |
| 1658 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)+(#4)},{\pflymin}) -- ({(#3)+(#4)},{\pflymax}) ; |
| 1659 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflyentree}) -- ({(#3)+(#4)},{\pflyentree}) ; |
| 1660 |
% \draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\tmpvoisinageentreeY}) -- ({(#3)+(#4)},{\tmpvoisinageentreeY}) ; |
| 1661 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1662 |
{% |
| 1663 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3-(#4)},{\pflyentree}) --++ (-3mm,0) ; |
| 1664 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3+(#4)},{\pflyentree}) --++ (3mm,0) ; |
| 1665 |
}% |
| 1666 |
{% |
| 1667 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3-(#4)},{\pflyentree}) --++ (-3mm,0) ; |
| 1668 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3+(#4)},{\pflyentree}) --++ (3mm,0) ; |
| 1669 |
}% |
| 1670 |
}% |
| 1671 |
%------------------------ |
| 1672 |
%limite infinie en Ld% |
| 1673 |
{+inf en a+}% |
| 1674 |
{% |
| 1675 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1676 |
{% |
| 1677 |
% path tube-haut : x = L+epsilon (droite verticale) |
| 1678 |
\path[pfltraitvoisinage,name path global=pfltubeD] ({#3+(#4)},{\pflymin}) -- ({#3+(#4)},{\pflymax}) ; |
| 1679 |
% intersections avec la courbe |
| 1680 |
\path[name intersections={of=#2 and pfltubeD,name=pflintD, total=\t}] \pgfextra{\xdef\tmpintDtot{\t}}; |
| 1681 |
% récupération des dernières abscisses% |
| 1682 |
% Cas possibles |
| 1683 |
\xintifboolexpr{\tmpintDtot > 0}% |
| 1684 |
{% uniquement par le haut |
| 1685 |
\path (pflintD-\tmpintDtot) ; |
| 1686 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1687 |
\xdef\tmpvoisinageentreeY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1688 |
}% |
| 1689 |
{% aucune intersection → courbe entièrement dans le tube |
| 1690 |
\xdef\tmpvoisinageentreeY{\pflymin}% |
| 1691 |
}% |
| 1692 |
}% |
| 1693 |
{% |
| 1694 |
\xdef\tmpvoisinageentreeY{\tkzgraphentreevoisin}% |
| 1695 |
}% |
| 1696 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) rectangle ({(#3)+(#4)},{\pflymax}) ; |
| 1697 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1698 |
{% |
| 1699 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({(#3)},{\pflymin}) -- ({(#3)},{\pflymax}) ; |
| 1700 |
}% |
| 1701 |
{}% |
| 1702 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)+(#4)},{\pflymin}) -- ({(#3)+(#4)},{\pflymax}) ; |
| 1703 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) -- ({(#3)+(#4)},{\tmpvoisinageentreeY}) ; |
| 1704 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1705 |
{% |
| 1706 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1707 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3+(#4)},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1708 |
}% |
| 1709 |
{% |
| 1710 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1711 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3+(#4)},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1712 |
}% |
| 1713 |
}% |
| 1714 |
%------------------------ |
| 1715 |
%limite infinie en Lg% |
| 1716 |
{+inf en a-}% |
| 1717 |
{% |
| 1718 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1719 |
{% |
| 1720 |
% path tube-haut : x = L+epsilon (droite verticale) |
| 1721 |
\path[pfltraitvoisinage,name path global=pfltubeD] ({#3-(#4)},{\pflymin}) -- ({#3-(#4)},{\pflymax}) ; |
| 1722 |
% intersections avec la courbe |
| 1723 |
\path[name intersections={of=#2 and pfltubeD,name=pflintD, total=\t}] \pgfextra{\xdef\tmpintDtot{\t}}; |
| 1724 |
% récupération des dernières abscisses% |
| 1725 |
% Cas possibles |
| 1726 |
\xintifboolexpr{\tmpintDtot > 0}% |
| 1727 |
{% uniquement par le haut |
| 1728 |
\path (pflintD-\tmpintDtot) ; |
| 1729 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1730 |
\xdef\tmpvoisinageentreeY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1731 |
}% |
| 1732 |
{% aucune intersection → courbe entièrement dans le tube |
| 1733 |
\xdef\tmpvoisinageentreeY{\pflymin}% |
| 1734 |
}% |
| 1735 |
}% |
| 1736 |
{% |
| 1737 |
\xdef\tmpvoisinageentreeY{\tkzgraphentreevoisin}% |
| 1738 |
}% |
| 1739 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) rectangle ({(#3)-(#4)},{\pflymax}) ; |
| 1740 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1741 |
{% |
| 1742 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({(#3)},{\pflymin}) -- ({(#3)},{\pflymax}) ; |
| 1743 |
}% |
| 1744 |
{}% |
| 1745 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflymin}) -- ({(#3)-(#4)},{\pflymax}) ; |
| 1746 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) -- ({(#3)-(#4)},{\tmpvoisinageentreeY}) ; |
| 1747 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1748 |
{% |
| 1749 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1750 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3-(#4)},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1751 |
}% |
| 1752 |
{% |
| 1753 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1754 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3-(#4)},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1755 |
|
| 1756 |
}% |
| 1757 |
}% |
| 1758 |
%------------------------ |
| 1759 |
%limite -infinie en Lg% |
| 1760 |
{-inf en a-}% |
| 1761 |
{% |
| 1762 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1763 |
{% |
| 1764 |
% path tube-haut : x = L+epsilon (droite verticale) |
| 1765 |
\path[pfltraitvoisinage,name path global=pfltubeD] ({#3-(#4)},{\pflymin}) -- ({#3-(#4)},{\pflymax}) ; |
| 1766 |
% intersections avec la courbe |
| 1767 |
\path[name intersections={of=#2 and pfltubeD,name=pflintD, total=\t}] \pgfextra{\xdef\tmpintDtot{\t}}; |
| 1768 |
% récupération des dernières abscisses% |
| 1769 |
% Cas possibles |
| 1770 |
\xintifboolexpr{\tmpintDtot > 0}% |
| 1771 |
{% uniquement par le haut |
| 1772 |
\path (pflintD-\tmpintDtot) ; |
| 1773 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1774 |
\xdef\tmpvoisinageentreeY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1775 |
}% |
| 1776 |
{% aucune intersection → courbe entièrement dans le tube |
| 1777 |
\xdef\tmpvoisinageentreeY{\pflymax}% |
| 1778 |
}% |
| 1779 |
}% |
| 1780 |
{% |
| 1781 |
\xdef\tmpvoisinageentreeY{\tkzgraphentreevoisin}% |
| 1782 |
}% |
| 1783 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) rectangle ({(#3)-(#4)},{\pflymin}) ; |
| 1784 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1785 |
{% |
| 1786 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({(#3)},{\pflymin}) -- ({(#3)},{\pflymax}) ; |
| 1787 |
}% |
| 1788 |
{}% |
| 1789 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)-(#4)},{\pflymin}) -- ({(#3)-(#4)},{\pflymax}) ; |
| 1790 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) -- ({(#3)-(#4)},{\tmpvoisinageentreeY}) ; |
| 1791 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1792 |
{% |
| 1793 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1794 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3-(#4)},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1795 |
}% |
| 1796 |
{% |
| 1797 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1798 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3-(#4)},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1799 |
}% |
| 1800 |
|
| 1801 |
|
| 1802 |
}% |
| 1803 |
%------------------------ |
| 1804 |
%limite -infinie en Ld% |
| 1805 |
{-inf en a+}% |
| 1806 |
{% |
| 1807 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1808 |
{% |
| 1809 |
% path tube-haut : x = L+epsilon (droite verticale) |
| 1810 |
\path[pfltraitvoisinage,name path global=pfltubeD] ({#3+(#4)},{\pflymin}) -- ({#3+(#4)},{\pflymax}) ; |
| 1811 |
% intersections avec la courbe |
| 1812 |
\path[name intersections={of=#2 and pfltubeD,name=pflintD, total=\t}] \pgfextra{\xdef\tmpintDtot{\t}}; |
| 1813 |
% récupération des dernières abscisses% |
| 1814 |
% Cas possibles |
| 1815 |
\xintifboolexpr{\tmpintDtot > 0}% |
| 1816 |
{% uniquement par le haut |
| 1817 |
\path (pflintD-\tmpintDtot) ; |
| 1818 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1819 |
\xdef\tmpvoisinageentreeY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 1820 |
}% |
| 1821 |
{% aucune intersection → courbe entièrement dans le tube |
| 1822 |
\xdef\tmpvoisinageentreeY{\pflymax}% |
| 1823 |
}% |
| 1824 |
}% |
| 1825 |
{% |
| 1826 |
\xdef\tmpvoisinageentreeY{\tkzgraphentreevoisin}% |
| 1827 |
}% |
| 1828 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) rectangle ({(#3)+(#4)},{\pflymin}) ; |
| 1829 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1830 |
{% |
| 1831 |
\draw[pfltraitvoisinage,\tkzgraphcoulasymptvoisin] ({(#3)},{\pflymin}) -- ({(#3)},{\pflymax}) ; |
| 1832 |
}% |
| 1833 |
{}% |
| 1834 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)+(#4)},{\pflymin}) -- ({(#3)+(#4)},{\pflymax}) ; |
| 1835 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({(#3)},{\tmpvoisinageentreeY}) -- ({(#3)+(#4)},{\tmpvoisinageentreeY}) ; |
| 1836 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1837 |
{% |
| 1838 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1839 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({#3+(#4)},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1840 |
}% |
| 1841 |
{% |
| 1842 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3},{\tmpvoisinageentreeY}) --++ (-3mm,0) ; |
| 1843 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({#3+(#4)},{\tmpvoisinageentreeY}) --++ (3mm,0) ; |
| 1844 |
}% |
| 1845 |
}% |
| 1846 |
%------------------------ |
| 1847 |
%continuité |
| 1848 |
{L en a}% |
| 1849 |
{% |
| 1850 |
\IfStrEq{\tkzgraphentreevoisin}{auto}% |
| 1851 |
{% |
| 1852 |
%partie droite path tube-haut-bas : x = L+-epsilon (droites verticales) |
| 1853 |
\path[pfltraitvoisinage,name path global=pfltubeDH] ({\tkzgraphvalavoisin},{#3+(#4)}) -- ({\pflxmax},{#3+(#4)}) ; |
| 1854 |
\path[pfltraitvoisinage,name path global=pfltubeDB] ({\tkzgraphvalavoisin},{#3-(#4)}) -- ({\pflxmax},{#3-(#4)}) ; |
| 1855 |
\path[name intersections={of=#2 and pfltubeDH,name=pflintDH, total=\t}] \pgfextra{\xdef\tmpintDHtot{\t}}; |
| 1856 |
\path[name intersections={of=#2 and pfltubeDB,name=pflintDB, total=\t}] \pgfextra{\xdef\tmpintDBtot{\t}}; |
| 1857 |
\xintifboolexpr{\tmpintDHtot > 0 'and' \tmpintDBtot > 0}% |
| 1858 |
{% |
| 1859 |
\path (pflintDH-1) ; |
| 1860 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1861 |
\xdef\pflxentreeDH{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1862 |
\path (pflintDB-1) ; |
| 1863 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1864 |
\xdef\pflxentreeDB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1865 |
\xdef\pflvoisindeltaD{\xintfloateval{min(\pflxentreeDH,\pflxentreeDB)-\tkzgraphvalavoisin}}% |
| 1866 |
}% |
| 1867 |
{% |
| 1868 |
\xintifboolexpr{\tmpintDHtot > 0}% |
| 1869 |
{% |
| 1870 |
\path (pflintDH-1) ; |
| 1871 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1872 |
\xdef\pflvoisindeltaD{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)-\tkzgraphvalavoisin}}% |
| 1873 |
}% |
| 1874 |
{% |
| 1875 |
\xintifboolexpr{\tmpintDBtot > 0}% |
| 1876 |
{% |
| 1877 |
\path (pflintDB-1) ; |
| 1878 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1879 |
\xdef\pflvoisindeltaD{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)-\tkzgraphvalavoisin}}% |
| 1880 |
}% |
| 1881 |
{% aucune intersection → courbe dans le tube sur toute la partie droite |
| 1882 |
\xdef\pflvoisindeltaD{\xintfloateval{\pflxmax-\tkzgraphvalavoisin}}% |
| 1883 |
}% |
| 1884 |
}% |
| 1885 |
}% |
| 1886 |
% partie gauche — paths de pflxmin à a |
| 1887 |
\path[pfltraitvoisinage,name path global=pfltubeGH] ({\pflxmin},{#3+(#4)}) -- ({\tkzgraphvalavoisin},{#3+(#4)}) ; |
| 1888 |
\path[pfltraitvoisinage,name path global=pfltubeGB] ({\pflxmin},{#3-(#4)}) -- ({\tkzgraphvalavoisin},{#3-(#4)}) ; |
| 1889 |
\path[name intersections={of=#2 and pfltubeGH,name=pflintGH, total=\t}] \pgfextra{\xdef\tmpintGHtot{\t}}; |
| 1890 |
\path[name intersections={of=#2 and pfltubeGB,name=pflintGB, total=\t}] \pgfextra{\xdef\tmpintGBtot{\t}}; |
| 1891 |
% récupération du delta gauche |
| 1892 |
\xintifboolexpr{\tmpintGHtot > 0 'and' \tmpintGBtot > 0}% |
| 1893 |
{% |
| 1894 |
\path (pflintGH-\tmpintGHtot) ; |
| 1895 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1896 |
\xdef\pflxentreeGH{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1897 |
\path (pflintGB-\tmpintGBtot) ; |
| 1898 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1899 |
\xdef\pflxentreeGB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1900 |
\xdef\pflvoisindeltaG{\xintfloateval{\tkzgraphvalavoisin-max(\pflxentreeGH,\pflxentreeGB)}}% |
| 1901 |
}% |
| 1902 |
{% |
| 1903 |
\xintifboolexpr{\tmpintGHtot > 0}% |
| 1904 |
{% |
| 1905 |
\path (pflintGH-\tmpintGHtot) ; |
| 1906 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1907 |
\xdef\pflvoisindeltaG{\xintfloateval{\tkzgraphvalavoisin-(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1908 |
}% |
| 1909 |
{% |
| 1910 |
\xintifboolexpr{\tmpintGBtot > 0}% |
| 1911 |
{% |
| 1912 |
\path (pflintGB-\tmpintGBtot) ; |
| 1913 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 1914 |
\xdef\pflvoisindeltaG{\xintfloateval{\tkzgraphvalavoisin-(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 1915 |
}% |
| 1916 |
{% aucune intersection |
| 1917 |
\xdef\pflvoisindeltaG{\xintfloateval{\tkzgraphvalavoisin-\pflxmin}}% |
| 1918 |
}% |
| 1919 |
}% |
| 1920 |
}% |
| 1921 |
% delta final |
| 1922 |
\xdef\pflvoisindelta{\xintfloateval{min(\pflvoisindeltaD,\pflvoisindeltaG)}}% |
| 1923 |
}% |
| 1924 |
{% |
| 1925 |
\xdef\pflvoisindelta{\tkzgraphentreevoisin}% |
| 1926 |
}% |
| 1927 |
% tube horizontal restreint à ]a-delta, a+delta[ |
| 1928 |
\fill[opacity=\tkzgraphopacvoisin,\tkzgraphcoulvoisin] |
| 1929 |
({\xintfloateval{\tkzgraphvalavoisin-\pflvoisindelta}},{#3-(#4)}) |
| 1930 |
rectangle |
| 1931 |
({\xintfloateval{\tkzgraphvalavoisin+\pflvoisindelta}},{#3+(#4)}) ; |
| 1932 |
% bords horizontaux |
| 1933 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] |
| 1934 |
({\pflxmin},{#3-(#4)}) -- ({\pflxmax},{#3-(#4)}) ; |
| 1935 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] |
| 1936 |
({\pflxmin},{#3+(#4)}) -- ({\pflxmax},{#3+(#4)}) ; |
| 1937 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({\tkzgraphvalavoisin-\pflvoisindelta},{#3-(#4)}) -- ({\tkzgraphvalavoisin-\pflvoisindelta},{#3+(#4)}) ; |
| 1938 |
\draw[pfltraitvoisinage,,densely dashed,\tkzgraphcoulvoisin] ({\tkzgraphvalavoisin+\pflvoisindelta},{#3-(#4)}) -- ({\tkzgraphvalavoisin+\pflvoisindelta},{#3+(#4)}) ; |
| 1939 |
\ifboolKV[GraphiqueVoisinageTikz]{Asymptote}% |
| 1940 |
{% |
| 1941 |
\draw[pfltraitvoisinageasympt,\tkzgraphcoulasymptvoisin] ({(\tkzgraphvalavoisin)},{\pflymin}) -- ({(\tkzgraphvalavoisin)},{\pflymax}) ; |
| 1942 |
\draw[pfltraitvoisinageasympt,\tkzgraphcoulasymptvoisin] ({\pflxmin},{#3}) -- ({\pflxmax},{#3}) ; |
| 1943 |
|
| 1944 |
}% |
| 1945 |
{}% |
| 1946 |
\ifboolKV[GraphiqueVoisinageTikz]{Fleches}% |
| 1947 |
{% |
| 1948 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tkzgraphvalavoisin-\pflvoisindelta},{#3-(#4)}) --++ (0,-3mm) ; |
| 1949 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tkzgraphvalavoisin-\pflvoisindelta},{#3+(#4)}) --++ (0,3mm) ; |
| 1950 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tkzgraphvalavoisin+\pflvoisindelta},{#3-(#4)}) --++ (0,-3mm) ; |
| 1951 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin,pflflecheg] ({\tkzgraphvalavoisin+\pflvoisindelta},{#3+(#4)}) --++ (0,3mm) ; |
| 1952 |
}% |
| 1953 |
{% |
| 1954 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tkzgraphvalavoisin-\pflvoisindelta},{#3-(#4)}) --++ (0,-3mm) ; |
| 1955 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tkzgraphvalavoisin-\pflvoisindelta},{#3+(#4)}) --++ (0,3mm) ; |
| 1956 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tkzgraphvalavoisin+\pflvoisindelta},{#3-(#4)}) --++ (0,-3mm) ; |
| 1957 |
\draw[pfltraitvoisinage,\tkzgraphcoulvoisin] ({\tkzgraphvalavoisin+\pflvoisindelta},{#3+(#4)}) --++ (0,3mm) ; |
| 1958 |
}% |
| 1959 |
} |
| 1960 |
}% |
| 1961 |
} |
| 1962 |
|
| 1963 |
%----COURBES PARAMETRIQUES |
| 1964 |
\NewDocumentCommand\DefinirCourbeParam{ O{} D<>{x} D<>{y} m m }{% |
| 1965 |
\restoreKV[GraphiqueTikzCourbe]% |
| 1966 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 1967 |
\xintdeffloatfunc #2(t) := #4 ; |
| 1968 |
\xintdeffloatfunc #3(t) := #5 ; |
| 1969 |
%test dimension too large ?? |
| 1970 |
\ifboolKV[GraphiqueTikzCourbe]{Restreindre}% |
| 1971 |
{% |
| 1972 |
\xdef\pfloffsetV{\xintfloateval{((\pflymax)-(\pflymin))/20}}% |
| 1973 |
\xdef\pflMinoffsetV{\xintfloateval{(\pflymin)-(\pfloffsetV)}}% |
| 1974 |
\xdef\pflMaxoffsetV{\xintfloateval{(\pflymax)+(\pfloffsetV)}}% |
| 1975 |
\xdef\pfloffsetH{\xintfloateval{((\pflxmax)-(\pflxmin))/20}}% |
| 1976 |
\xdef\pflMinoffsetH{\xintfloateval{(\pflxmin)-(\pfloffsetH)}}% |
| 1977 |
\xdef\pflMaxoffsetH{\xintfloateval{(\pflxmax)+(\pfloffsetH)}}% |
| 1978 |
}% |
| 1979 |
{}% |
| 1980 |
%fin test |
| 1981 |
\IfStrEq{\pflstepcurve}{}% |
| 1982 |
{% |
| 1983 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/250}}% |
| 1984 |
}% |
| 1985 |
{}% |
| 1986 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{} |
| 1987 |
\ifboolKV[GraphiqueTikzCourbe]{Trace}% |
| 1988 |
{% |
| 1989 |
\ifboolKV[GraphiqueTikzCourbe]{Restreindre}% |
| 1990 |
{% |
| 1991 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {% |
| 1992 |
\xintthecoords\xintfloatexpr |
| 1993 |
seq((min(max(#2(t),\pflMinoffsetH),\pflMaxoffsetH), min(max(#3(t),\pflMinoffsetV),\pflMaxoffsetV)), |
| 1994 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 1995 |
..[\pflstepcurve]..% |
| 1996 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 1997 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 1998 |
\relax |
| 1999 |
}; |
| 2000 |
}% |
| 2001 |
{% |
| 2002 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {% |
| 2003 |
\xintthecoords\xintfloatexpr |
| 2004 |
seq((#2(t),#3(t)), |
| 2005 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 2006 |
..[\pflstepcurve]..% |
| 2007 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 2008 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 2009 |
\relax |
| 2010 |
}; |
| 2011 |
}% |
| 2012 |
}% |
| 2013 |
{% |
| 2014 |
\ifboolKV[GraphiqueTikzCourbe]{Restreindre}% |
| 2015 |
{% |
| 2016 |
\path[draw=none,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {% |
| 2017 |
\xintthecoords\xintfloatexpr |
| 2018 |
seq((min(max(#2(t),\pflMinoffsetH),\pflMaxoffsetH), min(max(#3(t),\pflMinoffsetV),\pflMaxoffsetV)), |
| 2019 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 2020 |
..[\pflstepcurve]..% |
| 2021 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 2022 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 2023 |
\relax |
| 2024 |
}; |
| 2025 |
}% |
| 2026 |
{% |
| 2027 |
\path[draw=none,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {% |
| 2028 |
\xintthecoords\xintfloatexpr |
| 2029 |
seq((#2(t),#3(t)), |
| 2030 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 2031 |
..[\pflstepcurve]..% |
| 2032 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 2033 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 2034 |
\relax |
| 2035 |
}; |
| 2036 |
}% |
| 2037 |
}% |
| 2038 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{} |
| 2039 |
} |
| 2040 |
|
| 2041 |
\NewDocumentCommand\TracerCourbeParam{ O{} D<>{} m m }{% |
| 2042 |
\restoreKV[GraphiqueTikzCourbe]% |
| 2043 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 2044 |
%test dimension too large ?? |
| 2045 |
\ifboolKV[GraphiqueTikzCourbe]{Restreindre}% |
| 2046 |
{% |
| 2047 |
\xdef\pfloffsetV{\xintfloateval{((\pflymax)-(\pflymin))/20}}% |
| 2048 |
\xdef\pflMinoffsetV{\xintfloateval{(\pflymin)-(\pfloffsetV)}}% |
| 2049 |
\xdef\pflMaxoffsetV{\xintfloateval{(\pflymax)+(\pfloffsetV)}}% |
| 2050 |
\xdef\pfloffsetH{\xintfloateval{((\pflxmax)-(\pflxmin))/20}}% |
| 2051 |
\xdef\pflMinoffsetH{\xintfloateval{(\pflxmin)-(\pfloffsetH)}}% |
| 2052 |
\xdef\pflMaxoffsetH{\xintfloateval{(\pflxmax)+(\pfloffsetH)}}% |
| 2053 |
}% |
| 2054 |
{}% |
| 2055 |
%fin test |
| 2056 |
\IfStrEq{\pflstepcurve}{}% |
| 2057 |
{% |
| 2058 |
\xdef\pflstepcurve{\xintfloateval{((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/250}}% |
| 2059 |
}% |
| 2060 |
{}% |
| 2061 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{} |
| 2062 |
\IfEq{\pflnamecurve}{}% |
| 2063 |
{% |
| 2064 |
\ifboolKV[GraphiqueTikzCourbe]{RestreindreY}% |
| 2065 |
{% |
| 2066 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] plot[smooth] coordinates {% |
| 2067 |
\xintthecoords\xintfloatexpr |
| 2068 |
seq((min(max(#3,\pflMinoffsetH),\pflMaxoffsetH), min(max(#4,\pflMinoffsetV),\pflMaxoffsetV)), |
| 2069 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 2070 |
..[\pflstepcurve]..% |
| 2071 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 2072 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 2073 |
\relax |
| 2074 |
}; |
| 2075 |
}% |
| 2076 |
{% |
| 2077 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] plot[smooth] coordinates {% |
| 2078 |
\xintthecoords\xintfloatexpr |
| 2079 |
seq((#3,#4), |
| 2080 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 2081 |
..[\pflstepcurve]..% |
| 2082 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 2083 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 2084 |
\relax |
| 2085 |
}; |
| 2086 |
}% |
| 2087 |
}% |
| 2088 |
{% |
| 2089 |
\ifboolKV[GraphiqueTikzCourbe]{RestreindreY}% |
| 2090 |
{% |
| 2091 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {% |
| 2092 |
\xintthecoords\xintfloatexpr |
| 2093 |
seq((min(max(#3,\pflMinoffsetH),\pflMaxoffsetH), min(max(#4,\pflMinoffsetV),\pflMaxoffsetV)), |
| 2094 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 2095 |
..[\pflstepcurve]..% |
| 2096 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 2097 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 2098 |
\relax |
| 2099 |
}; |
| 2100 |
}% |
| 2101 |
{% |
| 2102 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {% |
| 2103 |
\xintthecoords\xintfloatexpr |
| 2104 |
seq((#3,#4), |
| 2105 |
t=\useKV[GraphiqueTikzCourbe]{Debut}% |
| 2106 |
..[\pflstepcurve]..% |
| 2107 |
\useKV[GraphiqueTikzCourbe]{Fin}, |
| 2108 |
\useKV[GraphiqueTikzCourbe]{Fin}) |
| 2109 |
\relax |
| 2110 |
}; |
| 2111 |
}% |
| 2112 |
}% |
| 2113 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{} |
| 2114 |
} |
| 2115 |
|
| 2116 |
\NewDocumentCommand\DefinirCourbePol{ O{} D<>{phi} m }{% |
| 2117 |
\restoreKV[GraphiqueTikzCourbe]% |
| 2118 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 2119 |
\xintdeffloatfunc #2(theta) := #3 ;% |
| 2120 |
\DefinirCourbeParam[#1]<phix><phiy>{pflpol(t)*cos(t)}{pflpol(t)*sin(t)}% |
| 2121 |
} |
| 2122 |
|
| 2123 |
\NewDocumentCommand\TracerCourbePol{ O{} m }{% |
| 2124 |
\restoreKV[GraphiqueTikzCourbe]% |
| 2125 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 2126 |
\xintdeffloatfunc tmppflpol(theta) := #2 ;% |
| 2127 |
\TracerCourbeParam[#1]{tmppflpol(t)*cos(t)}{tmppflpol(t)*sin(t)}% |
| 2128 |
} |
| 2129 |
|
| 2130 |
%====MACRO INTERNE : nb dérivé via intersections (pour spline) |
| 2131 |
\NewDocumentCommand\tkzg@nbderive@spline{ m m m }{% |
| 2132 |
\path[name path=pflvlineL] ({#2-#3},{\pflymin}) -- ({#2-#3},{\pflymax}) ; |
| 2133 |
\path[name path=pflvlineR] ({#2+#3},{\pflymin}) -- ({#2+#3},{\pflymax}) ; |
| 2134 |
\path[name intersections={of=#1 and pflvlineL, name=pflintL}] ; |
| 2135 |
\path[name intersections={of=#1 and pflvlineR, name=pflintR}] ; |
| 2136 |
\path (pflintL-1) ; \pgfgetlastxy{\macrox}{\macroy}% |
| 2137 |
\xdef\tkzg@nbderivLY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 2138 |
\path (pflintR-1) ; \pgfgetlastxy{\macrox}{\macroy}% |
| 2139 |
\xdef\tkzg@nbderivRY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 2140 |
\xdef\tkzg@nbderiv{\xintfloateval{(\tkzg@nbderivRY-\tkzg@nbderivLY)/(2*#3)}}% |
| 2141 |
} |
| 2142 |
|
| 2143 |
%====TRACER LA DERIVEE NUMERIQUE D'UNE FONCTION NOMMEE OU D'UN SPLINE |
| 2144 |
\NewDocumentCommand\TracerDerivee{ O{} m }{% |
| 2145 |
\restoreKV[GraphiqueTikzCourbe]% |
| 2146 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 2147 |
\IfStrEq{\pflstepcurve}{}% |
| 2148 |
{\xdef\pflstepcurve{\xintfloateval{% |
| 2149 |
((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}% |
| 2150 |
}% |
| 2151 |
{}% |
| 2152 |
\IfStrEq{\pflhderiv}{}% |
| 2153 |
{\ifboolKV[GraphiqueTikzCourbe]{Spline}% |
| 2154 |
{\xdef\pflhderiv{\xintfloateval{0.5*\pflstepcurve}}}% |
| 2155 |
{\def\pflhderiv{0.1}}% |
| 2156 |
}% |
| 2157 |
{}% |
| 2158 |
\ifboolKV[GraphiqueTikzCourbe]{Spline}% |
| 2159 |
{% |
| 2160 |
% Bornes sécurisées |
| 2161 |
\xdef\pfldebutderiv{\xintfloateval{(\useKV[GraphiqueTikzCourbe]{Debut})+\pflhderiv}}% |
| 2162 |
\xdef\pflfinderiv{\xintfloateval{(\useKV[GraphiqueTikzCourbe]{Fin})-\pflhderiv}}% |
| 2163 |
% Liste des xi |
| 2164 |
\edef\pfllistexvals{\xintfloateval{% |
| 2165 |
seq(x, x=\pfldebutderiv..[\pflstepcurve]..\pflfinderiv, \pflfinderiv)}}% |
| 2166 |
% Construction de la liste de points (xi, f'(xi)) |
| 2167 |
\gdef\pfllistederivspline{}% |
| 2168 |
\foreach \tmpxi in \pfllistexvals {% |
| 2169 |
\tkzg@nbderive@spline{#2}{\tmpxi}{\pflhderiv}% |
| 2170 |
\xdef\pfllistederivspline{\pfllistederivspline (\tmpxi,\tkzg@nbderiv)}% |
| 2171 |
}% |
| 2172 |
% Tracé |
| 2173 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}% |
| 2174 |
\IfEq{\pflnamecurve}{}% |
| 2175 |
{% |
| 2176 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] plot[smooth] coordinates {\pfllistederivspline} ; |
| 2177 |
}% |
| 2178 |
{% |
| 2179 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth] coordinates {\pfllistederivspline} ; |
| 2180 |
}% |
| 2181 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{}% |
| 2182 |
}% |
| 2183 |
{% |
| 2184 |
% Bornes sécurisées : on recule de h de chaque côté (semble OK) |
| 2185 |
\xdef\pfldebutderiv{\xintfloateval{(\useKV[GraphiqueTikzCourbe]{Debut})+\pflhderiv}}% |
| 2186 |
\xdef\pflfinderiv {\xintfloateval{(\useKV[GraphiqueTikzCourbe]{Fin}) -\pflhderiv}}% |
| 2187 |
% Dérivée numérique centrée |
| 2188 |
\xintdeffloatfunc pflnumderiv(x) := (#2(x+\pflhderiv) - #2(x-\pflhderiv)) / (2*\pflhderiv);% |
| 2189 |
% Tracé |
| 2190 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}% |
| 2191 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}% |
| 2192 |
\IfEq{\pflnamecurve}{}% |
| 2193 |
{% |
| 2194 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] |
| 2195 |
plot[smooth] coordinates {% |
| 2196 |
\xintthecoords\xintfloatexpr |
| 2197 |
seq((x,pflnumderiv(x)), |
| 2198 |
x=\pfldebutderiv..[\pflstepcurve]..\pflfinderiv, |
| 2199 |
\pflfinderiv) |
| 2200 |
\relax |
| 2201 |
};% |
| 2202 |
}% |
| 2203 |
{% |
| 2204 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 2205 |
plot[smooth] coordinates {% |
| 2206 |
\xintthecoords\xintfloatexpr |
| 2207 |
seq((x,pflnumderiv(x)), |
| 2208 |
x=\pfldebutderiv..[\pflstepcurve]..\pflfinderiv, |
| 2209 |
\pflfinderiv) |
| 2210 |
\relax |
| 2211 |
};% |
| 2212 |
}% |
| 2213 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{}% |
| 2214 |
}% |
| 2215 |
} |
| 2216 |
|
| 2217 |
\NewDocumentCommand\TracerPrimitive{ O{} m m m }{% |
| 2218 |
% #1 = options KV (Couleur, Debut, Fin, Pas, Clip, StyleTrace...) |
| 2219 |
% #2 = nom de la fonction (définie via \DefinirCourbe) |
| 2220 |
% #3 = x0 (abscisse du point de passage) |
| 2221 |
% #4 = y0 (ordonnée du point de passage) |
| 2222 |
\restoreKV[GraphiqueTikzCourbe]% |
| 2223 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 2224 |
% Pas de tracé par défaut |
| 2225 |
\IfStrEq{\pflstepcurve}{}% |
| 2226 |
{\xdef\pflstepcurve{\xintfloateval{% |
| 2227 |
((\useKV[GraphiqueTikzCourbe]{Fin})-(\useKV[GraphiqueTikzCourbe]{Debut}))/100}}}% |
| 2228 |
{}% |
| 2229 |
% Bornes sécurisées (comme pour \TracerDerivee) |
| 2230 |
\xdef\pfldebutprim{\xintfloateval{(\useKV[GraphiqueTikzCourbe]{Debut})+\pflstepcurve/10}}% |
| 2231 |
\xdef\pflfinprim {\xintfloateval{(\useKV[GraphiqueTikzCourbe]{Fin}) -\pflstepcurve/10}}% |
| 2232 |
% Primitive numérique — méthode des trapèzes, gestion des deux sens |
| 2233 |
\xintdeffloatfunc pflnumprimitive(x) := |
| 2234 |
(x > #3) ? |
| 2235 |
{% x à droite de x0 : intégrale de x0 à x |
| 2236 |
#4 + \pflstepcurve*( |
| 2237 |
#2(#3)/2 |
| 2238 |
+ add(#2(t), t=(#3+\pflstepcurve)..[(\pflstepcurve)]..(x-\pflstepcurve)) |
| 2239 |
+ #2(x)/2 |
| 2240 |
) |
| 2241 |
} |
| 2242 |
{ (x < #3) ? |
| 2243 |
{% x à gauche de x0 : intégrale de x à x0, changement de signe |
| 2244 |
#4 - \pflstepcurve*( |
| 2245 |
#2(x)/2 |
| 2246 |
+ add(#2(t), t=(x+\pflstepcurve)..[(\pflstepcurve)]..(#3-\pflstepcurve)) |
| 2247 |
+ #2(#3)/2 |
| 2248 |
) |
| 2249 |
} |
| 2250 |
{ #4 }% x == x0 exactement |
| 2251 |
};% |
| 2252 |
% Tracé |
| 2253 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}% |
| 2254 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}% |
| 2255 |
\IfEq{\pflnamecurve}{}% |
| 2256 |
{% |
| 2257 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] |
| 2258 |
plot[smooth] coordinates {% |
| 2259 |
\xintthecoords\xintfloatexpr |
| 2260 |
seq((x,pflnumprimitive(x)), |
| 2261 |
x=\pfldebutprim..[\pflstepcurve]..\pflfinprim, |
| 2262 |
\pflfinprim) |
| 2263 |
\relax |
| 2264 |
};% |
| 2265 |
}% |
| 2266 |
{% |
| 2267 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] |
| 2268 |
plot[smooth] coordinates {% |
| 2269 |
\xintthecoords\xintfloatexpr |
| 2270 |
seq((x,pflnumprimitive(x)), |
| 2271 |
x=\pfldebutprim..[\pflstepcurve]..\pflfinprim, |
| 2272 |
\pflfinprim) |
| 2273 |
\relax |
| 2274 |
};% |
| 2275 |
}% |
| 2276 |
\ifboolKV[GraphiqueTikzCourbe]{Clip}{\end{scope}}{}% |
| 2277 |
} |
| 2278 |
|
| 2279 |
\NewDocumentCommand\DefinirListeInterpo{ m O{\malisteinterpo} }{% |
| 2280 |
\def#2{#1}% |
| 2281 |
} |
| 2282 |
|
| 2283 |
\NewDocumentCommand\DefinirCourbeInterpo{ O{} m }{% |
| 2284 |
\restoreKV[GraphiqueTikzCourbe]% |
| 2285 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 2286 |
\begin{scope} |
| 2287 |
\ifboolKV[GraphiqueTikzCourbe]{Trace}% |
| 2288 |
{% |
| 2289 |
\path[draw,pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphiqueTikzCourbe]{Tension}}] coordinates {#2}; |
| 2290 |
}% |
| 2291 |
{% |
| 2292 |
\path[draw=none,pflcourbe,{\useKV[GraphiqueTikzCourbe]{Couleur}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphiqueTikzCourbe]{Tension}}] coordinates {#2}; |
| 2293 |
}% |
| 2294 |
\end{scope} |
| 2295 |
} |
| 2296 |
|
| 2297 |
\NewDocumentCommand\TracerCourbeInterpo{ O{} m }{% |
| 2298 |
%2=liste |
| 2299 |
\restoreKV[GraphiqueTikzCourbe]% |
| 2300 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 2301 |
\begin{scope} |
| 2302 |
\draw[pflcourbe,\pflstylecurve,{\useKV[GraphiqueTikzCourbe]{Couleur}}] plot [smooth,tension={\useKV[GraphiqueTikzCourbe]{Tension}}] coordinates {#2} ; |
| 2303 |
\end{scope} |
| 2304 |
} |
| 2305 |
|
| 2306 |
\NewDocumentCommand\DefinirListeSpline{ m O{\malistespline} }{% |
| 2307 |
\def#2{#1}% |
| 2308 |
} |
| 2309 |
|
| 2310 |
\newcommand\pflextractcoeff[2]{%1=liste,2=numero |
| 2311 |
\setsepchar{§}% |
| 2312 |
\readlist*\lcoeffs{#1} |
| 2313 |
\ifnum \lcoeffslen=1 |
| 2314 |
\def\COEFFA{#1} |
| 2315 |
\def\COEFFB{#1} |
| 2316 |
\else |
| 2317 |
\itemtomacro\lcoeffs[#2]\COEFF |
| 2318 |
\IfSubStr{\COEFF}{/}% |
| 2319 |
{\StrCut{\COEFF}{/}{\COEFFA}{\COEFFB}}% |
| 2320 |
{\def\COEFFA{\COEFF}\def\COEFFB{\COEFF}} |
| 2321 |
\fi |
| 2322 |
} |
| 2323 |
|
| 2324 |
\defKV[GraphiqueTikzSpline]{% |
| 2325 |
Nom=\def\pflsplinename{#1},% |
| 2326 |
Coeffs=\def\pflsplinecoeffs{#1},% |
| 2327 |
StyleTrace=\def\pflsplinestyle{#1} |
| 2328 |
} |
| 2329 |
|
| 2330 |
\setKVdefault[GraphiqueTikzSpline]{% |
| 2331 |
Nom=spline,% |
| 2332 |
Couleur=black,% |
| 2333 |
Coeffs=3,% |
| 2334 |
Trace=false,% |
| 2335 |
Alt=false,% |
| 2336 |
StyleTrace={} |
| 2337 |
} |
| 2338 |
|
| 2339 |
\NewDocumentCommand\GenererSpline{ s m m O{\monspline} }{% |
| 2340 |
%1=liste |
| 2341 |
\setsepchar[.]{§./}% |
| 2342 |
\readlist*\SPLlistepoints{#2}% |
| 2343 |
%les données |
| 2344 |
\def\tmpsplinenumdeb{1} |
| 2345 |
\def\tmpsplinenumfin{\SPLlistepointslen}% |
| 2346 |
\pflextractcoeff{#3}{\tmpsplinenumdeb}% |
| 2347 |
%nb de calculs |
| 2348 |
\def\SPLnbsplines{\inteval{\tmpsplinenumfin-1}}% |
| 2349 |
%extraction des coordonnées |
| 2350 |
\itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xa% |
| 2351 |
\itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\ya% |
| 2352 |
\itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimea% |
| 2353 |
\itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xb% |
| 2354 |
\itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\yb% |
| 2355 |
\itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimeb% |
| 2356 |
\IfBooleanTF{#1}% |
| 2357 |
{% |
| 2358 |
% mode Alt : on garde le signe de (xb-xa), pas de abs() |
| 2359 |
\xdef#4{(\xa,\ya) ..controls +({((\xb)-(\xa))/\COEFFA},{(\fprimea)*((\xb)-(\xa))/\COEFFA}) and +({-((\xb)-(\xa))/\COEFFA},{-(\fprimeb)*((\xb)-(\xa))/\COEFFA}).. (\xb,\yb)}% |
| 2360 |
}% |
| 2361 |
{% |
| 2362 |
% mode polaire : abs() sur le rayon uniquement |
| 2363 |
\xdef#4{(\xa,\ya) ..controls +({atan (\fprimea)}:{((\xb)-(\xa))/\COEFFA}) and +({-180 + atan (\fprimeb)}:{((\xb)-(\xa))/\COEFFA}).. (\xb,\yb)}% |
| 2364 |
}% |
| 2365 |
\foreach \i in {\tmpsplinenumdeb,...,\SPLnbsplines}{% |
| 2366 |
\pflextractcoeff{#3}{\i}% |
| 2367 |
\def\j{\inteval{\i+1}}% |
| 2368 |
\itemtomacro\SPLlistepoints[\i,1]\xa% |
| 2369 |
\itemtomacro\SPLlistepoints[\i,2]\ya% |
| 2370 |
\itemtomacro\SPLlistepoints[\i,3]\fprimea% |
| 2371 |
\itemtomacro\SPLlistepoints[\j,1]\xb% |
| 2372 |
\itemtomacro\SPLlistepoints[\j,2]\yb% |
| 2373 |
\itemtomacro\SPLlistepoints[\j,3]\fprimeb% |
| 2374 |
\IfBooleanTF{#1}% |
| 2375 |
{% |
| 2376 |
\xdef#4{#4 ..controls +({((\xb)-(\xa))/\COEFFA},{(\fprimea)*((\xb)-(\xa))/\COEFFA}) and +({-((\xb)-(\xa))/\COEFFA},{-(\fprimeb)*((\xb)-(\xa))/\COEFFA}).. (\xb,\yb)}% |
| 2377 |
}% |
| 2378 |
{% |
| 2379 |
\xdef#4{#4 ..controls +({atan (\fprimea)}:{((\xb)-(\xa))/\COEFFA}) and +({-180 + atan (\fprimeb)}:{((\xb)-(\xa))/\COEFFB}).. (\xb,\yb)}% |
| 2380 |
}% |
| 2381 |
}% |
| 2382 |
} |
| 2383 |
|
| 2384 |
\NewDocumentCommand\DefinirCourbeSpline{ O{} m D<>{\monspline} }{% |
| 2385 |
%1=liste |
| 2386 |
\restoreKV[GraphiqueTikzSpline]% |
| 2387 |
\setKV[GraphiqueTikzSpline]{#1}% |
| 2388 |
\ifboolKV[GraphiqueTikzSpline]{Alt}% |
| 2389 |
{% |
| 2390 |
\GenererSpline*{#2}{\pflsplinecoeffs}[#3]% |
| 2391 |
}% |
| 2392 |
{% |
| 2393 |
\GenererSpline{#2}{\pflsplinecoeffs}[#3]% |
| 2394 |
}% |
| 2395 |
\begin{scope} |
| 2396 |
\ifboolKV[GraphiqueTikzSpline]{Trace}% |
| 2397 |
{% |
| 2398 |
\path[draw,pflcourbe,\pflsplinestyle,{\useKV[GraphiqueTikzSpline]{Couleur}},name path global=\pflsplinename] #3 ; |
| 2399 |
}% |
| 2400 |
{% |
| 2401 |
\path[draw=none,pflcourbe,name path global=\pflsplinename] #3 ; |
| 2402 |
}% |
| 2403 |
\end{scope} |
| 2404 |
} |
| 2405 |
|
| 2406 |
\NewDocumentCommand\DefinirSpline{ O{} m D<>{\monspline} }{%old version |
| 2407 |
%1=liste |
| 2408 |
\restoreKV[GraphiqueTikzSpline]% |
| 2409 |
\setKV[GraphiqueTikzSpline]{#1}% |
| 2410 |
\GenererSpline{#2}{\pflsplinecoeffs}[#3]% |
| 2411 |
\begin{scope} |
| 2412 |
\ifboolKV[GraphiqueTikzSpline]{Trace}% |
| 2413 |
{% |
| 2414 |
\path[draw,pflcourbe,\pflsplinestyle,{\useKV[GraphiqueTikzSpline]{Couleur}},name path global=\pflsplinename] #3 ; |
| 2415 |
}% |
| 2416 |
{% |
| 2417 |
\path[draw=none,pflcourbe,name path global=\pflsplinename] #3 ; |
| 2418 |
}% |
| 2419 |
\end{scope} |
| 2420 |
} |
| 2421 |
|
| 2422 |
\NewDocumentCommand\TracerCourbeSpline{ O{} m D<>{\monspline} }{% |
| 2423 |
%1=liste |
| 2424 |
\restoreKV[GraphiqueTikzSpline]% |
| 2425 |
\setKV[GraphiqueTikzSpline]{#1}% |
| 2426 |
\ifboolKV[GraphiqueTikzSpline]{Alt}% |
| 2427 |
{% |
| 2428 |
\GenererSpline*{#2}{\pflsplinecoeffs}[#3]% |
| 2429 |
}% |
| 2430 |
{% |
| 2431 |
\GenererSpline{#2}{\pflsplinecoeffs}[#3]% |
| 2432 |
}% |
| 2433 |
\begin{scope} |
| 2434 |
\draw[pflcourbe,\pflsplinestyle,{\useKV[GraphiqueTikzSpline]{Couleur}}] #3 ; |
| 2435 |
\end{scope} |
| 2436 |
} |
| 2437 |
|
| 2438 |
\NewDocumentCommand\TracerSpline{ O{} m D<>{\monspline} }{%old version |
| 2439 |
%1=liste |
| 2440 |
\restoreKV[GraphiqueTikzSpline]% |
| 2441 |
\setKV[GraphiqueTikzSpline]{#1}% |
| 2442 |
\GenererSpline{#2}{\pflsplinecoeffs}[#3]% |
| 2443 |
\begin{scope} |
| 2444 |
\draw[pflcourbe,\pflsplinestyle,{\useKV[GraphiqueTikzSpline]{Couleur}}] #3 ; |
| 2445 |
\end{scope} |
| 2446 |
} |
| 2447 |
|
| 2448 |
%===INTERSECTION & ANTÉCÉDENTS |
| 2449 |
\defKV[GraphiqueTikzIntersect]{% |
| 2450 |
Nom=\def\pflintercurves{#1},% |
| 2451 |
ListeRes=\def\pflinterlistres{#1} |
| 2452 |
} |
| 2453 |
\setKVdefault[GraphiqueTikzIntersect]{% |
| 2454 |
Nom=S, |
| 2455 |
Aff=true, |
| 2456 |
Couleur=black, |
| 2457 |
AffDroite=false,% |
| 2458 |
Traits=false,% |
| 2459 |
Style=o,% |
| 2460 |
ListeRes={} |
| 2461 |
} |
| 2462 |
|
| 2463 |
\NewDocumentCommand\TrouverIntersections{ O{} m m D<>{\myt} }{% |
| 2464 |
\restoreKV[GraphiqueTikzIntersect]% |
| 2465 |
\setKV[GraphiqueTikzIntersect]{#1}% |
| 2466 |
\path[name intersections={of=#2 and #3,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}}; |
| 2467 |
\ifboolKV[GraphiqueTikzIntersect]{Aff}% |
| 2468 |
{% |
| 2469 |
\xintifboolexpr{#4 == 0}{}% |
| 2470 |
{% |
| 2471 |
\foreach \i in {1,...,#4}{% |
| 2472 |
\ifboolKV[GraphiqueTikzIntersect]{Traits}% |
| 2473 |
{% |
| 2474 |
\draw[pfltraitimg,{\useKV[GraphiqueTikzIntersect]{Couleur}}]let \p1 = (\pflintercurves-\i) in (\pflintercurves-\i) -- ({\x1},{\pflOy}) ; |
| 2475 |
}% |
| 2476 |
{}% |
| 2477 |
\MarquerPts*[Style={\useKV[GraphiqueTikzIntersect]{Style}},Couleur={\useKV[GraphiqueTikzIntersect]{Couleur}}]{(\pflintercurves-\i)} |
| 2478 |
%\filldraw[{\useKV[GraphiqueTikzIntersect]{Couleur}}] (\pflintercurves-\i) circle[pflpointc] ; |
| 2479 |
} |
| 2480 |
}% |
| 2481 |
}% |
| 2482 |
{}% |
| 2483 |
\IfStrEq{\pflinterlistres}{}% |
| 2484 |
{}% |
| 2485 |
{% |
| 2486 |
\xdef\tkzgtmplistabsc{}% |
| 2487 |
\xintifboolexpr{#4 == 0}{}% |
| 2488 |
{% |
| 2489 |
\foreach \i in {1,...,#4}{% |
| 2490 |
\RecupererAbscisse{(\pflintercurves-\i)}[\tmpabsi]% |
| 2491 |
\xintifboolexpr{\i == 1}% |
| 2492 |
{\xdef\tkzgtmplistabsc{\tmpabsi}}% |
| 2493 |
{\xdef\tkzgtmplistabsc{\tkzgtmplistabsc,\tmpabsi}}% |
| 2494 |
}% |
| 2495 |
}% |
| 2496 |
\expandafter\xdef\csname\pflinterlistres\endcsname{\tkzgtmplistabsc}% |
| 2497 |
}% |
| 2498 |
} |
| 2499 |
|
| 2500 |
\NewDocumentCommand\TrouverAntecedents{ O{} m m D<>{\myantec} }{% |
| 2501 |
\restoreKV[GraphiqueTikzIntersect]% |
| 2502 |
\setKV[GraphiqueTikzIntersect]{#1}% |
| 2503 |
\begin{scope} |
| 2504 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 2505 |
\ifboolKV[GraphiqueTikzIntersect]{AffDroite}% |
| 2506 |
{% |
| 2507 |
\path[draw,{\useKV[GraphiqueTikzIntersect]{Couleur}},pflcourbe,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ; |
| 2508 |
}% |
| 2509 |
{% |
| 2510 |
\path[draw=none,pflcourbe,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ; |
| 2511 |
}% |
| 2512 |
\path[name intersections={of=#2 and tmpanteced,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}}; |
| 2513 |
\IfStrEq{\pflinterlistres}{}% |
| 2514 |
{}% |
| 2515 |
{% |
| 2516 |
\xdef\tkzgtmplistabsc{}% |
| 2517 |
\xintifboolexpr{#4 == 0}{}% |
| 2518 |
{% |
| 2519 |
\foreach \i in {1,...,#4}{% |
| 2520 |
\RecupererAbscisse{(\pflintercurves-\i)}[\tmpabsi]% |
| 2521 |
\xintifboolexpr{\i == 1}% |
| 2522 |
{\xdef\tkzgtmplistabsc{\tmpabsi}}% |
| 2523 |
{\xdef\tkzgtmplistabsc{\tkzgtmplistabsc,\tmpabsi}}% |
| 2524 |
}% |
| 2525 |
}% |
| 2526 |
\expandafter\xdef\csname\pflinterlistres\endcsname{\tkzgtmplistabsc}% |
| 2527 |
}% |
| 2528 |
\ifboolKV[GraphiqueTikzIntersect]{Aff}% |
| 2529 |
{% |
| 2530 |
\xintifboolexpr{#4 == 0}{}% |
| 2531 |
{% |
| 2532 |
\foreach \i in {1,...,#4}{% |
| 2533 |
\MarquerPts*[Style={\useKV[GraphiqueTikzIntersect]{Style}},Couleur={\useKV[GraphiqueTikzIntersect]{Couleur}}]{(\pflintercurves-\i)} |
| 2534 |
%\filldraw[{\useKV[GraphiqueTikzIntersect]{Couleur}}] (\pflintercurves-\i) circle[pflpointc] ; |
| 2535 |
} |
| 2536 |
}% |
| 2537 |
}% |
| 2538 |
{}% |
| 2539 |
\end{scope} |
| 2540 |
} |
| 2541 |
|
| 2542 |
%====MONTE CARLO |
| 2543 |
\defKV[graphiquetikzmontecarlo]{% |
| 2544 |
Couleurs=\def\graphtikzmccols{#1},% |
| 2545 |
BornesX=\def\graphtikzmcxbornes{#1},% |
| 2546 |
BornesY=\def\graphtikzmcybornes{#1} |
| 2547 |
} |
| 2548 |
|
| 2549 |
\setKVdefault[graphiquetikzmontecarlo]{% |
| 2550 |
Couleurs={blue/red},% |
| 2551 |
BornesX={\pflxmin,\pflxmax},% |
| 2552 |
BornesY={\pflymin,\pflymax} |
| 2553 |
} |
| 2554 |
|
| 2555 |
\NewDocumentCommand\SimulerMonteCarlo{ O{} D<>{f} m O{\nbptsmcok} O{\nbptsmcko} }{% |
| 2556 |
\restoreKV[graphiquetikzmontecarlo]% |
| 2557 |
\setKV[graphiquetikzmontecarlo]{#1}% |
| 2558 |
\StrCut{\graphtikzmccols}{/}{\tmpMCcolOK}{\tmpMCcolKO}% |
| 2559 |
\StrCut{\graphtikzmcxbornes}{,}{\tmpMCxmin}{\tmpMCxmax}% |
| 2560 |
\StrCut{\graphtikzmcybornes}{,}{\tmpMCymin}{\tmpMCymax}% |
| 2561 |
\xdef#4{0}% |
| 2562 |
\xdef#5{0}% |
| 2563 |
\xdef\nbptsmc{#3}% |
| 2564 |
\foreach \i in {1,...,#3}{% |
| 2565 |
\xdef\tmpMCrandX{\xintfloateval{random()*((\tmpMCxmax)-(\tmpMCxmin))+(\tmpMCxmin)}}% |
| 2566 |
\xdef\tmpMCrandY{\xintfloateval{random()*((\tmpMCymax)-(\tmpMCymin))+(\tmpMCymin)}}% |
| 2567 |
\xdef\tmpMCrandfX{\xintfloateval{#2(\tmpMCrandX)}}% |
| 2568 |
\xintifboolexpr{ \tmpMCrandfX > \tmpMCrandY }% |
| 2569 |
{% |
| 2570 |
\xdef#4{\xinteval{#4+1}}% |
| 2571 |
\filldraw[\tmpMCcolOK] (\tmpMCrandX,\tmpMCrandY) circle[pflpointmc] ; |
| 2572 |
}% |
| 2573 |
{% |
| 2574 |
\xdef#5{\xinteval{#5+1}}% |
| 2575 |
\filldraw[\tmpMCcolKO] (\tmpMCrandX,\tmpMCrandY) circle[pflpointmc] ; |
| 2576 |
}% |
| 2577 |
}% |
| 2578 |
} |
| 2579 |
|
| 2580 |
%====MÉTHODES INTÉGRALES |
| 2581 |
\defKV[graphiquetikzintegr]{% |
| 2582 |
Couleur=\def\graphtikzintgrcol{#1},% |
| 2583 |
CouleurRemplissage=\def\graphtikzintgrcolrempl{#1},% |
| 2584 |
NbSubDiv=\def\graphtikzintgrnb{#1},% |
| 2585 |
Methode=\def\graphtikzintgrtype{#1},% |
| 2586 |
Opacite=\def\graphtikzintgropac{#1} |
| 2587 |
} |
| 2588 |
|
| 2589 |
\setKVdefault[graphiquetikzintegr]{% |
| 2590 |
Couleur=red,% |
| 2591 |
NbSubDiv=10,% |
| 2592 |
Methode=RectanglesGauche,% |
| 2593 |
Remplir=true,% |
| 2594 |
CouleurRemplissage={\graphtikzintgrcol!25},% |
| 2595 |
Opacite=0.25,% |
| 2596 |
Spline=false |
| 2597 |
} |
| 2598 |
|
| 2599 |
\NewDocumentCommand\RepresenterMethodeIntegrale{ O{} D<>{f} m m }{%opts+nom_fct/spline+a+b |
| 2600 |
\useKVdefault[graphiquetikzintegr]% |
| 2601 |
\setKV[graphiquetikzintegr]{#1}% |
| 2602 |
\ifboolKV[graphiquetikzintegr]{Remplir}% |
| 2603 |
{% |
| 2604 |
\tikzset{pflfigureintegr/.style={pfltrait,\graphtikzintgrcol,fill=\graphtikzintgrcolrempl,fill opacity=\graphtikzintgropac}}% |
| 2605 |
}% |
| 2606 |
{% |
| 2607 |
\tikzset{pflfigureintegr/.style={pfltrait,\graphtikzintgrcol}}% |
| 2608 |
}% |
| 2609 |
\tikzset{figureintegr/.style={pfltrait,\graphtikzintgrcol,fill=\graphtikzintgrcolrempl,fill opacity=\graphtikzintgropac}}% |
| 2610 |
\def\TmpH{(#4-#3)/\graphtikzintgrnb} |
| 2611 |
\ifboolKV[graphiquetikzintegr]{Spline}% |
| 2612 |
{% |
| 2613 |
\IfEq{\graphtikzintgrtype}{RectanglesGauche}% |
| 2614 |
{% |
| 2615 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% |
| 2616 |
\path[draw=none,pflcourbe,name path=tmpintmethod] ({#3+\i*\TmpH},{\pflymin})--({#3+\i*\TmpH},{\pflymax}) ; |
| 2617 |
\path[name intersections={of=#2 and tmpintmethod,name=KLM}] ; |
| 2618 |
\draw[pflfigureintegr] let \p1 = (KLM-1) in ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\y1}) ; |
| 2619 |
}% |
| 2620 |
}% |
| 2621 |
{}% |
| 2622 |
\IfEq{\graphtikzintgrtype}{RectanglesDroite}% |
| 2623 |
{% |
| 2624 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% |
| 2625 |
\path[draw=none,pflcourbe,name path=tmpintmethod] ({#3+(\i+1)*\TmpH},{\pflymin})--({#3+(\i+1)*\TmpH},{\pflymax}) ; |
| 2626 |
\path[name intersections={of=#2 and tmpintmethod,name=KLM}] ; |
| 2627 |
\draw[pflfigureintegr] let \p1 = (KLM-1) in ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\y1}) ; |
| 2628 |
}% |
| 2629 |
}% |
| 2630 |
{}% |
| 2631 |
\IfEq{\graphtikzintgrtype}{RectanglesMilieu}% |
| 2632 |
{% |
| 2633 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% |
| 2634 |
\path[draw=none,pflcourbe,name path=tmpintmethod] ({#3+(\i+0.5)*\TmpH},{\pflymin})--({#3+(\i+0.5)*\TmpH},{\pflymax}) ; |
| 2635 |
\path[name intersections={of=#2 and tmpintmethod,name=KLM}] ; |
| 2636 |
\draw[pflfigureintegr] let \p1 = (KLM-1) in ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\y1}) ; |
| 2637 |
}% |
| 2638 |
}% |
| 2639 |
{}% |
| 2640 |
\IfEq{\graphtikzintgrtype}{Trapezes}% |
| 2641 |
{% |
| 2642 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}{% |
| 2643 |
\path[draw=none,pflcourbe,name path=tmpintmethodg] ({#3+(\i)*\TmpH},{\pflymin})--({#3+(\i)*\TmpH},{\pflymax}) ; |
| 2644 |
\path[name intersections={of=#2 and tmpintmethodg,name=KLMg}] ; |
| 2645 |
\path[draw=none,pflcourbe,name path=tmpintmethodd] ({#3+(\i+1)*\TmpH},{\pflymin})--({#3+(\i+1)*\TmpH},{\pflymax}) ; |
| 2646 |
\path[name intersections={of=#2 and tmpintmethodd,name=KLMd}] ; |
| 2647 |
\draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) -- (KLMg-1) -- (KLMd-1) -- ({#3+(\i+1)*\TmpH},{0}) -- cycle ; |
| 2648 |
}% |
| 2649 |
}% |
| 2650 |
{}% |
| 2651 |
}% |
| 2652 |
{% |
| 2653 |
\IfEq{\graphtikzintgrtype}{RectanglesGauche}% |
| 2654 |
{% |
| 2655 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% |
| 2656 |
\draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\xintfloateval{#2(#3+\i*\TmpH)}}) ; |
| 2657 |
}% |
| 2658 |
{}% |
| 2659 |
\IfEq{\graphtikzintgrtype}{RectanglesDroite}% |
| 2660 |
{% |
| 2661 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% |
| 2662 |
\draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\xintfloateval{#2(#3+(\i+1)*\TmpH)}}) ; |
| 2663 |
}% |
| 2664 |
{}% |
| 2665 |
\IfEq{\graphtikzintgrtype}{RectanglesMilieu}% |
| 2666 |
{% |
| 2667 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% |
| 2668 |
\draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) rectangle++ ({\TmpH},{\xintfloateval{#2(#3+(\i+0.5)*\TmpH)}}) ; |
| 2669 |
}% |
| 2670 |
{}% |
| 2671 |
\IfEq{\graphtikzintgrtype}{Trapezes}% |
| 2672 |
{% |
| 2673 |
\foreach \i in {0,...,\inteval{\graphtikzintgrnb-1}}% |
| 2674 |
\draw[pflfigureintegr] ({#3+\i*\TmpH},{0}) -- ({#3+\i*\TmpH},{\xintfloateval{#2(#3+\i*\TmpH)}}) -- ({#3+(\i+1)*\TmpH},{\xintfloateval{#2(#3+(\i+1)*\TmpH)}}) -- ({#3+(\i+1)*\TmpH},{0}) -- cycle ; |
| 2675 |
}% |
| 2676 |
{}% |
| 2677 |
}% |
| 2678 |
} |
| 2679 |
|
| 2680 |
%====INTÉGRALES |
| 2681 |
%v2 avec modification de la clé [Type=...] ? |
| 2682 |
\defKV[GraphiqueTikzIntegr]{% |
| 2683 |
Couleurs=\def\pfldomtikzcolors{#1},% |
| 2684 |
Style=\def\pfldomtikzstyle{#1},% |
| 2685 |
Opacite=\def\pfldomtikzopac{#1},% |
| 2686 |
Hachures=\def\pfldomtikzhatch{#1},% |
| 2687 |
Type=\def\pfldomtikztype{#1},% |
| 2688 |
Pas=\def\pflstepcurve{#1},% |
| 2689 |
Bornes=\def\pflintbornes{#1},% |
| 2690 |
Jonction=\def\pfldomtikzjoin{#1},% |
| 2691 |
NomInterpo=\def\pfldomtikznameinterpo{#1},% |
| 2692 |
NomInterpoB=\def\pfldomtikznameinterpob{#1},% |
| 2693 |
NomSpline=\def\pfldomtikznamespline{#1},% |
| 2694 |
NomSplineB=\def\pfldomtikznamesplineb{#1} |
| 2695 |
} |
| 2696 |
\setKVdefault[GraphiqueTikzIntegr]{% |
| 2697 |
Couleurs=gray,% |
| 2698 |
Style=remplissage,% |
| 2699 |
Opacite=0.5,% |
| 2700 |
Hachures={north west lines},% |
| 2701 |
Type=fct,% |
| 2702 |
Pas={},% |
| 2703 |
Jonction=bevel,% |
| 2704 |
Bornes=abs,% |
| 2705 |
Bord=true,% |
| 2706 |
Spline=false,% |
| 2707 |
SplineB=false,% |
| 2708 |
NomInterpo={\moninterpo},% |
| 2709 |
NomInterpoB={\moninterpoB},% |
| 2710 |
NomSpline={\monspline},% |
| 2711 |
NomSplineB={\monsplineB},% |
| 2712 |
Tension=0.5,% |
| 2713 |
TensionB=0.5 |
| 2714 |
} |
| 2715 |
|
| 2716 |
\NewDocumentCommand\TracerIntegrale{ O{} D<>{} m O{0} m m }{% |
| 2717 |
%1 = clés |
| 2718 |
%2 = options particulières tikz |
| 2719 |
%3 = fonction, en tikz |
| 2720 |
%4 = fonction n°2 éventuelle |
| 2721 |
%de #5 à #6 |
| 2722 |
\restoreKV[GraphiqueTikzIntegr]% revenir au valeurs par défaut |
| 2723 |
\setKV[GraphiqueTikzIntegr]{#1}% lit les arguments optionnels |
| 2724 |
%les couleurs |
| 2725 |
\IfSubStr{\pfldomtikzcolors}{/}% |
| 2726 |
{% |
| 2727 |
\StrCut{\pfldomtikzcolors}{/}{\pfldomtikzcolorbord}{\pfldomtikzcolorfond} |
| 2728 |
}% |
| 2729 |
{% |
| 2730 |
\xdef\pfldomtikzcolorbord{\pfldomtikzcolors}\xdef\pfldomtikzcolorfond{\pfldomtikzcolors} |
| 2731 |
}% |
| 2732 |
\ifboolKV[GraphiqueTikzIntegr]{Bord}% |
| 2733 |
{% |
| 2734 |
\tikzset{integralebordtikzstyle/.style={draw=\pfldomtikzcolorbord}} |
| 2735 |
}% |
| 2736 |
{% |
| 2737 |
\tikzset{integralebordtikzstyle/.style={draw=none}} |
| 2738 |
}% |
| 2739 |
\IfStrEq{\pfldomtikzstyle}{hachures}% |
| 2740 |
{% |
| 2741 |
\tikzset{integraletikzstyle/.style={pfltrait,pattern=\pfldomtikzhatch,pattern color=\pfldomtikzcolorfond,line join=\pfldomtikzjoin}} |
| 2742 |
}% |
| 2743 |
{}% |
| 2744 |
\IfStrEq{\pfldomtikzstyle}{remplissage}% |
| 2745 |
{% |
| 2746 |
\tikzset{integraletikzstyle/.style={pfltrait,fill=\pfldomtikzcolorfond,fill opacity=\pfldomtikzopac,line join=\pfldomtikzjoin}} |
| 2747 |
}% |
| 2748 |
{}% |
| 2749 |
%extraction des infos x/y |
| 2750 |
\IfStrEqCase{\pflintbornes}{% |
| 2751 |
{abs}% |
| 2752 |
{% |
| 2753 |
\xdef\absnoeudA{#5}% |
| 2754 |
\xdef\absnoeudB{#6}% |
| 2755 |
}% |
| 2756 |
{noeuds}% |
| 2757 |
{% |
| 2758 |
\path #5; |
| 2759 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 2760 |
\xdef\absnoeudA{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 2761 |
\path #6; |
| 2762 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 2763 |
\xdef\absnoeudB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 2764 |
}% |
| 2765 |
{abs/noeud}% |
| 2766 |
{% |
| 2767 |
\xdef\absnoeudA{#5}% |
| 2768 |
\path #6; |
| 2769 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 2770 |
\xdef\absnoeudB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 2771 |
}% |
| 2772 |
{noeud/abs}% |
| 2773 |
{% |
| 2774 |
\path #5; |
| 2775 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 2776 |
\xdef\absnoeudA{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 2777 |
\xdef\absnoeudB{#6}% |
| 2778 |
}% |
| 2779 |
}% |
| 2780 |
%suite avec les nbs points |
| 2781 |
\IfStrEq{\pflstepcurve}{}% |
| 2782 |
{% |
| 2783 |
\xdef\pflstepcurve{\xintfloateval{((\absnoeudB)-(\absnoeudA))/100}}% |
| 2784 |
}% |
| 2785 |
{}% |
| 2786 |
%TRACÉSen fonction des types de courbes |
| 2787 |
\IfStrEq{\pfldomtikztype}{fct}% |
| 2788 |
{%OK |
| 2789 |
\begin{scope} |
| 2790 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 2791 |
\draw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflOy}) -- cycle ; |
| 2792 |
\end{scope} |
| 2793 |
}% |
| 2794 |
{}% |
| 2795 |
\IfStrEq{\pfldomtikztype}{spl}%avec 3=courbe spline + clé [Spline] à utiliser ! |
| 2796 |
{%OK |
| 2797 |
\begin{scope} |
| 2798 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2799 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflOy}) -- cycle ; |
| 2800 |
\end{scope} |
| 2801 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2802 |
\path[name intersections={of=#3 and tmpintbornea,name=YYY}] ; |
| 2803 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\pflOy})-- (YYY-1) ; |
| 2804 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2805 |
\path[name intersections={of=#3 and tmpintborneb,name=ZZZ}] ; |
| 2806 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\pflOy})-- (ZZZ-1) ; |
| 2807 |
}% |
| 2808 |
{}% |
| 2809 |
\IfStrEq{\pfldomtikztype}{itp}%avec 3=courbe interpo |
| 2810 |
{%OK |
| 2811 |
\begin{scope} |
| 2812 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2813 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflOy}) -- cycle ; |
| 2814 |
\end{scope} |
| 2815 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2816 |
\path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYY}] ; |
| 2817 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\pflOy})-- (YYY-1) ; |
| 2818 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2819 |
\path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=ZZZ}] ; |
| 2820 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\pflOy})-- (ZZZ-1) ; |
| 2821 |
}% |
| 2822 |
{}% |
| 2823 |
\IfStrEq{\pfldomtikztype}{fct/fct}%avec #3=formule et #4=formule |
| 2824 |
{% |
| 2825 |
\begin{scope} |
| 2826 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 2827 |
\draw[integraletikzstyle,integralebordtikzstyle,#2] plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudB..[-(\pflstepcurve)]..\absnoeudA,\absnoeudA)\relax} -- cycle ; |
| 2828 |
\end{scope} |
| 2829 |
}% |
| 2830 |
{}% |
| 2831 |
\IfStrEq{\pfldomtikztype}{spl/spl}%avec #3=cbe spline + #4=cbe splineB |
| 2832 |
{% |
| 2833 |
\begin{scope} |
| 2834 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2835 |
\clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ; |
| 2836 |
\clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ; |
| 2837 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2838 |
\end{scope} |
| 2839 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2840 |
\path[name intersections={of=#3 and tmpintbornea,name=YYYA}] ; |
| 2841 |
\path[name intersections={of=#4 and tmpintbornea,name=ZZZA}] ; |
| 2842 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2843 |
\path[name intersections={of=#3 and tmpintborneb,name=YYYB}] ; |
| 2844 |
\path[name intersections={of=#4 and tmpintborneb,name=ZZZB}] ; |
| 2845 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYA-1)-- (ZZZA-1) ; |
| 2846 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYB-1)-- (ZZZB-1) ; |
| 2847 |
}% |
| 2848 |
{}% |
| 2849 |
\IfStrEq{\pfldomtikztype}{itp/itp}%avec #3=cbe interpo + #4=cbe interpoB |
| 2850 |
{% |
| 2851 |
\begin{scope} |
| 2852 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2853 |
\clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ; |
| 2854 |
\clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ; |
| 2855 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2856 |
\end{scope} |
| 2857 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2858 |
\path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYYA}] ; |
| 2859 |
\path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=ZZZA}] ; |
| 2860 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2861 |
\path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=YYYB}] ; |
| 2862 |
\path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=ZZZB}] ; |
| 2863 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYA-1)-- (ZZZA-1) ; |
| 2864 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYB-1)-- (ZZZB-1) ; |
| 2865 |
}% |
| 2866 |
{}% |
| 2867 |
\IfStrEq{\pfldomtikztype}{fct/spl}%avec #3=formule + #4=spline |
| 2868 |
{% |
| 2869 |
\begin{scope} |
| 2870 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2871 |
\clip ({\absnoeudA},{\pflymin}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymin}) -- cycle ; |
| 2872 |
\clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ; |
| 2873 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2874 |
\end{scope} |
| 2875 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2876 |
\path[name intersections={of=tmpintbornea and #4,name=ZZZA}] ; |
| 2877 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2878 |
\path[name intersections={of=tmpintborneb and #4,name=ZZZB}] ; |
| 2879 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZA-1) ; |
| 2880 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#3,x=\absnoeudB)}})-- (ZZZB-1) ; |
| 2881 |
}% |
| 2882 |
{}% |
| 2883 |
\IfStrEq{\pfldomtikztype}{spl/fct}%avec #3=spline + #4=fct |
| 2884 |
{% |
| 2885 |
\begin{scope} |
| 2886 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2887 |
\clip ({\absnoeudA},{\pflymax}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymax}) -- cycle ; |
| 2888 |
\clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ; |
| 2889 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2890 |
\end{scope} |
| 2891 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2892 |
\path[name intersections={of=tmpintbornea and #3,name=ZZZA}] ; |
| 2893 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2894 |
\path[name intersections={of=tmpintborneb and #3,name=ZZZB}] ; |
| 2895 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZA-1) ; |
| 2896 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#4,x=\absnoeudB)}})-- (ZZZB-1) ; |
| 2897 |
}% |
| 2898 |
{}% |
| 2899 |
\IfStrEq{\pfldomtikztype}{fct/itp}%avec #3=formule + #4=liste interpo |
| 2900 |
{% |
| 2901 |
\begin{scope} |
| 2902 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2903 |
\clip ({\absnoeudA},{\pflymin}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymin}) -- cycle ; |
| 2904 |
\clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ; |
| 2905 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2906 |
\end{scope} |
| 2907 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2908 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2909 |
\path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=ZZZAA}] ; |
| 2910 |
\path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=ZZZAB}] ; |
| 2911 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZAA-1) ; |
| 2912 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#3,x=\absnoeudB)}})-- (ZZZAB-1) ; |
| 2913 |
}% |
| 2914 |
{}% |
| 2915 |
\IfStrEq{\pfldomtikztype}{itp/fct}% |
| 2916 |
{% |
| 2917 |
\begin{scope} |
| 2918 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2919 |
\clip ({\absnoeudA},{\pflymax}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymax}) -- cycle ; |
| 2920 |
\clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ; |
| 2921 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2922 |
\end{scope} |
| 2923 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ; |
| 2924 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ; |
| 2925 |
\path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=ZZZAA}] ; |
| 2926 |
\path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=ZZZAB}] ; |
| 2927 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZAA-1) ; |
| 2928 |
\draw[\pfldomtikzcolorbord,pfltrait] ({\absnoeudB},{\xintfloateval{subs(#4,x=\absnoeudB)}})-- (ZZZAB-1) ; |
| 2929 |
}% |
| 2930 |
{}% |
| 2931 |
\IfStrEq{\pfldomtikztype}{itp/spl}% |
| 2932 |
{% |
| 2933 |
\begin{scope} |
| 2934 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2935 |
\clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ; |
| 2936 |
\clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ; |
| 2937 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2938 |
\end{scope} |
| 2939 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf |
| 2940 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;%borne sup |
| 2941 |
\path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYYKAA}] ; |
| 2942 |
\path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=YYYKBB}] ; |
| 2943 |
\path[name intersections={of=tmpintbornea and #4,name=ZZZKAA}] ; |
| 2944 |
\path[name intersections={of=tmpintborneb and #4,name=ZZZKBB}] ; |
| 2945 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYKAA-1)-- (ZZZKAA-1) ; |
| 2946 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYKBB-1)-- (ZZZKBB-1) ; |
| 2947 |
}% |
| 2948 |
{}% |
| 2949 |
\IfStrEq{\pfldomtikztype}{spl/itp}% |
| 2950 |
{% |
| 2951 |
\begin{scope} |
| 2952 |
\clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2953 |
\clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphiqueTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ; |
| 2954 |
\clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ; |
| 2955 |
\filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ; |
| 2956 |
\end{scope} |
| 2957 |
\path[draw=none,pflcourbe,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf |
| 2958 |
\path[draw=none,pflcourbe,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;%borne sup |
| 2959 |
\path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=YYYKAA}] ; |
| 2960 |
\path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=YYYKBB}] ; |
| 2961 |
\path[name intersections={of=tmpintbornea and #3,name=ZZZKAA}] ; |
| 2962 |
\path[name intersections={of=tmpintborneb and #3,name=ZZZKBB}] ; |
| 2963 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYKAA-1)-- (ZZZKAA-1) ; |
| 2964 |
\draw[\pfldomtikzcolorbord,pfltrait] (YYYKBB-1)-- (ZZZKBB-1) ; |
| 2965 |
}% |
| 2966 |
{}% |
| 2967 |
} |
| 2968 |
|
| 2969 |
%====POINTS |
| 2970 |
\NewDocumentCommand\PlacerPoints{ s O{black} D<>{\normalfont\normalsize} m }{% |
| 2971 |
\IfBooleanTF{#1}% |
| 2972 |
{% |
| 2973 |
\foreach \Point in {#4}{% |
| 2974 |
\filldraw[#2] \Point circle[pflpointc] ; |
| 2975 |
} |
| 2976 |
}% |
| 2977 |
{% |
| 2978 |
\foreach \Point/\Pos/\Label in {#4}{% |
| 2979 |
\filldraw[#2] \Point circle[pflpointc] node[pflnoeud,\Pos,font=#3] {\Label} ; |
| 2980 |
} |
| 2981 |
}% |
| 2982 |
} |
| 2983 |
|
| 2984 |
%====STATS À 2 VARIABLES |
| 2985 |
\defKV[GraphiqueTikzRegLin]{% |
| 2986 |
Arrondis=\def\pflarrondisreglin{#1}, |
| 2987 |
Nom=\def\pflnamereglin{#1}, |
| 2988 |
NomPara=\def\pflnameregquad{#1}, |
| 2989 |
Debut=\def\pflreglinmin{#1}, |
| 2990 |
Fin=\def\pflreglinmax{#1},% |
| 2991 |
TaillePts=\def\pflreglintaillepts{#1},% |
| 2992 |
ModeTransfo=\def\pflreglinmode{#1} |
| 2993 |
} |
| 2994 |
\setKVdefault[GraphiqueTikzRegLin]{ |
| 2995 |
CouleurNuage=black, |
| 2996 |
CouleurDroite=black, |
| 2997 |
CouleurPara=black, |
| 2998 |
Arrondis={}, |
| 2999 |
Debut={\pflxmin}, |
| 3000 |
Fin={\pflxmax}, |
| 3001 |
Nom=reglin,% |
| 3002 |
NomPara=quadreg,% |
| 3003 |
TracerDroite=false,% |
| 3004 |
TracerParabole=false,% |
| 3005 |
Style=o,% |
| 3006 |
TaillePts=1.75pt,% |
| 3007 |
ModeTransfo={lin} |
| 3008 |
} |
| 3009 |
|
| 3010 |
\NewDocumentCommand\TracerNuageSuite{ s O{} m }{% |
| 3011 |
\useKVdefault[GraphiqueTikzRegLin]% |
| 3012 |
\setKV[GraphiqueTikzRegLin]{#2}% on paramètres les nouvelles clés et on les simplifie |
| 3013 |
\xintdeffloatfunc tmpu(n) := #3 ; |
| 3014 |
\IfStrEq{\pflnamereglin}{reglin}{\def\pflnamereglin{u}}{}% |
| 3015 |
\IfBooleanTF{#1}% |
| 3016 |
{% |
| 3017 |
\foreach \n in {\pflreglinmin,...,\pflreglinmax}{% |
| 3018 |
\MarquerPts*% |
| 3019 |
[Style={\useKV[GraphiqueTikzRegLin]{Style}},Couleur={\useKV[GraphiqueTikzRegLin]{CouleurNuage}},Taillec=\pflreglintaillepts,Taillex=\pflreglintaillepts,Tailleo=\pflreglintaillepts]% |
| 3020 |
{(\n,\xintfloateval{tmpu(\n)})}% |
| 3021 |
} |
| 3022 |
}% |
| 3023 |
{% |
| 3024 |
\foreach \n in {\pflreglinmin,...,\pflreglinmax}{% |
| 3025 |
\MarquerPts% |
| 3026 |
[Style={\useKV[GraphiqueTikzRegLin]{Style}},Couleur={\useKV[GraphiqueTikzRegLin]{CouleurNuage}},Taillec=\pflreglintaillepts,Taillex=\pflreglintaillepts,Tailleo=\pflreglintaillepts]% |
| 3027 |
{(\n,\xintfloateval{tmpu(\n)})/{$\pflnamereglin_{\n}$}/below}% |
| 3028 |
} |
| 3029 |
}% |
| 3030 |
} |
| 3031 |
|
| 3032 |
\NewDocumentCommand\TracerNuage{ O{} D<>{d} m m }{% |
| 3033 |
\useKVdefault[GraphiqueTikzRegLin]% |
| 3034 |
\setKV[GraphiqueTikzRegLin]{#1}% on paramètres les nouvelles clés et on les simplifie |
| 3035 |
%listes des données |
| 3036 |
\def\xliste{#3} |
| 3037 |
\def\yliste{#4} |
| 3038 |
\setsepchar{,}% |
| 3039 |
\readlist*\LX{\xliste} |
| 3040 |
\readlist*\LY{\yliste} |
| 3041 |
%taille des listes |
| 3042 |
\def\LNB{\inteval{\LXlen}} |
| 3043 |
%nuage |
| 3044 |
\foreach \i in {1,...,\LXlen}{% |
| 3045 |
\itemtomacro\LX[\i]\tmpmavalx% |
| 3046 |
\itemtomacro\LY[\i]\tmpmavaly% |
| 3047 |
\MarquerPts*[Style={\useKV[GraphiqueTikzRegLin]{Style}},Couleur={\useKV[GraphiqueTikzRegLin]{CouleurNuage}}]{(\tmpmavalx,\tmpmavaly)}% |
| 3048 |
} |
| 3049 |
%droite de régression |
| 3050 |
\ifboolKV[GraphiqueTikzRegLin]{TracerDroite}% |
| 3051 |
{% |
| 3052 |
%somme des LX et des LY OK |
| 3053 |
\xdef\LXSomme{0} |
| 3054 |
\xdef\LYSomme{0} |
| 3055 |
\foreach \i in {1,2,...,\LNB}{ |
| 3056 |
\xdef\LXSomme{\xintfloateval{\LXSomme+\LX[\i]}} |
| 3057 |
} |
| 3058 |
\foreach \i in {1,2,...,\LNB}{ |
| 3059 |
\xdef\LYSomme{\xintfloateval{\LYSomme+\LY[\i]}} |
| 3060 |
} |
| 3061 |
%moyenne des LX et des LY OK |
| 3062 |
\xdef\LXmoy{\xintfloateval{\LXSomme/\LNB}} |
| 3063 |
\xdef\LYmoy{\xintfloateval{\LYSomme/\LNB}} |
| 3064 |
%variance des LX et des LY OK |
| 3065 |
\xdef\LXvar{0} |
| 3066 |
\foreach \i in {1,2,...,\LNB}{ |
| 3067 |
\xdef\LXvar{\xintfloateval{\LXvar+(\LX[\i]-\LXmoy)*(\LX[\i]-\LXmoy)}} |
| 3068 |
} |
| 3069 |
\xdef\LXvar{\xintfloateval{\LXvar/\LNB}} |
| 3070 |
\xdef\LYvar{0} |
| 3071 |
\foreach \i in {1,2,...,\LNB}{ |
| 3072 |
\xdef\LYvar{\xintfloateval{\LYvar+(\LY[\i]-\LYmoy)*(\LY[\i]-\LYmoy)}} |
| 3073 |
} |
| 3074 |
\xdef\LYvar{\xintfloateval{\LYvar/\LNB}} |
| 3075 |
%covariance des XY OK |
| 3076 |
\xdef\LXYvar{0} |
| 3077 |
\foreach \i in {1,2,...,\LNB}{ |
| 3078 |
\xdef\LXYvar{\xintfloateval{\LXYvar+(\LX[\i]-\LXmoy)*(\LY[\i]-\LYmoy)}} |
| 3079 |
} |
| 3080 |
\xdef\LXYvar{\xintfloateval{\LXYvar/\LNB}} |
| 3081 |
%COEFFS OK |
| 3082 |
\IfStrEq{\pflarrondisreglin}{}% |
| 3083 |
{% |
| 3084 |
\xdef\tmpcoeffreglina{\xintfloateval{\LXYvar/\LXvar}} |
| 3085 |
\xdef\tmpcoeffreglinb{\xintfloateval{\LYmoy-\tmpcoeffreglina*\LXmoy}} |
| 3086 |
}% |
| 3087 |
{% |
| 3088 |
\IfSubStr{\pflarrondisreglin}{/}% |
| 3089 |
{% |
| 3090 |
\StrCut{\pflarrondisreglin}{/}{\pflarrondisreglina}{\pflarrondisreglinb} |
| 3091 |
}% |
| 3092 |
{% |
| 3093 |
\xdef\pflarrondisreglina{\pflarrondisreglin}\xdef\pflarrondisreglinb{\pflarrondisreglin} |
| 3094 |
}% |
| 3095 |
\xdef\tmpcoeffreglina{\xintfloateval{round(\LXYvar/\LXvar,\pflarrondisreglina)}} |
| 3096 |
\xdef\tmpcoeffreglinb{\xintfloateval{round(\LYmoy-\tmpcoeffreglina*\LXmoy,\pflarrondisreglinb)}} |
| 3097 |
}% |
| 3098 |
\xintdeffloatfunc #2(x) := (\tmpcoeffreglina)*x+(\tmpcoeffreglinb) ; |
| 3099 |
%tracé |
| 3100 |
\begin{scope} |
| 3101 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 3102 |
\draw[pflcourbe,{\useKV[GraphiqueTikzRegLin]{CouleurDroite}},name path global=\pflnamereglin,samples=2,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffreglina*\x+\tmpcoeffreglinb}) ; |
| 3103 |
\end{scope} |
| 3104 |
}% |
| 3105 |
{}% |
| 3106 |
\ifboolKV[GraphiqueTikzRegLin]{TracerParabole}% |
| 3107 |
{% |
| 3108 |
%somme importantes |
| 3109 |
\xdef\LXSomme{0}% |
| 3110 |
\xdef\LXCSomme{0}% |
| 3111 |
\xdef\LYSomme{0}% |
| 3112 |
\xdef\LXXSomme{0}% |
| 3113 |
\xdef\LXYSomme{0}% |
| 3114 |
\xdef\LXXCSomme{0}% |
| 3115 |
\xdef\LXCXCSomme{0}% |
| 3116 |
\xdef\LXCYSomme{0}% |
| 3117 |
%calculs |
| 3118 |
\foreach \i in {1,2,...,\LNB}{% |
| 3119 |
\xdef\LXSomme{\xintfloateval{\LXSomme+\LX[\i]}}% |
| 3120 |
\xdef\LXCSomme{\xintfloateval{\LXCSomme+(\LX[\i])^2}}% |
| 3121 |
}% |
| 3122 |
\foreach \i in {1,2,...,\LNB}{% |
| 3123 |
\xdef\LYSomme{\xintfloateval{\LYSomme+\LY[\i]}}% |
| 3124 |
}% |
| 3125 |
\xdef\LXmoy{\xintfloateval{\LXSomme/\LNB}}% |
| 3126 |
\xdef\LYmoy{\xintfloateval{\LYSomme/\LNB}}% |
| 3127 |
\xdef\LXCmoy{\xintfloateval{\LXCSomme/\LNB}}% |
| 3128 |
%calculs suites |
| 3129 |
\foreach \i in {1,2,...,\LNB}{% |
| 3130 |
\xdef\LXXSomme{\xintfloateval{\LXXSomme+(\LX[\i]-\LXmoy)^2}}% |
| 3131 |
\xdef\LXYSomme{\xintfloateval{\LXYSomme+(\LX[\i]-\LXmoy)*(\LY[\i]-\LYmoy)}}% |
| 3132 |
\xdef\LXXCSomme{\xintfloateval{\LXXCSomme+(\LX[\i]-\LXmoy)*((\LX[\i])*(\LX[\i])-\LXCmoy)}}% |
| 3133 |
\xdef\LXCXCSomme{\xintfloateval{\LXCXCSomme+((\LX[\i])^2-\LXCmoy)^2}}% |
| 3134 |
\xdef\LXCYSomme{\xintfloateval{\LXCYSomme+((\LX[\i])^2-\LXCmoy)*(\LY[\i]-\LYmoy)}}% |
| 3135 |
}% |
| 3136 |
%COEFFS OK |
| 3137 |
\IfStrEq{\pflarrondisreglin}{}% |
| 3138 |
{% |
| 3139 |
\xdef\tmpcoeffregquadb{\xintfloateval{(\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}} |
| 3140 |
\xdef\tmpcoeffregquada{\xintfloateval{(\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}} |
| 3141 |
\xdef\tmpcoeffregquadc{\xintfloateval{\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy}} |
| 3142 |
}% |
| 3143 |
{% |
| 3144 |
\xdef\tmpcoeffregquadb{\xintfloateval{round((\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}} |
| 3145 |
\xdef\tmpcoeffregquada{\xintfloateval{round((\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}} |
| 3146 |
\xdef\tmpcoeffregquadc{\xintfloateval{round(\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy,\pflarrondisreglin)}} |
| 3147 |
}% |
| 3148 |
\xintdeffloatfunc #2(x) := (\tmpcoeffregquada)*x^2+(\tmpcoeffregquadb)*x+\tmpcoeffregquadc ; |
| 3149 |
%tracé |
| 3150 |
\begin{scope} |
| 3151 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 3152 |
\draw[pflcourbe,{\useKV[GraphiqueTikzRegLin]{CouleurPara}},name path global=\pflnameregquad,samples=250,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffregquada*(\x)^2+\tmpcoeffregquadb*\x+\tmpcoeffregquadc}) ; |
| 3153 |
\end{scope} |
| 3154 |
}% |
| 3155 |
{}% |
| 3156 |
} |
| 3157 |
|
| 3158 |
\if@loadxintreg |
| 3159 |
%régressions alternatives |
| 3160 |
\NewDocumentCommand\TracerAjustement{ O{} D<>{cbajust} m D<>{} m m }{% |
| 3161 |
%1=options de tracés |
| 3162 |
%2=nom courbe |
| 3163 |
%3=type |
| 3164 |
%4=arrondis |
| 3165 |
%5=liste X |
| 3166 |
%6=liste Y |
| 3167 |
\IfStrEq{#3}{lin}% |
| 3168 |
{% |
| 3169 |
\xintlinreg[round={#4}]{#5}{#6}% |
| 3170 |
\DefinirFonction[#1,Trace]<#2>{\linrega*x+\linregb}% |
| 3171 |
}% |
| 3172 |
{}% |
| 3173 |
\IfStrEq{#3}{quad}% |
| 3174 |
{% |
| 3175 |
\xintquadreg[round={#4}]{#5}{#6}% |
| 3176 |
\DefinirFonction[#1,Trace]<#2>{\quadrega*x^2+\quadregb*x+\quadregc}% |
| 3177 |
}% |
| 3178 |
{}% |
| 3179 |
\IfStrEq{#3}{pow}% |
| 3180 |
{% |
| 3181 |
\xintpowreg[round={#4}]{#5}{#6}% |
| 3182 |
\DefinirFonction[#1,Trace]<#2>{\powrega*x^(\powregb)}% |
| 3183 |
}% |
| 3184 |
{}% |
| 3185 |
\IfStrEq{#3}{expab}% |
| 3186 |
{% |
| 3187 |
\xintexpabreg[round={#4}]{#5}{#6}% |
| 3188 |
\DefinirFonction[#1,Trace]<#2>{\expabrega*(\expabregb)^x}% |
| 3189 |
}% |
| 3190 |
{}% |
| 3191 |
\IfStrEq{#3}{hyp}% |
| 3192 |
{% |
| 3193 |
\xinthypreg[round={#4}]{#5}{#6}% |
| 3194 |
\DefinirFonction[#1,Trace]<#2>{\hyprega+(\hypregb)/x}% |
| 3195 |
}% |
| 3196 |
{}% |
| 3197 |
\IfStrEq{#3}{log}% |
| 3198 |
{% |
| 3199 |
\xintlogreg[round={#4}]{#5}{#6}% |
| 3200 |
\DefinirFonction[#1,Trace]<#2>{\logrega+(\logregb)*log(x)}% |
| 3201 |
}% |
| 3202 |
{}% |
| 3203 |
\IfStrEq{#3}{exp}% |
| 3204 |
{% |
| 3205 |
\xintexpreg[round={#4}]{#5}{#6}% |
| 3206 |
\DefinirFonction[#1,Trace]<#2>{exp(\exprega*x+\expregb)}% |
| 3207 |
}% |
| 3208 |
{}% |
| 3209 |
\IfStrEq{#3}{expalt}% |
| 3210 |
{% |
| 3211 |
\xintexpreg[Alt,round={#4}]{#5}{#6}% |
| 3212 |
\DefinirFonction[#1,Trace]<#2>{\expregb*exp(\exprega*x)}% |
| 3213 |
}% |
| 3214 |
{}% |
| 3215 |
\IfStrEq{#3}{cub}% |
| 3216 |
{% |
| 3217 |
\xintcubreg[round={#4}]{#5}{#6}% |
| 3218 |
\DefinirFonction[#1,Trace]<#2>{\cubrega*x^3+\cubregb*x^2+\cubregc*x+\cubregd}% |
| 3219 |
}% |
| 3220 |
{}% |
| 3221 |
\IfSubStr{#3}{expoff}% |
| 3222 |
{% |
| 3223 |
\StrBehind{#3}{=}[\expoffset]% |
| 3224 |
\xintexpoffreg[round={#4},offset=\expoffset]{#5}{#6}% |
| 3225 |
\DefinirFonction[#1,Trace]<#2>{\expoffset+\expregoffb*exp(\expregoffa*x)}% |
| 3226 |
}% |
| 3227 |
{}% |
| 3228 |
} |
| 3229 |
\fi |
| 3230 |
|
| 3231 |
%===IMAGES & ANTÉCÉDENTS |
| 3232 |
\defKV[GraphiqueTikzImg]{ |
| 3233 |
Couleurs=\def\pflimgcolors{#1},% |
| 3234 |
Nom=\def\pflantecednoms{#1}% |
| 3235 |
} |
| 3236 |
|
| 3237 |
\setKVdefault[GraphiqueTikzImg]{ |
| 3238 |
Couleurs=black,% |
| 3239 |
Traits=false,% |
| 3240 |
Spline=false,% |
| 3241 |
Nom={},% |
| 3242 |
Style=o |
| 3243 |
} |
| 3244 |
|
| 3245 |
\NewDocumentCommand\DefinirImage{ O{} m m }{% |
| 3246 |
\useKVdefault[GraphiqueTikzImg]% |
| 3247 |
\setKV[GraphiqueTikzImg]{#1}% |
| 3248 |
\ifboolKV[GraphiqueTikzImg]{Spline}% |
| 3249 |
{% |
| 3250 |
\path[draw=none,pflcourbe,name path=tmpimage] ({#3},{\pflymin})--({#3},{\pflymax}) ; |
| 3251 |
\path[name intersections={of=#2 and tmpimage,name=ZZZZ}] ; |
| 3252 |
\coordinate (\pflantecednoms) at (ZZZZ-1) ; |
| 3253 |
}% |
| 3254 |
{% |
| 3255 |
\xdef\tmpresimg{\xintfloateval{#2(#3)}}% |
| 3256 |
\coordinate (\pflantecednoms) at ({#3},{\tmpresimg}) ; |
| 3257 |
}% |
| 3258 |
} |
| 3259 |
|
| 3260 |
\NewDocumentCommand\PlacerImages{ O{} m m }{% |
| 3261 |
\useKVdefault[GraphiqueTikzImg]% |
| 3262 |
\setKV[GraphiqueTikzImg]{#1}% |
| 3263 |
\IfSubStr{\pflimgcolors}{/}% |
| 3264 |
{% |
| 3265 |
\StrCut{\pflimgcolors}{/}{\pflimgcolorpt}{\pflimgcolorline} |
| 3266 |
}% |
| 3267 |
{% |
| 3268 |
\xdef\pflimgcolorpt{\pflimgcolors}\xdef\pflimgcolorline{\pflimgcolors} |
| 3269 |
}% |
| 3270 |
\ifboolKV[GraphiqueTikzImg]{Spline}% |
| 3271 |
{% |
| 3272 |
\foreach \i in {#3}{% |
| 3273 |
\path[draw=none,pflcourbe,name path=tmpimage] ({\i},{\pflymin})--({\i},{\pflymax}) ; |
| 3274 |
\path[name intersections={of=#2 and tmpimage,name=ZZ}] ; |
| 3275 |
\ifboolKV[GraphiqueTikzImg]{Traits}% |
| 3276 |
{% |
| 3277 |
\draw[\pflimgcolorline,pfltraitimg] let \p1 = (ZZ-1) in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ; |
| 3278 |
}% |
| 3279 |
{}% |
| 3280 |
\MarquerPts*[Style={\useKV[GraphiqueTikzImg]{Style}},Couleur=\pflimgcolorpt]{(ZZ-1)} |
| 3281 |
%\filldraw[\pflimgcolorpt] (ZZ-1) circle[radius=2pt] ; |
| 3282 |
} |
| 3283 |
}% |
| 3284 |
{% |
| 3285 |
\foreach \i in {#3}{% |
| 3286 |
\xdef\tmpresimg{\xintfloateval{#2(\i)}}% |
| 3287 |
\ifboolKV[GraphiqueTikzImg]{Traits}% |
| 3288 |
{% |
| 3289 |
\draw[\pflimgcolorline,pfltraitimg] ({\i},{\pflOy}) |- ({\pflOx},{\tmpresimg}) ; |
| 3290 |
}% |
| 3291 |
{}% |
| 3292 |
\MarquerPts*[Style={\useKV[GraphiqueTikzImg]{Style}},Couleur=\pflimgcolorpt]{({\i},{\tmpresimg})} |
| 3293 |
%\filldraw[\pflimgcolorpt] ({\i},{\tmpresimg}) circle[radius=2pt] ; |
| 3294 |
}% |
| 3295 |
}% |
| 3296 |
} |
| 3297 |
|
| 3298 |
\NewDocumentCommand\PlacerAntecedents{ O{} m m }{%avec le nom de la courbe... |
| 3299 |
\useKVdefault[GraphiqueTikzImg]% |
| 3300 |
\setKV[GraphiqueTikzImg]{#1}% |
| 3301 |
\xdef\pflstepcurve{\xintfloateval{0.1*\pflgrillexs}} |
| 3302 |
\IfSubStr{\pflimgcolors}{/}% |
| 3303 |
{% |
| 3304 |
\StrCut{\pflimgcolors}{/}{\pflimgcolorpt}{\pflimgcolorline}% |
| 3305 |
}% |
| 3306 |
{% |
| 3307 |
\xdef\pflimgcolorpt{\pflimgcolors}\xdef\pflimgcolorline{\pflimgcolors}% |
| 3308 |
}% |
| 3309 |
\begin{scope} |
| 3310 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 3311 |
\path[draw=none,pflcourbe,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ; |
| 3312 |
\path[name intersections={of=#2 and tmpanteced,name=ZZ,total=\t}] \pgfextra{\xdef\tmptotanteced{\t}}; |
| 3313 |
\xintifboolexpr{\tmptotanteced == 0}{}% |
| 3314 |
{% |
| 3315 |
\ifboolKV[GraphiqueTikzImg]{Traits}% |
| 3316 |
{% |
| 3317 |
\draw[\pflimgcolorline,pfltraitantec] ({\pflxmin},{#3})--({\pflxmax},{#3}) ; |
| 3318 |
}% |
| 3319 |
{}% |
| 3320 |
\foreach \i in {1,...,\tmptotanteced}{% |
| 3321 |
\IfStrEq{\pflantecednoms}{}% |
| 3322 |
{}% |
| 3323 |
{% |
| 3324 |
\coordinate (\pflantecednoms-\i) at (ZZ-\i) ; |
| 3325 |
}% |
| 3326 |
\ifboolKV[GraphiqueTikzImg]{Traits}% |
| 3327 |
{% |
| 3328 |
\draw[\pflimgcolorline,pfltraitimg] let \p1 = (ZZ-\i) in (ZZ-\i) -- ({\x1},{\pflOy}) ; |
| 3329 |
}% |
| 3330 |
{}% |
| 3331 |
\MarquerPts*[Style={\useKV[GraphiqueTikzImg]{Style}},Couleur=\pflimgcolorpt]{(ZZ-\i)} |
| 3332 |
%\filldraw[\pflimgcolorpt] (ZZ-\i) circle[radius=2pt] ; |
| 3333 |
}% |
| 3334 |
}% |
| 3335 |
\end{scope} |
| 3336 |
} |
| 3337 |
|
| 3338 |
%===NOMBRE DÉRIVÉ ET TANGENTE (EXPÉRIEMENTAL) |
| 3339 |
\NewDocumentCommand\CalculerNbDerive{ s m m m }{%*=gauche+nomfct+abspt+h |
| 3340 |
\IfBooleanTF{#1}% |
| 3341 |
{% |
| 3342 |
\xdef\TmpResNbDeriv{\xintfloateval{(#2(#3)-#2(#3-#4))/(#4)}}% |
| 3343 |
}% |
| 3344 |
{% |
| 3345 |
\xdef\TmpResNbDeriv{\xintfloateval{(#2(#3+#4)-#2(#3))/(#4)}}% |
| 3346 |
}% |
| 3347 |
} |
| 3348 |
|
| 3349 |
\defKV[GraphiqueTikzTgte]{% |
| 3350 |
Couleurs=\def\pfltgttikzcolors{#1},% |
| 3351 |
DecG=\def\pfltgttikzkl{#1},% |
| 3352 |
DecD=\def\pfltgttikzkr{#1},% |
| 3353 |
h=\def\pfltgttikzh{#1},% |
| 3354 |
Sens=\def\pfltgttikzsens{#1},% |
| 3355 |
Delta=\def\tmptgtedelta{#1} |
| 3356 |
} |
| 3357 |
\setKVdefault[GraphiqueTikzTgte]{% |
| 3358 |
Couleurs=black,% |
| 3359 |
DecG=1,% |
| 3360 |
DecD=1,% |
| 3361 |
AffPoint=false,% |
| 3362 |
Spline=false,% |
| 3363 |
h=0.1,% |
| 3364 |
Sens=gd,% |
| 3365 |
Noeud=false,% |
| 3366 |
Delta=0.01,% |
| 3367 |
Style=o |
| 3368 |
} |
| 3369 |
|
| 3370 |
\NewDocumentCommand\TracerTangente{ O{} m m D<>{} }{% |
| 3371 |
\restoreKV[GraphiqueTikzTgte]% |
| 3372 |
\setKV[GraphiqueTikzTgte]{#1}% |
| 3373 |
%en fonction de la gestion de l'abscisse |
| 3374 |
\ifboolKV[GraphiqueTikzTgte]{Noeud}% |
| 3375 |
{% |
| 3376 |
\path #3; |
| 3377 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3378 |
\xdef\pfltgttikzx{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3379 |
}% |
| 3380 |
{% |
| 3381 |
\xdef\pfltgttikzx{#3}% |
| 3382 |
}% |
| 3383 |
%parties communes |
| 3384 |
\IfSubStr{\pfltgttikzcolors}{/}% |
| 3385 |
{% |
| 3386 |
\StrCut{\pfltgttikzcolors}{/}{\pfltgttikzline}{\pfltgttikzpoint} |
| 3387 |
}% |
| 3388 |
{% |
| 3389 |
\xdef\pfltgttikzline{\pfltgttikzcolors}\xdef\pfltgttikzpoint{\pfltgttikzcolors} |
| 3390 |
}% |
| 3391 |
\xdef\tmptgtdeb{\xintfloateval{\pfltgttikzx-(\pfltgttikzkl)}}% |
| 3392 |
\xdef\tmptgtfin{\xintfloateval{\pfltgttikzx+(\pfltgttikzkr)}}% |
| 3393 |
%suivant le type de courbe |
| 3394 |
\ifboolKV[GraphiqueTikzTgte]{Spline}% |
| 3395 |
{% |
| 3396 |
\path[name path=tmpimage] ({\pfltgttikzx},{\pflymin})--({\pfltgttikzx},{\pflymax}) ; |
| 3397 |
\path[name intersections={of=#2 and tmpimage,name=TANp}] ; |
| 3398 |
\IfStrEq{\pfltgttikzsens}{gd}% |
| 3399 |
{% |
| 3400 |
\path[name path=L-vline] ({\pfltgttikzx-\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx-\tmptgtedelta},{\pflymax}) ; |
| 3401 |
\path[name path=R-vline] ({\pfltgttikzx+\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx+\tmptgtedelta},{\pflymax}) ; |
| 3402 |
%\coordinate (LXcoor) at ($(TANp-1)+({-\tmptgtedelta},0)$) ; |
| 3403 |
%\coordinate (RXcoor) at ($(TANp-1)+({\tmptgtedelta},0)$) ; |
| 3404 |
}% |
| 3405 |
{}% |
| 3406 |
\IfStrEq{\pfltgttikzsens}{g}% |
| 3407 |
{% |
| 3408 |
\path[name path=L-vline] ({\pfltgttikzx-\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx-\tmptgtedelta},{\pflymax}) ; |
| 3409 |
\path[name path=R-vline] ({\pfltgttikzx},{\pflymin}) -- ({\pfltgttikzx},{\pflymax}) ; |
| 3410 |
%\coordinate (LXcoor) at ($(TANp-1)+({-\tmptgtedelta},0)$) ; |
| 3411 |
%\coordinate (RXcoor) at (TANp-1) ; |
| 3412 |
\def\tmptgtfin{\pfltgttikzx}% |
| 3413 |
}% |
| 3414 |
{}% |
| 3415 |
\IfStrEq{\pfltgttikzsens}{d}% |
| 3416 |
{% |
| 3417 |
\path[name path=L-vline] ({\pfltgttikzx},{\pflymin}) -- ({\pfltgttikzx},{\pflymax}) ; |
| 3418 |
\path[name path=R-vline] ({\pfltgttikzx+\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx+\tmptgtedelta},{\pflymax}) ; |
| 3419 |
\def\tmptgtdeb{\pfltgttikzx}% |
| 3420 |
}% |
| 3421 |
{}% |
| 3422 |
\path[name intersections={of=#2 and L-vline,name=LXcut}] ; |
| 3423 |
\path[name intersections={of=#2 and R-vline,name=RXcut}] ; |
| 3424 |
\coordinate (tzXproj) at ($(LXcut-1)!(TANp-1)!(RXcut-1)$) ; % projection |
| 3425 |
\coordinate (LLpoint) at ($(LXcut-1)+(TANp-1)-(tzXproj)$) ; % move |
| 3426 |
\coordinate (RRpoint) at ($(RXcut-1)+(TANp-1)-(tzXproj)$) ; % move |
| 3427 |
\path (LLpoint); |
| 3428 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3429 |
\xdef\tzTANLLX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3430 |
\xdef\tzTANLLY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3431 |
\path (RRpoint); |
| 3432 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3433 |
\xdef\tzTANRRX{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3434 |
\xdef\tzTANRRY{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3435 |
\def\tztangentLFn{(\tzTANRRY-\tzTANLLY)/(\tzTANRRX-\tzTANLLX)*(\x-\tzTANLLX)+\tzTANLLY}% |
| 3436 |
\begin{scope} |
| 3437 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 3438 |
\draw[pfltrait,\pfltgttikzline,domain=\tmptgtdeb:\tmptgtfin,samples=2,#4] plot (\x,{\tztangentLFn}) ; |
| 3439 |
\end{scope} |
| 3440 |
}% |
| 3441 |
{% |
| 3442 |
\IfStrEq{\pfltgttikzsens}{g}% |
| 3443 |
{% |
| 3444 |
\CalculerNbDerive*{#2}{\pfltgttikzx}{\pfltgttikzh}% |
| 3445 |
}% |
| 3446 |
{% |
| 3447 |
\CalculerNbDerive{#2}{\pfltgttikzx}{\pfltgttikzh}% |
| 3448 |
}% |
| 3449 |
\begin{scope} |
| 3450 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 3451 |
\draw[pfltrait,\pfltgttikzline,#4] plot[smooth] coordinates {% |
| 3452 |
\xintthecoords\xintfloatexpr |
| 3453 |
seq((x,\TmpResNbDeriv*(x-(\pfltgttikzx))+#2(\pfltgttikzx)),x=\tmptgtdeb,\tmptgtfin) |
| 3454 |
\relax |
| 3455 |
}; |
| 3456 |
\end{scope} |
| 3457 |
}% |
| 3458 |
\ifboolKV[GraphiqueTikzTgte]{AffPoint}% |
| 3459 |
{% |
| 3460 |
\ifboolKV[GraphiqueTikzTgte]{Spline}% |
| 3461 |
{% |
| 3462 |
\MarquerPts*[Style={\useKV[GraphiqueTikzTgte]{Style}},Couleur=\pfltgttikzpoint]{(TANp-1)} |
| 3463 |
%\filldraw[] (TANp-1) circle[pflpointc] ; |
| 3464 |
}% |
| 3465 |
{% |
| 3466 |
\xdef\tmpimgtgt{\xintfloateval{#2(\pfltgttikzx)}}% |
| 3467 |
\MarquerPts*[Style={\useKV[GraphiqueTikzTgte]{Style}},Couleur=\pfltgttikzpoint]{({\pfltgttikzx},\tmpimgtgt)} |
| 3468 |
%\filldraw[\pfltgttikzpoint] ({\pfltgttikzx},\tmpimgtgt) circle[pflpointc] ; |
| 3469 |
}% |
| 3470 |
}% |
| 3471 |
{}% |
| 3472 |
} |
| 3473 |
|
| 3474 |
%====LOI NORMALE |
| 3475 |
\defKV[GraphiqueTikzGaussienne]{% |
| 3476 |
Pas=\def\pflgaussstep{#1},% |
| 3477 |
Nom=\def\pflgaussname{#1} |
| 3478 |
} |
| 3479 |
|
| 3480 |
\setKVdefault[GraphiqueTikzGaussienne]{% |
| 3481 |
Nom=gaussienne,% |
| 3482 |
Couleur=black,% |
| 3483 |
Trace=false,% |
| 3484 |
Pas={},% |
| 3485 |
Debut={\pflxmin},% |
| 3486 |
Fin={\pflxmax} |
| 3487 |
} |
| 3488 |
|
| 3489 |
\NewDocumentCommand\DefinirLoiNormale{ O{} D<>{phi} m m }{% |
| 3490 |
%1=options |
| 3491 |
%2=mu |
| 3492 |
%3=sigma |
| 3493 |
\restoreKV[GraphiqueTikzGaussienne]% |
| 3494 |
\setKV[GraphiqueTikzGaussienne]{#1}% |
| 3495 |
\xintdeffloatfunc #2(x) := 1/((#4)*sqrt(2*pi))*exp(-0.5*((x-(#3))/(#4))^2) ;% |
| 3496 |
\IfStrEq{\pflgaussstep}{}% |
| 3497 |
{% |
| 3498 |
\xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}% |
| 3499 |
}% |
| 3500 |
{}% |
| 3501 |
\begin{scope} |
| 3502 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 3503 |
\ifboolKV[GraphiqueTikzGaussienne]{Trace}% |
| 3504 |
{% |
| 3505 |
\path[draw,pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}},name path global=\pflgaussname] plot[smooth] coordinates {% |
| 3506 |
\xintthecoords\xintfloatexpr |
| 3507 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}}) |
| 3508 |
\relax |
| 3509 |
} ; |
| 3510 |
}% |
| 3511 |
{% |
| 3512 |
\path[draw=none,pflcourbe,name path global=\pflgaussname] plot[smooth] coordinates {% |
| 3513 |
\xintthecoords\xintfloatexpr |
| 3514 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}}) |
| 3515 |
\relax |
| 3516 |
} ; |
| 3517 |
}% |
| 3518 |
\end{scope} |
| 3519 |
} |
| 3520 |
|
| 3521 |
\NewDocumentCommand\TracerLoiNormale{ O{} m }{% |
| 3522 |
%1=options |
| 3523 |
%2=mu |
| 3524 |
%3=sigma |
| 3525 |
\restoreKV[GraphiqueTikzGaussienne]% |
| 3526 |
\setKV[GraphiqueTikzGaussienne]{#1}% |
| 3527 |
\IfStrEq{\pflgaussstep}{}% |
| 3528 |
{% |
| 3529 |
\xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}% |
| 3530 |
}% |
| 3531 |
{}% |
| 3532 |
\begin{scope} |
| 3533 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 3534 |
\draw[pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}}] plot[smooth] coordinates {% |
| 3535 |
\xintthecoords\xintfloatexpr |
| 3536 |
seq((x,#2),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}}) |
| 3537 |
\relax |
| 3538 |
} ; |
| 3539 |
\end{scope} |
| 3540 |
} |
| 3541 |
|
| 3542 |
\NewDocumentCommand\DefinirLoiKhiDeux{ O{} D<>{khi} m }{% |
| 3543 |
%1=options |
| 3544 |
%2=mu |
| 3545 |
%3=sigma |
| 3546 |
\restoreKV[GraphiqueTikzGaussienne]% |
| 3547 |
\setKV[GraphiqueTikzGaussienne]{#1}% |
| 3548 |
\xintdeffloatfunc #2(x) := (x<0)?{0}{(1/(2^((#3)/2)*pflgamma((#3)/2)))*x^((#3)/2-1)*exp(-x/2)}; |
| 3549 |
\IfStrEq{\pflgaussstep}{}% |
| 3550 |
{% |
| 3551 |
\xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}% |
| 3552 |
}% |
| 3553 |
{}% |
| 3554 |
\begin{scope} |
| 3555 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 3556 |
\ifboolKV[GraphiqueTikzGaussienne]{Trace}% |
| 3557 |
{% |
| 3558 |
\path[draw,pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}},name path global=\pflgaussname] plot[smooth] coordinates {% |
| 3559 |
\xintthecoords\xintfloatexpr |
| 3560 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}}) |
| 3561 |
\relax |
| 3562 |
} ; |
| 3563 |
}% |
| 3564 |
{% |
| 3565 |
\path[draw=none,pflcourbe,name path global=\pflgaussname] plot[smooth] coordinates {% |
| 3566 |
\xintthecoords\xintfloatexpr |
| 3567 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}}) |
| 3568 |
\relax |
| 3569 |
} ; |
| 3570 |
}% |
| 3571 |
\end{scope} |
| 3572 |
} |
| 3573 |
|
| 3574 |
\NewDocumentCommand\TracerLoiKhiDeux{ O{} m }{% |
| 3575 |
%1=options |
| 3576 |
%2=mu |
| 3577 |
%3=sigma |
| 3578 |
\restoreKV[GraphiqueTikzGaussienne]% |
| 3579 |
\setKV[GraphiqueTikzGaussienne]{#1}% |
| 3580 |
\IfStrEq{\pflgaussstep}{}% |
| 3581 |
{% |
| 3582 |
\xdef\pflgaussstep{\xintfloateval{((\useKV[GraphiqueTikzGaussienne]{Fin})-(\useKV[GraphiqueTikzGaussienne]{Debut}))/100}}% |
| 3583 |
}% |
| 3584 |
{}% |
| 3585 |
\begin{scope} |
| 3586 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 3587 |
\draw[pflcourbe,{\useKV[GraphiqueTikzGaussienne]{Couleur}}] plot[smooth] coordinates {% |
| 3588 |
\xintthecoords\xintfloatexpr |
| 3589 |
seq((x,#2),x={\useKV[GraphiqueTikzGaussienne]{Debut}}..[\pflgaussstep]..{\useKV[GraphiqueTikzGaussienne]{Fin}},{\useKV[GraphiqueTikzGaussienne]{Fin}}) |
| 3590 |
\relax |
| 3591 |
} ; |
| 3592 |
\end{scope} |
| 3593 |
} |
| 3594 |
|
| 3595 |
%====DROITE |
| 3596 |
\defKV[GraphiquetikzDroite]{% |
| 3597 |
Nom=\def\pfldroitename{#1},% |
| 3598 |
StyleTrace=\def\pfldroitestyle{#1} |
| 3599 |
} |
| 3600 |
|
| 3601 |
\setKVdefault[GraphiquetikzDroite]{% |
| 3602 |
Pente=false,% |
| 3603 |
Couleur=black,% |
| 3604 |
Debut={\pflxmin},% |
| 3605 |
Fin={\pflxmax},% |
| 3606 |
Nom={},% |
| 3607 |
StyleTrace={} |
| 3608 |
} |
| 3609 |
|
| 3610 |
\NewDocumentCommand\TracerDroite{ O{} m m D<>{} }{% |
| 3611 |
\restoreKV[GraphiquetikzDroite]% |
| 3612 |
\setKV[GraphiquetikzDroite]{#1}% |
| 3613 |
%1er point |
| 3614 |
\path #2;% |
| 3615 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3616 |
\xdef\pfldtetikzxA{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3617 |
\xdef\pfldtetikzyA{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3618 |
%2ème point si besoin |
| 3619 |
\ifboolKV[GraphiquetikzDroite]{Pente}% |
| 3620 |
{% |
| 3621 |
\xdef\pfldtepente{\xintfloateval{#3}}% |
| 3622 |
}% |
| 3623 |
{% |
| 3624 |
\path #3;% |
| 3625 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3626 |
\xdef\pfldtetikzxB{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3627 |
\xdef\pfldtetikzyB{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3628 |
\xdef\pfldtepente{\xintfloateval{(\pfldtetikzyB-\pfldtetikzyA)/(\pfldtetikzxB-\pfldtetikzxA)}}% |
| 3629 |
}% |
| 3630 |
\begin{scope} |
| 3631 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 3632 |
\xintifboolexpr{\pfldtetikzxA == \pfldtetikzxB}% |
| 3633 |
{% |
| 3634 |
\IfEq{\pfldroitename}{}% |
| 3635 |
{% |
| 3636 |
\draw[pfltrait,\pfldroitestyle,{\useKV[GraphiquetikzDroite]{Couleur}},#4] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ; |
| 3637 |
}% |
| 3638 |
{% |
| 3639 |
\draw[pfltrait,\pfldroitestyle,{\useKV[GraphiquetikzDroite]{Couleur}},#4,name path global=\pfldroitename] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ; |
| 3640 |
}% |
| 3641 |
}% |
| 3642 |
{% |
| 3643 |
\IfEq{\pfldroitename}{}% |
| 3644 |
{% |
| 3645 |
\draw[pfltrait,\pfldroitestyle,{\useKV[GraphiquetikzDroite]{Couleur}},domain={\useKV[GraphiquetikzDroite]{Debut}}:{\useKV[GraphiquetikzDroite]{Fin}},samples=2,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ; |
| 3646 |
}% |
| 3647 |
{% |
| 3648 |
\draw[pfltrait,\pfldroitestyle,{\useKV[GraphiquetikzDroite]{Couleur}},domain={\useKV[GraphiquetikzDroite]{Debut}}:{\useKV[GraphiquetikzDroite]{Fin}},samples=2,name path global=\pfldroitename,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ; |
| 3649 |
}% |
| 3650 |
}% |
| 3651 |
\end{scope} |
| 3652 |
} |
| 3653 |
|
| 3654 |
%====ASYMPTOTE |
| 3655 |
\NewDocumentCommand\TracerAsymptote{ O{} m D<>{} }{% |
| 3656 |
\restoreKV[GraphiquetikzDroite]% |
| 3657 |
\setKV[GraphiquetikzDroite]{#1}% |
| 3658 |
%tracé |
| 3659 |
\draw[pfltrait,\pfldroitestyle,{\useKV[GraphiquetikzDroite]{Couleur}},#3] ({#2},{\pflymin})--({#2},{\pflymax}) ; |
| 3660 |
} |
| 3661 |
|
| 3662 |
|
| 3663 |
%====MINMAX |
| 3664 |
\defKV[GraphiqueTikzMinMax]{% |
| 3665 |
Pas=\def\pflminmaxstep{#1},% |
| 3666 |
Methode=\def\pflminmaxmethode{#1},% |
| 3667 |
Coeffs=\def\pflminmaxcoeffs{#1} |
| 3668 |
} |
| 3669 |
\setKVdefault[GraphiqueTikzMinMax]{% |
| 3670 |
Debut={\pflxmin},% |
| 3671 |
Fin={\pflxmax},% |
| 3672 |
Pas={},% |
| 3673 |
Tension=0.5,% |
| 3674 |
Methode=fonction,% |
| 3675 |
Coeffs=3 |
| 3676 |
} |
| 3677 |
|
| 3678 |
\NewDocumentCommand\TrouverMaximum{ O{} m O{c-max} }{% |
| 3679 |
%1=clés |
| 3680 |
%2=paramètres en fonction de [Methode] |
| 3681 |
\restoreKV[GraphiqueTikzMinMax]% |
| 3682 |
\setKV[GraphiqueTikzMinMax]{#1}% |
| 3683 |
\IfStrEq{\pflstepcurve}{}% |
| 3684 |
{% |
| 3685 |
\xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphiqueTikzMinMax]{Fin})-(\useKV[GraphiqueTikzMinMax]{Debut}))/100}}% |
| 3686 |
}% |
| 3687 |
{}% |
| 3688 |
\begin{scope}[bezier bounding box,local bounding box=bbtmpmax] |
| 3689 |
\IfStrEq{\pflminmaxmethode}{fonction}% |
| 3690 |
{% |
| 3691 |
\path[draw=none,name path=curvetmpmax] plot[smooth] coordinates {% |
| 3692 |
\xintthecoords\xintfloatexpr |
| 3693 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzMinMax]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzMinMax]{Fin}},{\useKV[GraphiqueTikzMinMax]{Fin}}) |
| 3694 |
\relax |
| 3695 |
}; |
| 3696 |
}% |
| 3697 |
{}% |
| 3698 |
\IfStrEq{\pflminmaxmethode}{interpo}% |
| 3699 |
{% |
| 3700 |
\path[draw=none,name path=curvetmpmax] plot[smooth,tension={\useKV[GraphiqueTikzMinMax]{Tension}}] coordinates {#2}; |
| 3701 |
}% |
| 3702 |
{}% |
| 3703 |
\IfStrEq{\pflminmaxmethode}{spline}% |
| 3704 |
{% |
| 3705 |
\GenererSpline{#2}{\pflminmaxcoeffs}[\tmpsplineminmax]% |
| 3706 |
\path[draw=none,name path=curvetmpmax] \tmpsplineminmax ; |
| 3707 |
}% |
| 3708 |
{}% |
| 3709 |
%retour |
| 3710 |
\path[name path=tmpmax] ([yshift=-0.25\pgflinewidth]bbtmpmax.north east) -- ([yshift=-0.25\pgflinewidth]bbtmpmax.north west) ; |
| 3711 |
\path[name intersections={of=curvetmpmax and tmpmax,name=#3}] ; |
| 3712 |
\coordinate (#3) at ($0.5*(#3-1)+0.5*(#3-2)+(0,0.25\pgflinewidth)$) ; |
| 3713 |
\end{scope} |
| 3714 |
} |
| 3715 |
|
| 3716 |
\NewDocumentCommand\TrouverMinimum{ O{} m O{c-min} }{% |
| 3717 |
%1=clés |
| 3718 |
%2=paramètres en fonction de [Methode] |
| 3719 |
\restoreKV[GraphiqueTikzMinMax]% |
| 3720 |
\setKV[GraphiqueTikzMinMax]{#1}% |
| 3721 |
\IfStrEq{\pflstepcurve}{}% |
| 3722 |
{% |
| 3723 |
\xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphiqueTikzMinMax]{Fin})-(\useKV[GraphiqueTikzMinMax]{Debut}))/100}}% |
| 3724 |
}% |
| 3725 |
{}% |
| 3726 |
\begin{scope}[bezier bounding box,local bounding box=bbtmpmin] |
| 3727 |
\IfStrEq{\pflminmaxmethode}{fonction}% |
| 3728 |
{% |
| 3729 |
\path[draw=none,name path=curvetmpmin] plot[smooth] coordinates {% |
| 3730 |
\xintthecoords\xintfloatexpr |
| 3731 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzMinMax]{Debut}}..[\pflstepcurve]..{\useKV[GraphiqueTikzMinMax]{Fin}},{\useKV[GraphiqueTikzMinMax]{Fin}}) |
| 3732 |
\relax |
| 3733 |
}; |
| 3734 |
}% |
| 3735 |
{}% |
| 3736 |
\IfStrEq{\pflminmaxmethode}{interpo}% |
| 3737 |
{% |
| 3738 |
\path[draw=none,name path=curvetmpmin] plot[smooth,tension={\useKV[GraphiqueTikzMinMax]{Tension}}] coordinates {#2}; |
| 3739 |
}% |
| 3740 |
{}% |
| 3741 |
\IfStrEq{\pflminmaxmethode}{spline}% |
| 3742 |
{% |
| 3743 |
\GenererSpline{#2}{\pflminmaxcoeffs}[\tmpsplineminmax]% |
| 3744 |
\path[draw=none,name path=curvetmpmin] \tmpsplineminmax ; |
| 3745 |
}% |
| 3746 |
{}% |
| 3747 |
%retour |
| 3748 |
\path[name path=tmpmin] ([yshift=0.25\pgflinewidth]bbtmpmin.south east) -- ([yshift=0.25\pgflinewidth]bbtmpmin.south west) ; |
| 3749 |
\path[name intersections={of=curvetmpmin and tmpmin,name=#3}] ; |
| 3750 |
\coordinate (#3) at ($0.5*(#3-1)+0.5*(#3-2)+(0,-0.25\pgflinewidth)$) ; |
| 3751 |
\end{scope} |
| 3752 |
} |
| 3753 |
|
| 3754 |
%====TEXTES |
| 3755 |
\defKV[GraphiqueTikzNode]{% |
| 3756 |
Couleur=\def\pflnodecol{#1},% |
| 3757 |
Police=\def\pflnodefonte{#1},% |
| 3758 |
Position=\def\pfnodepos{#1} |
| 3759 |
} |
| 3760 |
\setKVdefault[GraphiqueTikzNode]{% |
| 3761 |
Couleur=black,% |
| 3762 |
Police={\normalfont\normalsize},% |
| 3763 |
Position={} |
| 3764 |
} |
| 3765 |
\NewDocumentCommand\PlacerTexte{ O{} m m }{% |
| 3766 |
\restoreKV[GraphiqueTikzNode]% |
| 3767 |
\setKV[GraphiqueTikzNode]{#1}% |
| 3768 |
\draw #2 node[pflnoeud,font=\pflnodefonte,text=\pflnodecol,\pfnodepos] {#3} ; |
| 3769 |
} |
| 3770 |
|
| 3771 |
\NewDocumentCommand\TracerEllipse{ O{} m m m }{% |
| 3772 |
\restoreKV[GraphiqueTikzCourbe]% |
| 3773 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 3774 |
%booléens spécifiques pour Axes de symétries, foyers, sommets |
| 3775 |
\path #2 ; |
| 3776 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3777 |
\xdef\pflxcentreellipse{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3778 |
\xdef\pflycentreellipse{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3779 |
%on parse à courbe param ! |
| 3780 |
\TracerCourbeParam[#1]{\pflxcentreellipse+(#3)*cos(t)}{\pflycentreellipse+(#4)*sin(t)}% |
| 3781 |
%pour les foyers |
| 3782 |
\xdef\tmptkzcellipse{\xintfloateval{sqrt(max(#3,#4)^2-min(#3,#4)^2)}}% |
| 3783 |
} |
| 3784 |
|
| 3785 |
\NewDocumentCommand\TracerParabole{ O{} m m }{% |
| 3786 |
\restoreKV[GraphiqueTikzCourbe]% |
| 3787 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 3788 |
\path #2 ; |
| 3789 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3790 |
\xdef\pflxsommetparabole{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3791 |
\xdef\pflysommetparabole{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3792 |
% Sens=V (défaut) ou Sens=H |
| 3793 |
\IfStrEq{\pflsensparab}{H}{% |
| 3794 |
% axe horizontal : x = h + t²/(4p), y = k + t |
| 3795 |
% t joue le rôle de y-k, on borne sur Ymin/Ymax |
| 3796 |
\TracerCourbeParam[#1,% |
| 3797 |
Debut=\xintfloateval{\pflymin-\pflysommetparabole},% |
| 3798 |
Fin=\xintfloateval{\pflymax-\pflysommetparabole}]% |
| 3799 |
{\pflxsommetparabole+(t)^2/(4*(#3))}{\pflysommetparabole+(t)}% |
| 3800 |
}{% |
| 3801 |
% axe vertical : x = h + t, y = k + t²/(4p) |
| 3802 |
% t joue le rôle de x-h, on borne sur Xmin/Xmax |
| 3803 |
\TracerCourbeParam[#1,% |
| 3804 |
Debut=\xintfloateval{\pflxmin-\pflxsommetparabole},% |
| 3805 |
Fin=\xintfloateval{\pflxmax-\pflxsommetparabole}]% |
| 3806 |
{\pflxsommetparabole+(t)}{\pflysommetparabole+(t)^2/(4*(#3))}% |
| 3807 |
}% |
| 3808 |
} |
| 3809 |
|
| 3810 |
\NewDocumentCommand\TracerHyperbole{ O{} m m m }{% |
| 3811 |
\restoreKV[GraphiqueTikzCourbe]% |
| 3812 |
\setKV[GraphiqueTikzCourbe]{#1}% |
| 3813 |
\path #2 ; |
| 3814 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3815 |
\xdef\pflxcentrehyperbole{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3816 |
\xdef\pflycentrehyperbole{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3817 |
\xdef\pflnamecurveA{\pflnamecurve{}A}% |
| 3818 |
\xdef\pflnamecurveB{\pflnamecurve{}B}% |
| 3819 |
\IfStrEq{\pflsensparab}{H}% |
| 3820 |
{% |
| 3821 |
% axe horizontal : x = h ± a*cosh(t), y = k + b*sinh(t) |
| 3822 |
\TracerCourbeParam[#1,Debut=-5,Fin=5,Nom=\pflnamecurveA]% |
| 3823 |
{\pflxcentrehyperbole+(#3)*((exp(t)+exp(-t))/2)}% |
| 3824 |
{\pflycentrehyperbole+(#4)*((exp(t)-exp(-t))/2)}% |
| 3825 |
\TracerCourbeParam[#1,Debut=-5,Fin=5,Nom=\pflnamecurveB]% |
| 3826 |
{\pflxcentrehyperbole-(#3)*((exp(t)+exp(-t))/2)}% |
| 3827 |
{\pflycentrehyperbole+(#4)*((exp(t)-exp(-t))/2)}% |
| 3828 |
}% |
| 3829 |
{% |
| 3830 |
% axe vertical : y = k ± b*cosh(t), x = h + a*sinh(t) |
| 3831 |
\TracerCourbeParam[#1,Debut=-5,Fin=5,Nom=\pflnamecurveA]% |
| 3832 |
{\pflxcentrehyperbole+(#3)*((exp(t)-exp(-t))/2)}% |
| 3833 |
{\pflycentrehyperbole+(#4)*((exp(t)+exp(-t))/2)}% |
| 3834 |
\TracerCourbeParam[#1,Debut=-5,Fin=5,Nom=\pflnamecurveB]% |
| 3835 |
{\pflxcentrehyperbole+(#3)*((exp(t)-exp(-t))/2)}% |
| 3836 |
{\pflycentrehyperbole-(#4)*((exp(t)+exp(-t))/2)}% |
| 3837 |
}% |
| 3838 |
} |
| 3839 |
|
| 3840 |
\defKV[GraphiqueTikzConique]{% |
| 3841 |
Sens=\def\pflsensparab{#1} |
| 3842 |
} |
| 3843 |
|
| 3844 |
\setKVdefault[GraphiqueTikzConique]{% |
| 3845 |
CouleurPoints=black,% |
| 3846 |
CouleurDroites=black,% couleur spécifique pour les éléments |
| 3847 |
AffCentre=false,% |
| 3848 |
AffFoyers=false,% |
| 3849 |
AffSommets=false,% |
| 3850 |
AffAxes=false,% |
| 3851 |
AffDirectrice=false,% parabole |
| 3852 |
AffAsymptotes=false,% hyperbole,% |
| 3853 |
AffTout=false,% |
| 3854 |
Sens=V |
| 3855 |
} |
| 3856 |
|
| 3857 |
\NewDocumentCommand\AfficherElementsEllipse{ O{} m m m m }{% |
| 3858 |
% #1=clés #2=nom #3=centre #4=a #5=b |
| 3859 |
\restoreKV[GraphiqueTikzConique]% |
| 3860 |
\setKV[GraphiqueTikzConique]{#1}% |
| 3861 |
\path #3 ; |
| 3862 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3863 |
\xdef\pflxcentre{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3864 |
\xdef\pflycentre{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3865 |
\xdef\pflcellipse{\xintfloateval{sqrt(abs((#4)^2-(#5)^2))}}% |
| 3866 |
%booléen spécifique |
| 3867 |
\ifboolKV[GraphiqueTikzConique]{AffTout}% |
| 3868 |
{% |
| 3869 |
\setKV[GraphiqueTikzConique]{AffCentre=true,AffFoyers=true,AffSommets=true,AffAxes=true}% |
| 3870 |
}% |
| 3871 |
{}% |
| 3872 |
% nœuds centre |
| 3873 |
\coordinate (#2-C) at (\pflxcentre,\pflycentre) ; |
| 3874 |
% on détermine si grand axe horizontal ou vertical |
| 3875 |
\xintifboolexpr{ #4 > #5 }% |
| 3876 |
{% |
| 3877 |
\coordinate (#2-F1) at (\xintfloateval{\pflxcentre+\pflcellipse},\pflycentre) ;% |
| 3878 |
\coordinate (#2-F2) at (\xintfloateval{\pflxcentre-\pflcellipse},\pflycentre) ;% |
| 3879 |
}% |
| 3880 |
{% |
| 3881 |
\coordinate (#2-F1) at (\pflxcentre,\xintfloateval{\pflycentre+\pflcellipse}) ;% |
| 3882 |
\coordinate (#2-F2) at (\pflxcentre,\xintfloateval{\pflycentre-\pflcellipse}) ;% |
| 3883 |
}% |
| 3884 |
% nœuds sommets |
| 3885 |
\coordinate (#2-S1) at (\xintfloateval{\pflxcentre+(#4)},\pflycentre) ;% |
| 3886 |
\coordinate (#2-S2) at (\xintfloateval{\pflxcentre-(#4)},\pflycentre) ;% |
| 3887 |
\coordinate (#2-S3) at (\pflxcentre,\xintfloateval{\pflycentre+(#5)}) ;% |
| 3888 |
\coordinate (#2-S4) at (\pflxcentre,\xintfloateval{\pflycentre-(#5)}) ;% |
| 3889 |
% affichages |
| 3890 |
\ifboolKV[GraphiqueTikzConique]{AffAxes}% |
| 3891 |
{% |
| 3892 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 3893 |
(\xintfloateval{\pflxcentre-1.1*(#4)},\pflycentre) -- |
| 3894 |
(\xintfloateval{\pflxcentre+1.1*(#4)},\pflycentre) ;% |
| 3895 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 3896 |
(\pflxcentre,\xintfloateval{\pflycentre-1.1*(#5)}) -- |
| 3897 |
(\pflxcentre,\xintfloateval{\pflycentre+1.1*(#5)}) ;% |
| 3898 |
}% |
| 3899 |
{}% |
| 3900 |
\ifboolKV[GraphiqueTikzConique]{AffCentre}% |
| 3901 |
{% |
| 3902 |
\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-C)} |
| 3903 |
}{}% |
| 3904 |
\ifboolKV[GraphiqueTikzConique]{AffFoyers}% |
| 3905 |
{% |
| 3906 |
\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-F1),(#2-F2)}% |
| 3907 |
}% |
| 3908 |
{}% |
| 3909 |
\ifboolKV[GraphiqueTikzConique]{AffSommets}% |
| 3910 |
{% |
| 3911 |
\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-S1),(#2-S2),(#2-S3),(#2-S4)}% |
| 3912 |
}% |
| 3913 |
{}% |
| 3914 |
} |
| 3915 |
|
| 3916 |
\NewDocumentCommand\AfficherElementsParabole{ O{} m m m }{% |
| 3917 |
% #1=clés #2=nom #3=sommet #4=p |
| 3918 |
\restoreKV[GraphiqueTikzConique]% |
| 3919 |
\setKV[GraphiqueTikzConique]{#1}% |
| 3920 |
\path #3 ; |
| 3921 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3922 |
\xdef\pflxsommet{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3923 |
\xdef\pflysommet{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3924 |
% AffTout |
| 3925 |
\ifboolKV[GraphiqueTikzConique]{AffTout}% |
| 3926 |
{\setKV[GraphiqueTikzConique]{AffFoyers=true,AffSommets=true,AffAxes=true,AffDirectrice=true}}% |
| 3927 |
{}% |
| 3928 |
% nœud sommet |
| 3929 |
\coordinate (#2-S) at (\pflxsommet,\pflysommet) ;% |
| 3930 |
% foyer et directrice selon sens |
| 3931 |
\IfStrEq{\pflsensparab}{H}{% |
| 3932 |
% axe horizontal : foyer à (h+p, k), directrice x = h-p |
| 3933 |
\coordinate (#2-F) at (\xintfloateval{\pflxsommet+(#4)},\pflysommet) ;% |
| 3934 |
\coordinate (#2-D1) at (\xintfloateval{\pflxsommet-(#4)},\pflymin) ;% |
| 3935 |
\coordinate (#2-D2) at (\xintfloateval{\pflxsommet-(#4)},\pflymax) ;% |
| 3936 |
\coordinate (#2-A1) at (\pflxmin,\pflysommet) ;% |
| 3937 |
\coordinate (#2-A2) at (\pflxmax,\pflysommet) ;% |
| 3938 |
}% |
| 3939 |
{% |
| 3940 |
% axe vertical : foyer à (h, k+p), directrice y = k-p |
| 3941 |
\coordinate (#2-F) at (\pflxsommet,\xintfloateval{\pflysommet+(#4)}) ;% |
| 3942 |
\coordinate (#2-D1) at (\pflxmin,\xintfloateval{\pflysommet-(#4)}) ;% |
| 3943 |
\coordinate (#2-D2) at (\pflxmax,\xintfloateval{\pflysommet-(#4)}) ;% |
| 3944 |
\coordinate (#2-A1) at (\pflxsommet,\pflymin) ;% |
| 3945 |
\coordinate (#2-A2) at (\pflxsommet,\pflymax) ;% |
| 3946 |
}% |
| 3947 |
% axe de symétrie |
| 3948 |
\ifboolKV[GraphiqueTikzConique]{AffAxes}% |
| 3949 |
{% |
| 3950 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 3951 |
(#2-A1) -- (#2-A2) ;% |
| 3952 |
}{}% |
| 3953 |
% directrice |
| 3954 |
\ifboolKV[GraphiqueTikzConique]{AffDirectrice}% |
| 3955 |
{% |
| 3956 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 3957 |
(#2-D1) -- (#2-D2) ;% |
| 3958 |
}{}% |
| 3959 |
% foyer |
| 3960 |
\ifboolKV[GraphiqueTikzConique]{AffFoyers}% |
| 3961 |
{% |
| 3962 |
\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-F)}% |
| 3963 |
}{}% |
| 3964 |
% sommet |
| 3965 |
\ifboolKV[GraphiqueTikzConique]{AffSommets}% |
| 3966 |
{% |
| 3967 |
\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-S)}% |
| 3968 |
}{}% |
| 3969 |
} |
| 3970 |
|
| 3971 |
\NewDocumentCommand\AfficherElementsHyperbole{ O{} m m m m }{% |
| 3972 |
% #1=clés #2=nom #3=centre #4=a #5=b |
| 3973 |
\restoreKV[GraphiqueTikzConique]% |
| 3974 |
\setKV[GraphiqueTikzConique]{#1}% |
| 3975 |
\path #3 ; |
| 3976 |
\pgfgetlastxy{\macrox}{\macroy}% |
| 3977 |
\xdef\pflxcentre{\xintfloateval{(\ConvertirPtToCm{\macrox})/(\pflxunit)}}% |
| 3978 |
\xdef\pflycentre{\xintfloateval{(\ConvertirPtToCm{\macroy})/(\pflyunit)}}% |
| 3979 |
% c = sqrt(a²+b²) pour l'hyperbole ! |
| 3980 |
\xdef\pflchyperbole{\xintfloateval{sqrt((#4)^2+(#5)^2)}}% |
| 3981 |
% AffTout |
| 3982 |
\ifboolKV[GraphiqueTikzConique]{AffTout}% |
| 3983 |
{\setKV[GraphiqueTikzConique]{AffCentre=true,AffFoyers=true,AffSommets=true,AffAsymptotes=true}}% |
| 3984 |
{}% |
| 3985 |
% nœud centre |
| 3986 |
\coordinate (#2-C) at (\pflxcentre,\pflycentre) ;% |
| 3987 |
% foyers et sommets selon sens |
| 3988 |
\IfStrEq{\pflsensparab}{V}% |
| 3989 |
{% |
| 3990 |
% axe vertical |
| 3991 |
\coordinate (#2-F1) at (\pflxcentre,\xintfloateval{\pflycentre+\pflchyperbole}) ;% |
| 3992 |
\coordinate (#2-F2) at (\pflxcentre,\xintfloateval{\pflycentre-\pflchyperbole}) ;% |
| 3993 |
\coordinate (#2-S1) at (\pflxcentre,\xintfloateval{\pflycentre+(#5)}) ;% |
| 3994 |
\coordinate (#2-S2) at (\pflxcentre,\xintfloateval{\pflycentre-(#5)}) ;% |
| 3995 |
}% |
| 3996 |
{% |
| 3997 |
% axe horizontal |
| 3998 |
\coordinate (#2-F1) at (\xintfloateval{\pflxcentre+\pflchyperbole},\pflycentre) ;% |
| 3999 |
\coordinate (#2-F2) at (\xintfloateval{\pflxcentre-\pflchyperbole},\pflycentre) ;% |
| 4000 |
\coordinate (#2-S1) at (\xintfloateval{\pflxcentre+(#4)},\pflycentre) ;% |
| 4001 |
\coordinate (#2-S2) at (\xintfloateval{\pflxcentre-(#4)},\pflycentre) ;% |
| 4002 |
}% |
| 4003 |
% affichages |
| 4004 |
\ifboolKV[GraphiqueTikzConique]{AffAsymptotes}% |
| 4005 |
{% |
| 4006 |
\begin{scope} |
| 4007 |
\clip (\pflxmin,\pflymin) rectangle (\pflxmax,\pflymax) ; |
| 4008 |
% asymptotes : pentes ±b/a (H) ou ±a/b (V) |
| 4009 |
\IfStrEq{\pflsensparab}{V}% |
| 4010 |
{% |
| 4011 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 4012 |
(\pflxmin, \xintfloateval{\pflycentre+(#4)/(#5)*(\pflxmin-\pflxcentre)}) -- |
| 4013 |
(\pflxmax, \xintfloateval{\pflycentre+(#4)/(#5)*(\pflxmax-\pflxcentre)}) ; |
| 4014 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 4015 |
(\pflxmin, \xintfloateval{\pflycentre-(#4)/(#5)*(\pflxmin-\pflxcentre)}) -- |
| 4016 |
(\pflxmax, \xintfloateval{\pflycentre-(#4)/(#5)*(\pflxmax-\pflxcentre)}) ; |
| 4017 |
}% |
| 4018 |
{% |
| 4019 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 4020 |
(\pflxmin, \xintfloateval{\pflycentre+(#5)/(#4)*(\pflxmin-\pflxcentre)}) -- |
| 4021 |
(\pflxmax, \xintfloateval{\pflycentre+(#5)/(#4)*(\pflxmax-\pflxcentre)}) ; |
| 4022 |
\draw[{\useKV[GraphiqueTikzConique]{CouleurDroites}},pfltraitvoisinageasympt] |
| 4023 |
(\pflxmin, \xintfloateval{\pflycentre-(#5)/(#4)*(\pflxmin-\pflxcentre)}) -- |
| 4024 |
(\pflxmax, \xintfloateval{\pflycentre-(#5)/(#4)*(\pflxmax-\pflxcentre)}) ; |
| 4025 |
}% |
| 4026 |
\end{scope}% |
| 4027 |
}{}% |
| 4028 |
\ifboolKV[GraphiqueTikzConique]{AffCentre}% |
| 4029 |
{\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-C)}}{}% |
| 4030 |
\ifboolKV[GraphiqueTikzConique]{AffFoyers}% |
| 4031 |
{\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-F1),(#2-F2)}}{}% |
| 4032 |
\ifboolKV[GraphiqueTikzConique]{AffSommets}% |
| 4033 |
{\MarquerPts*[Couleur={\useKV[GraphiqueTikzConique]{CouleurPoints}}]{(#2-S1),(#2-S2)}}{}% |
| 4034 |
} |
| 4035 |
|
| 4036 |
%====ECC |
| 4037 |
\defKV[tkzgECC]{% |
| 4038 |
Couleur=\def\tkzecc@coul@graph{#1},% |
| 4039 |
CouleursParams=\def\tkzecc@coul@params{#1} |
| 4040 |
} |
| 4041 |
|
| 4042 |
\setKVdefault[tkzgECC]{% |
| 4043 |
Couleur=black,% |
| 4044 |
AffParams=true,% |
| 4045 |
CouleursParams={black},% |
| 4046 |
TraitsComplets=true |
| 4047 |
} |
| 4048 |
|
| 4049 |
\NewDocumentCommand\TracerCourbeECC{ O{} m m }{% |
| 4050 |
\restoreKV[tkzgECC]% |
| 4051 |
\setKV[tkzgECC]{#1}% |
| 4052 |
\IfSubStr{\tkzecc@coul@params}{/}% |
| 4053 |
{% |
| 4054 |
\StrCut{\tkzecc@coul@params}{/}{\tkzecc@coul@quart}{\tkzecc@coul@med}% |
| 4055 |
}% |
| 4056 |
{% |
| 4057 |
\def\tkzecc@coul@quart{\tkzecc@coul@params}\def\tkzecc@coul@med{\tkzecc@coul@params}% |
| 4058 |
}% |
| 4059 |
\setsepchar{,}% |
| 4060 |
\readlist*\DataClass{#2}% |
| 4061 |
\readlist*\DataEff{#3}% |
| 4062 |
\xdef\DonneesECC{0}% |
| 4063 |
\xintFor* ##1 in {\xintSeq{1}{\DataEfflen}}\do{% |
| 4064 |
\xdef\DonneesTmp{0} |
| 4065 |
\xintFor* ##2 in {\xintSeq{1}{##1}}\do{% |
| 4066 |
\xdef\DonneesTmp{\xintfloateval{\DonneesTmp+\DataEff[##2]}}% |
| 4067 |
}% |
| 4068 |
\xdef\DonneesECC{\DonneesECC,\DonneesTmp}% |
| 4069 |
}% |
| 4070 |
\readlist*\DataECC\DonneesECC% |
| 4071 |
\itemtomacro\DataClass[1]\DonneesXmin% |
| 4072 |
\itemtomacro\DataClass[-1]\DonneesXmax% |
| 4073 |
\itemtomacro\DataECC[-1]\DonneesEffMax% |
| 4074 |
\xdef\DonneesListeECC{(\DataClass[1],\DataECC[1])}% |
| 4075 |
\xintFor* ##1 in {\xintSeq{2}{\DataECClen}}\do{% |
| 4076 |
\xdef\DonneesListeECC{\DonneesListeECC--(\DataClass[##1],\DataECC[##1])}% |
| 4077 |
}% |
| 4078 |
%paramètres par interpolation |
| 4079 |
\xintFor* ##1 in {\xintSeq{1}{\DataEfflen}}\do{% |
| 4080 |
\xdef\isuiv{\xinteval{##1+1}}% |
| 4081 |
\xintifboolexpr{\DataECC[##1] < (0.25*\DonneesEffMax) 'and' \DataECC[\isuiv] >= (0.25*\DonneesEffMax)}% |
| 4082 |
{% |
| 4083 |
\xdef\pentetmpECC{(\DataECC[\isuiv]-\DataECC[##1])/(\DataClass[\isuiv]-\DataClass[##1])}%OK |
| 4084 |
\xdef\ValPremQuartile{\xintfloateval{(0.25*\DonneesEffMax+\pentetmpECC*\DataClass[##1]-\DataECC[##1])/(\pentetmpECC)}}% |
| 4085 |
} |
| 4086 |
{}% |
| 4087 |
\xintifboolexpr{\DataECC[##1] < (0.50*\DonneesEffMax) 'and' \DataECC[\isuiv] >= (0.50*\DonneesEffMax)}% |
| 4088 |
{% |
| 4089 |
\xdef\pentetmpECC{(\DataECC[\isuiv]-\DataECC[##1])/(\DataClass[\isuiv]-\DataClass[##1])}%OK |
| 4090 |
\xdef\ValMed{\xintfloateval{(0.50*\DonneesEffMax+\pentetmpECC*\DataClass[##1]-\DataECC[##1])/(\pentetmpECC)}}% |
| 4091 |
} |
| 4092 |
{}% |
| 4093 |
\xintifboolexpr{\DataECC[##1] < (0.75*\DonneesEffMax) 'and' \DataECC[\isuiv] >= (0.75*\DonneesEffMax)}% |
| 4094 |
{% |
| 4095 |
\xdef\pentetmpECC{(\DataECC[\isuiv]-\DataECC[##1])/(\DataClass[\isuiv]-\DataClass[##1])}%OK |
| 4096 |
\xdef\ValTroisQuartile{\xintfloateval{(0.75*\DonneesEffMax+\pentetmpECC*\DataClass[##1]-\DataECC[##1])/(\pentetmpECC)}}% |
| 4097 |
} |
| 4098 |
{}% |
| 4099 |
}% |
| 4100 |
%partie graphique |
| 4101 |
\draw[pflcourbeecc,\tkzecc@coul@graph] \DonneesListeECC ; |
| 4102 |
\xintFor* ##1 in {\xintSeq{1}{\DataECClen}}\do{% |
| 4103 |
\filldraw[\tkzecc@coul@graph] (\DataClass[##1],\DataECC[##1]) circle[pflpointnuage] ; |
| 4104 |
}% |
| 4105 |
\ifboolKV[tkzgECC]{AffParams}% |
| 4106 |
{% |
| 4107 |
%médiane |
| 4108 |
\ifboolKV[tkzgECC]{TraitsComplets}% |
| 4109 |
{% |
| 4110 |
\draw[pfltraitsparamecc,\tkzecc@coul@med] (\pflxmin,{0.50*\DonneesEffMax})--(\pflxmax,{0.50*\DonneesEffMax}); |
| 4111 |
\draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.25*\DonneesEffMax})--++({\pflxmax-\pflxmin},0); |
| 4112 |
\draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.75*\DonneesEffMax})--++({\pflxmax-\pflxmin},0); |
| 4113 |
}% |
| 4114 |
{% |
| 4115 |
\draw[pfltraitsparamecc,\tkzecc@coul@med] (\pflxmin,{0.50*\DonneesEffMax})--(\ValMed,{0.50*\DonneesEffMax}); |
| 4116 |
\draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.25*\DonneesEffMax})--++({\ValPremQuartile-\pflxmin},0); |
| 4117 |
\draw[pfltraitsparamecc,\tkzecc@coul@quart] (\pflxmin,{0.75*\DonneesEffMax})--++({\ValTroisQuartile-\pflxmin},0); |
| 4118 |
}% |
| 4119 |
\draw[pfltraitsparamecc,\tkzecc@coul@med] (\ValMed,{0.5*\DonneesEffMax})--(\ValMed,0) ; \draw[\tkzecc@coul@med,thick,fill=white] (\ValMed,{0.5*\DonneesEffMax}) circle[pflpointnuage] ; |
| 4120 |
\draw[pfltraitsparamecc,\tkzecc@coul@quart] (\ValPremQuartile,{0.25*\DonneesEffMax})--(\ValPremQuartile,\pflymin) ; \draw[\tkzecc@coul@quart,thick,fill=white] (\ValPremQuartile,{0.25*\DonneesEffMax}) circle[pflpointnuage] ; |
| 4121 |
\draw[pfltraitsparamecc,\tkzecc@coul@quart] (\ValTroisQuartile,{0.75*\DonneesEffMax})--(\ValTroisQuartile,\pflymin) ; \draw[\tkzecc@coul@quart,thick,fill=white] (\ValTroisQuartile,{0.75*\DonneesEffMax}) circle[pflpointnuage] ; |
| 4122 |
}% |
| 4123 |
{}% |
| 4124 |
} |
| 4125 |
|
| 4126 |
%====PTS DISCONTINUITÉ |
| 4127 |
\defKV[tkzptdiscont]{% |
| 4128 |
Couleur=\def\pfldiscontcouleur{#1},% |
| 4129 |
Pos=\def\pfldiscontpos{#1},% |
| 4130 |
Echelle=\def\pfldiscontechelle{#1},% |
| 4131 |
Type=\def\pfldisconttype{#1} |
| 4132 |
} |
| 4133 |
|
| 4134 |
\setKVdefault[tkzptdiscont]{% |
| 4135 |
Couleur=black,% |
| 4136 |
Pos=D,% |
| 4137 |
Echelle=1,% |
| 4138 |
Type=par |
| 4139 |
} |
| 4140 |
|
| 4141 |
\NewDocumentCommand\AfficherPtsDiscont{ O{} m }{% |
| 4142 |
\restoreKV[tkzptdiscont] |
| 4143 |
\setKV[tkzptdiscont]{#1}% |
| 4144 |
\setsepchar[.]{§./}% |
| 4145 |
\readlist*\SPLlisteDiscont{#2}% |
| 4146 |
\def\SPLlisteDiscontNb{\SPLlisteDiscontlen}% |
| 4147 |
\foreach \i in {1,...,\SPLlisteDiscontNb}{% |
| 4148 |
\begin{scope}[shift={(\SPLlisteDiscont[\i,1],\SPLlisteDiscont[\i,2])},rotate={atan \SPLlisteDiscont[\i,3]},scale=\pfldiscontechelle] |
| 4149 |
\IfStrEq{\pfldisconttype}{rond}% |
| 4150 |
{% |
| 4151 |
\draw[pflcourbediscont,fill=white,draw=\pfldiscontcouleur] (0,0) circle[radius=3pt] ; |
| 4152 |
}{}% |
| 4153 |
\IfStrEq{\pfldiscontpos}{D}% |
| 4154 |
{% |
| 4155 |
\IfStrEq{\pfldisconttype}{par}% |
| 4156 |
{% |
| 4157 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=170] (4pt,5pt) ; |
| 4158 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=-170] (4pt,-5pt) ; |
| 4159 |
}{}% |
| 4160 |
\IfStrEq{\pfldisconttype}{demirond}% |
| 4161 |
{% |
| 4162 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=180] (3pt,3pt) ; |
| 4163 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=180] (3pt,-3pt) ; |
| 4164 |
}{}% |
| 4165 |
\IfStrEq{\pfldisconttype}{cro}% |
| 4166 |
{% |
| 4167 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (4pt,5pt) ; |
| 4168 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (4pt,-5pt) ; |
| 4169 |
}{}% |
| 4170 |
}% |
| 4171 |
{% |
| 4172 |
\IfStrEq{\pfldisconttype}{par}% |
| 4173 |
{% |
| 4174 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=-10] (-4pt,5pt) ; |
| 4175 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=10] (-4pt,-5pt) ; |
| 4176 |
}{}% |
| 4177 |
\IfStrEq{\pfldisconttype}{demirond}% |
| 4178 |
{% |
| 4179 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=90,in=0] (-3pt,3pt) ; |
| 4180 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) to[out=-90,in=0] (-3pt,-3pt) ; |
| 4181 |
}{}% |
| 4182 |
\IfStrEq{\pfldisconttype}{cro}% |
| 4183 |
{% |
| 4184 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (-4pt,5pt) ; |
| 4185 |
\draw[pflcourbediscont,\pfldiscontcouleur] (0,0) |- (-4pt,-5pt) ; |
| 4186 |
}{}% |
| 4187 |
}% |
| 4188 |
\end{scope} |
| 4189 |
}% |
| 4190 |
} |
| 4191 |
|
| 4192 |
%====TOILE RÉCURRENCE (OK avec courbe + spline !!) |
| 4193 |
\defKV[tkzwebrecurr]{% |
| 4194 |
Couleur=\def\pflrecurcolor{#1},% |
| 4195 |
Nom=\def\pflrecurnom{#1},% |
| 4196 |
No=\def\pflrecurno{#1},% |
| 4197 |
Nb=\def\pflrecurnb{#1},% |
| 4198 |
Uno=\def\pflrecuruno{#1}, |
| 4199 |
TailleLabel=\def\pflrecurlabelsize{#1},% |
| 4200 |
PosLabel=\def\pflrecurlabelpos{#1} |
| 4201 |
} |
| 4202 |
|
| 4203 |
\setKVdefault[tkzwebrecurr]{% |
| 4204 |
Couleur=black,% |
| 4205 |
Spline=false,% |
| 4206 |
No=0,% |
| 4207 |
Nom=u,% |
| 4208 |
Nb=5,% |
| 4209 |
AffTermes=false,% |
| 4210 |
AffPointilles=true,% |
| 4211 |
TailleLabel=\small,% |
| 4212 |
PosLabel=below |
| 4213 |
} |
| 4214 |
|
| 4215 |
\NewDocumentCommand\TracerToileRecurrence{ O{} m }{ |
| 4216 |
%<clés> + fonction/courbe |
| 4217 |
\useKVdefault[tkzwebrecurr]% |
| 4218 |
\setKV[tkzwebrecurr]{#1}% on paramètres les nouvelles clés et on les simplifie |
| 4219 |
\ifboolKV[tkzwebrecurr]{Spline}% |
| 4220 |
{% |
| 4221 |
\foreach \i [remember=\i as \x (initially \pflrecuruno)] in {1,...,\pflrecurnb}{% |
| 4222 |
%\xdef\y{\xintfloateval{#2(\x)}}% |
| 4223 |
\path[draw=none,pflcourbe,name path=tmprecur] ({\x},{\pflymin})--({\x},{\pflymax}) ; |
| 4224 |
\path[name intersections={of=#2 and tmprecur,name=ZZZZ}] ; |
| 4225 |
%\coordinate (\pflrecurnoms) at (ZZZZ-1) ; |
| 4226 |
\GetYcoord{(ZZZZ-1)}[\y] |
| 4227 |
%test de la position courbe / bissectrice ? |
| 4228 |
\ifnum \i=1 |
| 4229 |
\newdimen \X |
| 4230 |
\newdimen \Y |
| 4231 |
\X = \x pt |
| 4232 |
\Y = \y pt |
| 4233 |
\ifdim \Y < \X |
| 4234 |
\draw[pfltraitrec,\pflrecurcolor] (\x,\y)--(\y,\y) ; |
| 4235 |
\else |
| 4236 |
\draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; |
| 4237 |
\fi |
| 4238 |
\else |
| 4239 |
\draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; |
| 4240 |
\fi |
| 4241 |
\ifboolKV[tkzwebrecurr]{AffPointilles}% |
| 4242 |
{% |
| 4243 |
\def\indice{\fpeval{\i+\pflrecurno-1}}% |
| 4244 |
\ifboolKV[tkzwebrecurr]{AffTermes}% |
| 4245 |
{% |
| 4246 |
\draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) node[\pflrecurlabelpos,font=\pflrecurlabelsize]{$\pflrecurnom_{\indice}$};% |
| 4247 |
}% |
| 4248 |
{% |
| 4249 |
\draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) ;% |
| 4250 |
}% |
| 4251 |
}% |
| 4252 |
{} |
| 4253 |
\def\i{\y}% |
| 4254 |
}% |
| 4255 |
}% |
| 4256 |
{% |
| 4257 |
\foreach \i [remember=\i as \x (initially \pflrecuruno)] in {1,...,\pflrecurnb}{% |
| 4258 |
\xdef\y{\xintfloateval{#2(\x)}}% |
| 4259 |
%test de la position courbe / bissectrice ? |
| 4260 |
\ifnum \i=1 |
| 4261 |
\newdimen \X |
| 4262 |
\newdimen \Y |
| 4263 |
\X = \x pt |
| 4264 |
\Y = \y pt |
| 4265 |
\ifdim \Y < \X |
| 4266 |
\draw[pfltraitrec,\pflrecurcolor] (\x,\y)--(\y,\y) ; |
| 4267 |
\else |
| 4268 |
\draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; |
| 4269 |
\fi |
| 4270 |
\else |
| 4271 |
\draw[pfltraitrec,\pflrecurcolor] (\x,\x)--(\x,\y)--(\y,\y) ; |
| 4272 |
\fi |
| 4273 |
\ifboolKV[tkzwebrecurr]{AffPointilles}% |
| 4274 |
{% |
| 4275 |
\def\indice{\fpeval{\i+\pflrecurno-1}}% |
| 4276 |
\ifboolKV[tkzwebrecurr]{AffTermes}% |
| 4277 |
{% |
| 4278 |
\draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) node[\pflrecurlabelpos,font=\pflrecurlabelsize]{$\pflrecurnom_{\indice}$};% |
| 4279 |
}% |
| 4280 |
{% |
| 4281 |
\draw[pfltraitrecpointill,\pflrecurcolor] (\x,\y)--(\x,\pflxmin) ;% |
| 4282 |
}% |
| 4283 |
}% |
| 4284 |
{} |
| 4285 |
\def\i{\xintfloateval{\y}}% |
| 4286 |
}% |
| 4287 |
}% |
| 4288 |
} |
| 4289 |
|
| 4290 |
%====linear inequality [fr] |
| 4291 |
\defKV[GraphiquetikzInegLin]{% |
| 4292 |
Opacite=\def\pflineglinopac{#1},% |
| 4293 |
Nom=\def\pflineglinname{#1},% |
| 4294 |
Style=\def\pflineglintikzstyle{#1},% |
| 4295 |
Hachures=\def\pflineglintikzhatch{#1} |
| 4296 |
} |
| 4297 |
|
| 4298 |
\setKVdefault[GraphiquetikzInegLin]{% |
| 4299 |
Opacite=0.25, |
| 4300 |
Couleur=black,% |
| 4301 |
Style=hachures,% |
| 4302 |
Hachures={north west lines},% |
| 4303 |
Swap=false,% |
| 4304 |
PointillesSiStrict=true |
| 4305 |
} |
| 4306 |
|
| 4307 |
\NewDocumentCommand\InegaliteLineaire{O{}D<>{f}mm}{% |
| 4308 |
\restoreKV[GraphiquetikzInegLin]% |
| 4309 |
\setKV[GraphiquetikzInegLin]{#1}% |
| 4310 |
%style for filling... ? |
| 4311 |
\IfStrEq{\pflineglintikzstyle}{hachures}% |
| 4312 |
{% |
| 4313 |
\tikzset{dominegallintikzstyle/.style={draw=none,pattern=\pflineglintikzhatch,pattern color={\useKV[GraphiquetikzInegLin]{Couleur}},line join=bevel}} |
| 4314 |
}% |
| 4315 |
{}% |
| 4316 |
\IfStrEq{\pflineglintikzstyle}{remplissage}% |
| 4317 |
{% |
| 4318 |
\tikzset{dominegallintikzstyle/.style={draw=none,fill={\useKV[GraphiquetikzInegLin]{Couleur}},fill opacity=\pflineglinopac,line join=bevel}} |
| 4319 |
}% |
| 4320 |
{}% |
| 4321 |
\ifboolKV[GraphiquetikzInegLin]{PointillesSiStrict}% |
| 4322 |
{% |
| 4323 |
\IfSubStr{#4}{=}% |
| 4324 |
{% |
| 4325 |
\tikzset{stylelinelinineq/.style={pfltrait}}% |
| 4326 |
}% |
| 4327 |
{% |
| 4328 |
\tikzset{stylelinelinineq/.style={pfltraitpointille}}% |
| 4329 |
}% |
| 4330 |
}% |
| 4331 |
{% |
| 4332 |
\tikzset{stylelinelinineq/.style={pfltrait}}% |
| 4333 |
}% |
| 4334 |
%dummy equation |
| 4335 |
\xintdeffloatfunc pfldummy(x,y) := #3; |
| 4336 |
%coeffc |
| 4337 |
\xdef\coeffc{\xintfloateval{pfldummy(0,0)}}% |
| 4338 |
%coeffa |
| 4339 |
\xdef\coeffa{\xintfloateval{pfldummy(1,0)-pfldummy(0,0)}}% |
| 4340 |
%coeffb |
| 4341 |
\xdef\coeffb{\xintfloateval{pfldummy(0,1)-pfldummy(0,0)}}% |
| 4342 |
%swap |
| 4343 |
\ifboolKV[GraphiquetikzInegLin]{Swap}% |
| 4344 |
{\IfBeginWith{#4}{<}{\def\tmpinegalsign{>}}{\def\tmpinegalsign{<}}}% |
| 4345 |
{\def\tmpinegalsign{#4}}% |
| 4346 |
%particular part |
| 4347 |
\xintifboolexpr{ \coeffb == 0 }%vertical |
| 4348 |
{% |
| 4349 |
\begin{scope} |
| 4350 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4351 |
\xintifboolexpr{ \coeffa > 0 }% |
| 4352 |
{% |
| 4353 |
\IfBeginWith{\tmpinegalsign}{>}% |
| 4354 |
{% |
| 4355 |
\draw[stylelinelinineq,dominegallintikzstyle] ({-(\coeffc)/(\coeffa)},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4356 |
}% |
| 4357 |
{% |
| 4358 |
\draw[stylelinelinineq,dominegallintikzstyle] ({-(\coeffc)/(\coeffa)},{\pflymin}) rectangle ({\pflxmin},{\pflymax}) ; |
| 4359 |
}% |
| 4360 |
}% |
| 4361 |
{% |
| 4362 |
\IfBeginWith{\tmpinegalsign}{>}% |
| 4363 |
{% |
| 4364 |
\draw[stylelinelinineq,dominegallintikzstyle] ({-(\coeffc)/(\coeffa)},{\pflymin}) rectangle ({\pflxmin},{\pflymax}) ; |
| 4365 |
}% |
| 4366 |
{% |
| 4367 |
\draw[stylelinelinineq,dominegallintikzstyle] ({-(\coeffc)/(\coeffa)},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4368 |
}% |
| 4369 |
}% |
| 4370 |
\draw[stylelinelinineq,{\useKV[GraphiquetikzInegLin]{Couleur}}] ({-(\coeffc)/(\coeffa)},{\pflymin}) -- ({-(\coeffc)/(\coeffa)},{\pflymax}) ; |
| 4371 |
\end{scope} |
| 4372 |
}% |
| 4373 |
{% b!=0 () |
| 4374 |
\xdef\tmpvalzzyxmin{\xintfloateval{(-\coeffc-\coeffa*(\pflxmin))/(\coeffb)}}% |
| 4375 |
\xdef\tmpvalzzyxmax{\xintfloateval{(-\coeffc-\coeffa*(\pflxmax))/(\coeffb)}}% |
| 4376 |
\begin{scope} |
| 4377 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4378 |
%--- |
| 4379 |
\xintifboolexpr{ \coeffb > 0 }% |
| 4380 |
{% |
| 4381 |
\IfBeginWith{\tmpinegalsign}{<}% |
| 4382 |
{% |
| 4383 |
\clip ({\pflxmin},{\pflymin}) -- ({\pflxmax},{\pflymin}) -- ({\pflxmax},{\tmpvalzzyxmax}) -- ({\pflxmin},{\tmpvalzzyxmin}) -- cycle ; |
| 4384 |
\fill[dominegallintikzstyle] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4385 |
}% |
| 4386 |
{% |
| 4387 |
\clip ({\pflxmin},{\tmpvalzzyxmin}) -- ({\pflxmax},{\tmpvalzzyxmax}) -- ({\pflxmax},{\pflymax}) -- ({\pflxmin},{\pflymax}) -- cycle ; |
| 4388 |
\fill[dominegallintikzstyle] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4389 |
}% |
| 4390 |
}% |
| 4391 |
{% |
| 4392 |
\IfBeginWith{\tmpinegalsign}{<}% |
| 4393 |
{% |
| 4394 |
\clip ({\pflxmin},{\tmpvalzzyxmin}) -- ({\pflxmax},{\tmpvalzzyxmax}) -- ({\pflxmax},{\pflymax}) -- ({\pflxmin},{\pflymax}) -- cycle ; |
| 4395 |
\fill[dominegallintikzstyle] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4396 |
}% |
| 4397 |
{% |
| 4398 |
\clip ({\pflxmin},{\pflymin}) -- ({\pflxmax},{\pflymin}) -- ({\pflxmax},{\tmpvalzzyxmax}) -- ({\pflxmin},{\tmpvalzzyxmin}) -- cycle ; |
| 4399 |
\fill[dominegallintikzstyle] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ; |
| 4400 |
}% |
| 4401 |
}% |
| 4402 |
%--- |
| 4403 |
\draw[stylelinelinineq,{\useKV[GraphiquetikzInegLin]{Couleur}}] ({\pflxmin},{(-\coeffc-\coeffa*(\pflxmin))/(\coeffb)}) -- ({\pflxmax},{(-\coeffc-\coeffa*(\pflxmax))/(\coeffb)}) ; |
| 4404 |
\end{scope} |
| 4405 |
}% |
| 4406 |
} |
| 4407 |
|
| 4408 |
%====TRANSFORMATION f(x-a)+b (formule, spline, interpo) |
| 4409 |
\defKV[GraphiqueTikzTransfo]{% |
| 4410 |
Nom=\def\pflnametransfo{#1},% |
| 4411 |
StyleTrace=\def\pflstyletransfo{#1},% |
| 4412 |
Pas=\def\pflsteptransfo{#1},% |
| 4413 |
Coeffs=\def\pflcoeffstransfo{#1},% |
| 4414 |
Tension=\def\pfltensiontransfo{#1} |
| 4415 |
} |
| 4416 |
|
| 4417 |
\setKVdefault[GraphiqueTikzTransfo]{% |
| 4418 |
Nom={},% |
| 4419 |
Couleur=black,% |
| 4420 |
Debut={\pflxmin},% |
| 4421 |
Fin={\pflxmax},% |
| 4422 |
Pas={},% |
| 4423 |
Clip=true,% |
| 4424 |
Spline=false,% |
| 4425 |
Interpo=false,% |
| 4426 |
Alt=false,% |
| 4427 |
Coeffs=3,% |
| 4428 |
Tension=0.5,% |
| 4429 |
StyleTrace={}% |
| 4430 |
} |
| 4431 |
|
| 4432 |
\NewDocumentCommand\TracerTransformee{ O{} m m m }{% |
| 4433 |
%#1 = clés |
| 4434 |
%#2 = objet : nom_fct (formule xint) OU liste spline OU liste interpo |
| 4435 |
%#3 = a (décalage horizontal : on trace f(x-a)+b) |
| 4436 |
%#4 = b (décalage vertical) |
| 4437 |
\restoreKV[GraphiqueTikzTransfo]% |
| 4438 |
\setKV[GraphiqueTikzTransfo]{#1}% |
| 4439 |
%--- |
| 4440 |
\ifboolKV[GraphiqueTikzTransfo]{Spline}% |
| 4441 |
{% |
| 4442 |
%---cas SPLINE : transformation géométrique des points de contrôle--- |
| 4443 |
\tkzg@transfo@spline{#2}{#3}{#4}% |
| 4444 |
% bifurcation [Alt] |
| 4445 |
\ifboolKV[GraphiqueTikzTransfo]{Alt}% |
| 4446 |
{% |
| 4447 |
\DefinirCourbeSpline% |
| 4448 |
[Alt,Trace,% |
| 4449 |
Couleur={\useKV[GraphiqueTikzTransfo]{Couleur}},% |
| 4450 |
Nom=\pflnametransfo,% |
| 4451 |
StyleTrace=\pflstyletransfo,% |
| 4452 |
Coeffs=\pflcoeffstransfo]% |
| 4453 |
{\TRFlistedecaleespline}% |
| 4454 |
}% |
| 4455 |
{% |
| 4456 |
\DefinirCourbeSpline% |
| 4457 |
[Trace,% |
| 4458 |
Couleur={\useKV[GraphiqueTikzTransfo]{Couleur}},% |
| 4459 |
Nom=\pflnametransfo,% |
| 4460 |
StyleTrace=\pflstyletransfo,% |
| 4461 |
Coeffs=\pflcoeffstransfo]% |
| 4462 |
{\TRFlistedecaleespline}% |
| 4463 |
}% |
| 4464 |
}% |
| 4465 |
{% |
| 4466 |
\ifboolKV[GraphiqueTikzTransfo]{Interpo}% |
| 4467 |
{% |
| 4468 |
%---cas INTERPO : décalage des points (xi+a, yi+b)--- |
| 4469 |
\tkzg@transfo@interpo{#2}{#3}{#4}% |
| 4470 |
\DefinirCourbeInterpo% |
| 4471 |
[Trace,% |
| 4472 |
Couleur={\useKV[GraphiqueTikzTransfo]{Couleur}},% |
| 4473 |
Nom=\pflnametransfo,% |
| 4474 |
StyleTrace=\pflstyletransfo,% |
| 4475 |
Tension=\pfltensiontransfo]% |
| 4476 |
{\TRFlistedecaleeinterpo}% |
| 4477 |
}% |
| 4478 |
{% |
| 4479 |
%---cas FORMULE xint : g(x) = f(x-a)+b--- |
| 4480 |
\IfStrEq{\pflsteptransfo}{}% |
| 4481 |
{% |
| 4482 |
\xdef\pflsteptransfo{\xintfloateval{% |
| 4483 |
((\useKV[GraphiqueTikzTransfo]{Fin})-% |
| 4484 |
(\useKV[GraphiqueTikzTransfo]{Debut}))/100}}% |
| 4485 |
}% |
| 4486 |
{}% |
| 4487 |
\xintdeffloatfunc pfltransfo(x) := #2(x-(#3))+(#4) ;% |
| 4488 |
\ifboolKV[GraphiqueTikzTransfo]{Clip}% |
| 4489 |
{\begin{scope}% |
| 4490 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}% |
| 4491 |
{}% |
| 4492 |
\IfEq{\pflnametransfo}{}% |
| 4493 |
{% |
| 4494 |
\draw[pflcourbe,\pflstyletransfo,% |
| 4495 |
{\useKV[GraphiqueTikzTransfo]{Couleur}}] |
| 4496 |
plot[smooth] coordinates {% |
| 4497 |
\xintthecoords\xintfloatexpr |
| 4498 |
seq((x, pfltransfo(x)), |
| 4499 |
x=\useKV[GraphiqueTikzTransfo]{Debut}% |
| 4500 |
..[\pflsteptransfo]..% |
| 4501 |
\useKV[GraphiqueTikzTransfo]{Fin},% |
| 4502 |
\useKV[GraphiqueTikzTransfo]{Fin}) |
| 4503 |
\relax |
| 4504 |
} ;% |
| 4505 |
}% |
| 4506 |
{% |
| 4507 |
\path[draw,pflcourbe,\pflstyletransfo,% |
| 4508 |
{\useKV[GraphiqueTikzTransfo]{Couleur}},% |
| 4509 |
name path global=\pflnametransfo] |
| 4510 |
plot[smooth] coordinates {% |
| 4511 |
\xintthecoords\xintfloatexpr |
| 4512 |
seq((x, pfltransfo(x)), |
| 4513 |
x=\useKV[GraphiqueTikzTransfo]{Debut}% |
| 4514 |
..[\pflsteptransfo]..% |
| 4515 |
\useKV[GraphiqueTikzTransfo]{Fin},% |
| 4516 |
\useKV[GraphiqueTikzTransfo]{Fin}) |
| 4517 |
\relax |
| 4518 |
} ;% |
| 4519 |
}% |
| 4520 |
\ifboolKV[GraphiqueTikzTransfo]{Clip}{\end{scope}}{}% |
| 4521 |
}% |
| 4522 |
}% |
| 4523 |
} |
| 4524 |
|
| 4525 |
\defKV[GraphiqueTikzReflexion]{% |
| 4526 |
Axe=\def\pflaxereflexion{#1},% |
| 4527 |
Nom=\def\pflnamereflexion{#1},% |
| 4528 |
StyleTrace=\def\pflstylereflexion{#1},% |
| 4529 |
Pas=\def\pflstepreflexion{#1},% |
| 4530 |
Coeffs=\def\pflcoeffsreflexion{#1},% |
| 4531 |
Tension=\def\pfltensiontransfo{#1} |
| 4532 |
} |
| 4533 |
|
| 4534 |
\setKVdefault[GraphiqueTikzReflexion]{% |
| 4535 |
Axe=x,% |
| 4536 |
Nom={},% |
| 4537 |
Couleur=black,% |
| 4538 |
Debut={\pflxmin},% |
| 4539 |
Fin={\pflxmax},% |
| 4540 |
Pas={},% |
| 4541 |
Clip=true,% |
| 4542 |
Spline=false,% |
| 4543 |
Interpo=false,% |
| 4544 |
Alt=false,% |
| 4545 |
Coeffs=3,% |
| 4546 |
Tension=0.5,% |
| 4547 |
StyleTrace={}% |
| 4548 |
} |
| 4549 |
|
| 4550 |
\NewDocumentCommand\TracerReflexion{ O{} m }{% |
| 4551 |
%#1 = clés |
| 4552 |
%#2 = objet : nom_fct (formule xint) OU liste spline OU liste interpo |
| 4553 |
\restoreKV[GraphiqueTikzReflexion]% |
| 4554 |
\setKV[GraphiqueTikzReflexion]{#1}% |
| 4555 |
%--- |
| 4556 |
\ifboolKV[GraphiqueTikzReflexion]{Spline}% |
| 4557 |
{% |
| 4558 |
%---cas SPLINE--- |
| 4559 |
\IfStrEq{\pflaxereflexion}{yx}% |
| 4560 |
{% |
| 4561 |
%---Axe=yx spline : symétrie via scope matriciel--- |
| 4562 |
% La matrice (0,1,1,0) échange x et y = symétrie par rapport à y=x |
| 4563 |
% Requiert des unités égales en x et y pour être visuellement correcte (test à faire ou pas ?) |
| 4564 |
\xintifboolexpr{abs(\xintfloateval{\pflyunit/\pflxunit} - 1) < 0.001}% |
| 4565 |
{}% |
| 4566 |
{% |
| 4567 |
\PackageWarning{tkz-grapheur}{Axe=yx+Spline : unites x et y differentes, rendu visuellement incorrect}% |
| 4568 |
}% |
| 4569 |
% #2 = liste spline originale, on génère le chemin dans \RFXcheminspline |
| 4570 |
\ifboolKV[GraphiqueTikzReflexion]{Alt}% |
| 4571 |
{\GenererSpline*{#2}{\pflcoeffsreflexion}[\RFXcheminspline]}% |
| 4572 |
{\GenererSpline{#2}{\pflcoeffsreflexion}[\RFXcheminspline]}% |
| 4573 |
\begin{scope}[cm={0,1,1,0,(0,0)}]% |
| 4574 |
\IfEq{\pflnamereflexion}{}% |
| 4575 |
{% |
| 4576 |
\draw[pflcourbe,\pflstylereflexion,{\useKV[GraphiqueTikzReflexion]{Couleur}}] \RFXcheminspline ;% |
| 4577 |
}% |
| 4578 |
{% |
| 4579 |
\path[draw,pflcourbe,\pflstylereflexion,{\useKV[GraphiqueTikzReflexion]{Couleur}},name path global=\pflnamereflexion] \RFXcheminspline ;% |
| 4580 |
}% |
| 4581 |
\end{scope}% |
| 4582 |
}% |
| 4583 |
{% |
| 4584 |
\tkzg@reflexion@spline{#2}{\pflaxereflexion}% |
| 4585 |
\ifboolKV[GraphiqueTikzReflexion]{Alt}% |
| 4586 |
{% |
| 4587 |
\DefinirCourbeSpline% |
| 4588 |
[Alt,Trace,% |
| 4589 |
Couleur={\useKV[GraphiqueTikzReflexion]{Couleur}},% |
| 4590 |
Nom=\pflnamereflexion,% |
| 4591 |
StyleTrace=\pflstylereflexion,% |
| 4592 |
Coeffs=\pflcoeffsreflexion]% |
| 4593 |
{\RFXlistedecaleespline}% |
| 4594 |
}% |
| 4595 |
{% |
| 4596 |
\DefinirCourbeSpline% |
| 4597 |
[Trace,% |
| 4598 |
Couleur={\useKV[GraphiqueTikzReflexion]{Couleur}},% |
| 4599 |
Nom=\pflnamereflexion,% |
| 4600 |
StyleTrace=\pflstylereflexion,% |
| 4601 |
Coeffs=\pflcoeffsreflexion]% |
| 4602 |
{\RFXlistedecaleespline}% |
| 4603 |
}% |
| 4604 |
}% |
| 4605 |
}% |
| 4606 |
{% |
| 4607 |
\ifboolKV[GraphiqueTikzReflexion]{Interpo}% |
| 4608 |
{% |
| 4609 |
%---cas INTERPO--- |
| 4610 |
\tkzg@reflexion@interpo{#2}{\pflaxereflexion}% |
| 4611 |
\DefinirCourbeInterpo% |
| 4612 |
[Trace,% |
| 4613 |
Couleur={\useKV[GraphiqueTikzReflexion]{Couleur}},% |
| 4614 |
Nom=\pflnamereflexion,% |
| 4615 |
StyleTrace=\pflstylereflexion,% |
| 4616 |
Tension=\pfltensiontransfo]% |
| 4617 |
{\RFXlistedecaleeinterpo}% |
| 4618 |
}% |
| 4619 |
{% |
| 4620 |
%---cas FORMULE xint--- |
| 4621 |
\IfStrEq{\pflstepreflexion}{}% |
| 4622 |
{% |
| 4623 |
\xdef\pflstepreflexion{\xintfloateval{% |
| 4624 |
((\useKV[GraphiqueTikzReflexion]{Fin})-% |
| 4625 |
(\useKV[GraphiqueTikzReflexion]{Debut}))/100}}% |
| 4626 |
}% |
| 4627 |
{}% |
| 4628 |
\IfStrEqCase{\pflaxereflexion}{% |
| 4629 |
{x}{% |
| 4630 |
% -f(x) : on définit g(x) = -f(x) |
| 4631 |
\xintdeffloatfunc pflreflexion(x) := -(#2(x)) ;% |
| 4632 |
}% |
| 4633 |
{y}{% |
| 4634 |
% f(-x) : on définit g(x) = f(-x) |
| 4635 |
\xintdeffloatfunc pflreflexion(x) := #2(-(x)) ;% |
| 4636 |
}% |
| 4637 |
{yx}{% |
| 4638 |
% |
| 4639 |
}% |
| 4640 |
}% |
| 4641 |
\ifboolKV[GraphiqueTikzReflexion]{Clip}% |
| 4642 |
{\begin{scope}% |
| 4643 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}% |
| 4644 |
{}% |
| 4645 |
\IfStrEq{\pflaxereflexion}{yx}% |
| 4646 |
{% |
| 4647 |
%---cas yx : courbe paramétrique (f(t), t)--- |
| 4648 |
\IfEq{\pflnamereflexion}{}% |
| 4649 |
{% |
| 4650 |
\draw[pflcourbe,\pflstylereflexion,% |
| 4651 |
{\useKV[GraphiqueTikzReflexion]{Couleur}}] |
| 4652 |
plot[smooth] coordinates {% |
| 4653 |
\xintthecoords\xintfloatexpr |
| 4654 |
seq((#2(t), t), |
| 4655 |
t=\useKV[GraphiqueTikzReflexion]{Debut}% |
| 4656 |
..[\pflstepreflexion]..% |
| 4657 |
\useKV[GraphiqueTikzReflexion]{Fin},% |
| 4658 |
\useKV[GraphiqueTikzReflexion]{Fin}) |
| 4659 |
\relax |
| 4660 |
} ;% |
| 4661 |
}% |
| 4662 |
{% |
| 4663 |
\path[draw,pflcourbe,\pflstylereflexion,% |
| 4664 |
{\useKV[GraphiqueTikzReflexion]{Couleur}},% |
| 4665 |
name path global=\pflnamereflexion] |
| 4666 |
plot[smooth] coordinates {% |
| 4667 |
\xintthecoords\xintfloatexpr |
| 4668 |
seq((#2(t), t), |
| 4669 |
t=\useKV[GraphiqueTikzReflexion]{Debut}% |
| 4670 |
..[\pflstepreflexion]..% |
| 4671 |
\useKV[GraphiqueTikzReflexion]{Fin},% |
| 4672 |
\useKV[GraphiqueTikzReflexion]{Fin}) |
| 4673 |
\relax |
| 4674 |
} ;% |
| 4675 |
}% |
| 4676 |
}% |
| 4677 |
{% |
| 4678 |
%---cas x et y : tracé classique de pflreflexion--- |
| 4679 |
\IfEq{\pflnamereflexion}{}% |
| 4680 |
{% |
| 4681 |
\draw[pflcourbe,\pflstylereflexion,% |
| 4682 |
{\useKV[GraphiqueTikzReflexion]{Couleur}}] |
| 4683 |
plot[smooth] coordinates {% |
| 4684 |
\xintthecoords\xintfloatexpr |
| 4685 |
seq((x, pflreflexion(x)), |
| 4686 |
x=\useKV[GraphiqueTikzReflexion]{Debut}% |
| 4687 |
..[\pflstepreflexion]..% |
| 4688 |
\useKV[GraphiqueTikzReflexion]{Fin},% |
| 4689 |
\useKV[GraphiqueTikzReflexion]{Fin}) |
| 4690 |
\relax |
| 4691 |
} ;% |
| 4692 |
}% |
| 4693 |
{% |
| 4694 |
\path[draw,pflcourbe,\pflstylereflexion,% |
| 4695 |
{\useKV[GraphiqueTikzReflexion]{Couleur}},% |
| 4696 |
name path global=\pflnamereflexion] |
| 4697 |
plot[smooth] coordinates {% |
| 4698 |
\xintthecoords\xintfloatexpr |
| 4699 |
seq((x, pflreflexion(x)), |
| 4700 |
x=\useKV[GraphiqueTikzReflexion]{Debut}% |
| 4701 |
..[\pflstepreflexion]..% |
| 4702 |
\useKV[GraphiqueTikzReflexion]{Fin},% |
| 4703 |
\useKV[GraphiqueTikzReflexion]{Fin}) |
| 4704 |
\relax |
| 4705 |
} ;% |
| 4706 |
}% |
| 4707 |
}% |
| 4708 |
\ifboolKV[GraphiqueTikzReflexion]{Clip}{\end{scope}}{}% |
| 4709 |
}% |
| 4710 |
}% |
| 4711 |
} |
| 4712 |
|
| 4713 |
%====POLYNÔME DE TAYLOR / MACLAURIN |
| 4714 |
\defKV[GraphiqueTikzTaylor]{% |
| 4715 |
Ordre=\def\pfltaylorordre{#1},% |
| 4716 |
h=\def\pfltaylorh{#1},% |
| 4717 |
Nom=\def\pfltaylornom{#1},% |
| 4718 |
StyleTrace=\def\pfltaylorstyle{#1},% |
| 4719 |
Pas=\def\pfltaylorpas{#1}% |
| 4720 |
} |
| 4721 |
|
| 4722 |
\setKVdefault[GraphiqueTikzTaylor]{% |
| 4723 |
Ordre=5,% |
| 4724 |
h=0.01,% |
| 4725 |
Couleur=black,% |
| 4726 |
Debut={\pflxmin},% |
| 4727 |
Fin={\pflxmax},% |
| 4728 |
Pas={},% |
| 4729 |
Clip=true,% |
| 4730 |
Trace=false,% |
| 4731 |
Nom={},% |
| 4732 |
StyleTrace={}% |
| 4733 |
} |
| 4734 |
|
| 4735 |
\NewDocumentCommand\DefinirTaylor{ O{} D<>{taylorN} m m }{% |
| 4736 |
%#1 = clés |
| 4737 |
%#2 = nom de la fonction Taylor (pour réutilisation) |
| 4738 |
%#3 = nom de la fonction xint originale |
| 4739 |
%#4 = point de développement a |
| 4740 |
\restoreKV[GraphiqueTikzTaylor]% |
| 4741 |
\setKV[GraphiqueTikzTaylor]{#1}% |
| 4742 |
% calcul du pas de tracé si non fourni |
| 4743 |
\IfStrEq{\pfltaylorpas}{}% |
| 4744 |
{% |
| 4745 |
\xdef\pfltaylorpas{\xintfloateval{% |
| 4746 |
((\useKV[GraphiqueTikzTaylor]{Fin})-(\useKV[GraphiqueTikzTaylor]{Debut}))/100}}% |
| 4747 |
}% |
| 4748 |
{}% |
| 4749 |
% construction du polynôme |
| 4750 |
\tkzg@taylor@build{#3}{\pfltaylorordre}{#4}{\pfltaylorh}% |
| 4751 |
% on nomme la fonction pour réutilisation |
| 4752 |
\xintdeffloatfunc #2(x) := pfltaylorpoly(x) ;% |
| 4753 |
% tracé conditionnel |
| 4754 |
\ifboolKV[GraphiqueTikzTaylor]{Clip}% |
| 4755 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}% |
| 4756 |
{}% |
| 4757 |
\ifboolKV[GraphiqueTikzTaylor]{Trace}% |
| 4758 |
{% |
| 4759 |
\IfEq{\pfltaylornom}{}% |
| 4760 |
{% |
| 4761 |
\draw[pflcourbe,\pfltaylorstyle,{\useKV[GraphiqueTikzTaylor]{Couleur}}] |
| 4762 |
plot[smooth] coordinates {% |
| 4763 |
\xintthecoords\xintfloatexpr |
| 4764 |
seq((x, min(max(pfltaylorpoly(x),\pflMinoffsetV),\pflMaxoffsetV)), |
| 4765 |
x=\useKV[GraphiqueTikzTaylor]{Debut}% |
| 4766 |
..[\pfltaylorpas]..% |
| 4767 |
\useKV[GraphiqueTikzTaylor]{Fin},% |
| 4768 |
\useKV[GraphiqueTikzTaylor]{Fin}) |
| 4769 |
\relax |
| 4770 |
} ;% |
| 4771 |
}% |
| 4772 |
{% |
| 4773 |
\path[draw,pflcourbe,\pfltaylorstyle,% |
| 4774 |
{\useKV[GraphiqueTikzTaylor]{Couleur}},% |
| 4775 |
name path global=\pfltaylornom] |
| 4776 |
plot[smooth] coordinates {% |
| 4777 |
\xintthecoords\xintfloatexpr |
| 4778 |
seq((x, min(max(pfltaylorpoly(x),\pflMinoffsetV),\pflMaxoffsetV)), |
| 4779 |
x=\useKV[GraphiqueTikzTaylor]{Debut}% |
| 4780 |
..[\pfltaylorpas]..% |
| 4781 |
\useKV[GraphiqueTikzTaylor]{Fin},% |
| 4782 |
\useKV[GraphiqueTikzTaylor]{Fin}) |
| 4783 |
\relax |
| 4784 |
} ;% |
| 4785 |
}% |
| 4786 |
}% |
| 4787 |
{% |
| 4788 |
% pas de tracé mais path nommé si Nom= fourni |
| 4789 |
\IfEq{\pfltaylornom}{}% |
| 4790 |
{}% |
| 4791 |
{% |
| 4792 |
\path[draw=none,pflcourbe,name path global=\pfltaylornom] |
| 4793 |
plot[smooth] coordinates {% |
| 4794 |
\xintthecoords\xintfloatexpr |
| 4795 |
seq((x, min(max(pfltaylorpoly(x),\pflMinoffsetV),\pflMaxoffsetV)), |
| 4796 |
x=\useKV[GraphiqueTikzTaylor]{Debut}% |
| 4797 |
..[\pfltaylorpas]..% |
| 4798 |
\useKV[GraphiqueTikzTaylor]{Fin},% |
| 4799 |
\useKV[GraphiqueTikzTaylor]{Fin}) |
| 4800 |
\relax |
| 4801 |
} ;% |
| 4802 |
}% |
| 4803 |
}% |
| 4804 |
\ifboolKV[GraphiqueTikzTaylor]{Clip}{\end{scope}}{}% |
| 4805 |
} |
| 4806 |
|
| 4807 |
%---commande \TracerTaylor |
| 4808 |
\NewDocumentCommand\TracerTaylor{ O{} m m }{% |
| 4809 |
%#1 = clés |
| 4810 |
%#2 = nom de la fonction xint originale |
| 4811 |
%#3 = point de développement a |
| 4812 |
\restoreKV[GraphiqueTikzTaylor]% |
| 4813 |
\setKV[GraphiqueTikzTaylor]{#1}% |
| 4814 |
% calcul du pas de tracé si non fourni |
| 4815 |
\IfStrEq{\pfltaylorpas}{}% |
| 4816 |
{% |
| 4817 |
\xdef\pfltaylorpas{\xintfloateval{% |
| 4818 |
((\useKV[GraphiqueTikzTaylor]{Fin})-(\useKV[GraphiqueTikzTaylor]{Debut}))/100}}% |
| 4819 |
}% |
| 4820 |
{}% |
| 4821 |
% construction du polynôme |
| 4822 |
\tkzg@taylor@build{#2}{\pfltaylorordre}{#3}{\pfltaylorh}% |
| 4823 |
% tracé |
| 4824 |
\ifboolKV[GraphiqueTikzTaylor]{Clip}% |
| 4825 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}% |
| 4826 |
{}% |
| 4827 |
\IfEq{\pfltaylornom}{}% |
| 4828 |
{% |
| 4829 |
\draw[pflcourbe,\pfltaylorstyle,{\useKV[GraphiqueTikzTaylor]{Couleur}}] |
| 4830 |
plot[smooth] coordinates {% |
| 4831 |
\xintthecoords\xintfloatexpr |
| 4832 |
seq((x, min(max(pfltaylorpoly(x),\pflMinoffsetV),\pflMaxoffsetV)), |
| 4833 |
x=\useKV[GraphiqueTikzTaylor]{Debut}% |
| 4834 |
..[\pfltaylorpas]..% |
| 4835 |
\useKV[GraphiqueTikzTaylor]{Fin},% |
| 4836 |
\useKV[GraphiqueTikzTaylor]{Fin}) |
| 4837 |
\relax |
| 4838 |
} ;% |
| 4839 |
}% |
| 4840 |
{% |
| 4841 |
\path[draw,pflcourbe,\pfltaylorstyle,% |
| 4842 |
{\useKV[GraphiqueTikzTaylor]{Couleur}},% |
| 4843 |
name path global=\pfltaylornom] |
| 4844 |
plot[smooth] coordinates {% |
| 4845 |
\xintthecoords\xintfloatexpr |
| 4846 |
seq((x, min(max(pfltaylorpoly(x),\pflMinoffsetV),\pflMaxoffsetV)), |
| 4847 |
x=\useKV[GraphiqueTikzTaylor]{Debut}% |
| 4848 |
..[\pfltaylorpas]..% |
| 4849 |
\useKV[GraphiqueTikzTaylor]{Fin},% |
| 4850 |
\useKV[GraphiqueTikzTaylor]{Fin}) |
| 4851 |
\relax |
| 4852 |
} ;% |
| 4853 |
}% |
| 4854 |
\ifboolKV[GraphiqueTikzTaylor]{Clip}{\end{scope}}{}% |
| 4855 |
} |
| 4856 |
|
| 4857 |
%====LOI EXPO |
| 4858 |
\defKV[GraphiqueTikzLoiProbasCont]{% |
| 4859 |
Pas=\def\pflloiprobastep{#1},% |
| 4860 |
Nom=\def\pflloiprobaname{#1} |
| 4861 |
} |
| 4862 |
|
| 4863 |
\setKVdefault[GraphiqueTikzLoiProbasCont]{% |
| 4864 |
Nom=densite,% |
| 4865 |
Couleur=black,% |
| 4866 |
Trace=false,% |
| 4867 |
Pas={},% |
| 4868 |
Debut={\pflxmin},% |
| 4869 |
Fin={\pflxmax} |
| 4870 |
} |
| 4871 |
|
| 4872 |
\NewDocumentCommand\DefinirLoiExponentielle{ O{} D<>{fdexpo} m }{% |
| 4873 |
%1=options |
| 4874 |
%2=mu |
| 4875 |
%3=sigma |
| 4876 |
\restoreKV[GraphiqueTikzLoiProbasCont]% |
| 4877 |
\setKV[GraphiqueTikzLoiProbasCont]{#1}% |
| 4878 |
\xintdeffloatfunc #2(x) := (#3)*exp(-(#3)*x) ;% |
| 4879 |
\IfStrEq{\pflloiprobastep}{}% |
| 4880 |
{% |
| 4881 |
\xdef\pflloiprobastep{\xintfloateval{((\useKV[GraphiqueTikzLoiProbasCont]{Fin})-(\useKV[GraphiqueTikzLoiProbasCont]{Debut}))/100}}% |
| 4882 |
}% |
| 4883 |
{}% |
| 4884 |
\begin{scope} |
| 4885 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 4886 |
\ifboolKV[GraphiqueTikzLoiProbasCont]{Trace}% |
| 4887 |
{% |
| 4888 |
\path[draw,pflcourbe,{\useKV[GraphiqueTikzLoiProbasCont]{Couleur}},name path global=\pflloiprobaname] plot[smooth] coordinates {% |
| 4889 |
\xintthecoords\xintfloatexpr |
| 4890 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzLoiProbasCont]{Debut}}..[\pflloiprobastep]..{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 4891 |
\relax |
| 4892 |
} ; |
| 4893 |
}% |
| 4894 |
{% |
| 4895 |
\path[draw=none,pflcourbe,name path global=\pflloiprobaname] plot[smooth] coordinates {% |
| 4896 |
\xintthecoords\xintfloatexpr |
| 4897 |
seq((x,#2(x)),x={\useKV[GraphiqueTikzLoiProbasCont]{Debut}}..[\pflloiprobastep]..{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 4898 |
\relax |
| 4899 |
} ; |
| 4900 |
}% |
| 4901 |
\end{scope} |
| 4902 |
} |
| 4903 |
|
| 4904 |
\NewDocumentCommand\TracerLoiExponentielle{ O{} m }{% |
| 4905 |
%1=options |
| 4906 |
%2=mu |
| 4907 |
%3=sigma |
| 4908 |
\restoreKV[GraphiqueTikzLoiProbasCont]% |
| 4909 |
\setKV[GraphiqueTikzLoiProbasCont]{#1}% |
| 4910 |
\IfStrEq{\pflloiprobastep}{}% |
| 4911 |
{% |
| 4912 |
\xdef\pflloiprobastep{\xintfloateval{((\useKV[GraphiqueTikzLoiProbasCont]{Fin})-(\useKV[GraphiqueTikzLoiProbasCont]{Debut}))/100}}% |
| 4913 |
}% |
| 4914 |
{}% |
| 4915 |
\begin{scope} |
| 4916 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 4917 |
\draw[pflcourbe,{\useKV[GraphiqueTikzLoiProbasCont]{Couleur}}] plot[smooth] coordinates {% |
| 4918 |
\xintthecoords\xintfloatexpr |
| 4919 |
seq((x,#2),x={\useKV[GraphiqueTikzLoiProbasCont]{Debut}}..[\pflloiprobastep]..{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 4920 |
\relax |
| 4921 |
} ; |
| 4922 |
\end{scope} |
| 4923 |
} |
| 4924 |
|
| 4925 |
%====LOI DE STUDENT |
| 4926 |
% f(x) = Γ((ν+1)/2) / (√(νπ)·Γ(ν/2)) · (1+x²/ν)^(-(ν+1)/2) |
| 4927 |
% #2 = nom fonction xint #3 = ν (degrés de liberté) |
| 4928 |
\NewDocumentCommand\DefinirLoiStudent{ O{} D<>{fdstudent} m }{% |
| 4929 |
%#1=options #2=nom fonction #3=ν |
| 4930 |
\restoreKV[GraphiqueTikzLoiProbasCont]% |
| 4931 |
\setKV[GraphiqueTikzLoiProbasCont]{#1}% |
| 4932 |
\xintdeffloatfunc #2(x) := |
| 4933 |
pflgamma((#3+1)/2) / (sqrt((#3)*pi)*pflgamma((#3)/2)) |
| 4934 |
* (1+(x)^2/(#3))^(-((#3+1)/2)) ;% |
| 4935 |
\IfStrEq{\pflloiprobastep}{}% |
| 4936 |
{% |
| 4937 |
\xdef\pflloiprobastep{\xintfloateval{% |
| 4938 |
((\useKV[GraphiqueTikzLoiProbasCont]{Fin})-(\useKV[GraphiqueTikzLoiProbasCont]{Debut}))/100}}% |
| 4939 |
}{}% |
| 4940 |
\begin{scope} |
| 4941 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 4942 |
\ifboolKV[GraphiqueTikzLoiProbasCont]{Trace}% |
| 4943 |
{% |
| 4944 |
\path[draw,pflcourbe,{\useKV[GraphiqueTikzLoiProbasCont]{Couleur}},name path global=\pflloiprobaname] |
| 4945 |
plot[smooth] coordinates {% |
| 4946 |
\xintthecoords\xintfloatexpr |
| 4947 |
seq((x,#2(x)), |
| 4948 |
x={\useKV[GraphiqueTikzLoiProbasCont]{Debut}}% |
| 4949 |
..[\pflloiprobastep]..% |
| 4950 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},% |
| 4951 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 4952 |
\relax |
| 4953 |
} ; |
| 4954 |
}% |
| 4955 |
{% |
| 4956 |
\path[draw=none,pflcourbe,name path global=\pflloiprobaname] |
| 4957 |
plot[smooth] coordinates {% |
| 4958 |
\xintthecoords\xintfloatexpr |
| 4959 |
seq((x,#2(x)), |
| 4960 |
x={\useKV[GraphiqueTikzLoiProbasCont]{Debut}}% |
| 4961 |
..[\pflloiprobastep]..% |
| 4962 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},% |
| 4963 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 4964 |
\relax |
| 4965 |
} ; |
| 4966 |
}% |
| 4967 |
\end{scope} |
| 4968 |
} |
| 4969 |
|
| 4970 |
\NewDocumentCommand\TracerLoiStudent{ O{} m }{% |
| 4971 |
%#1=options #2=nom fonction xint (définie par \DefinirLoiStudent) |
| 4972 |
\restoreKV[GraphiqueTikzLoiProbasCont]% |
| 4973 |
\setKV[GraphiqueTikzLoiProbasCont]{#1}% |
| 4974 |
\IfStrEq{\pflloiprobastep}{}% |
| 4975 |
{% |
| 4976 |
\xdef\pflloiprobastep{\xintfloateval{% |
| 4977 |
((\useKV[GraphiqueTikzLoiProbasCont]{Fin})-(\useKV[GraphiqueTikzLoiProbasCont]{Debut}))/100}}% |
| 4978 |
}{}% |
| 4979 |
\begin{scope} |
| 4980 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 4981 |
\draw[pflcourbe,{\useKV[GraphiqueTikzLoiProbasCont]{Couleur}}] |
| 4982 |
plot[smooth] coordinates {% |
| 4983 |
\xintthecoords\xintfloatexpr |
| 4984 |
seq((x,#2), |
| 4985 |
x={\useKV[GraphiqueTikzLoiProbasCont]{Debut}}% |
| 4986 |
..[\pflloiprobastep]..% |
| 4987 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},% |
| 4988 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 4989 |
\relax |
| 4990 |
} ; |
| 4991 |
\end{scope} |
| 4992 |
} |
| 4993 |
|
| 4994 |
%====LOI DE FISCHER (F de Snedecor) |
| 4995 |
% f(x) = Γ((d1+d2)/2)/(Γ(d1/2)·Γ(d2/2)) · (d1/d2)^(d1/2) · x^(d1/2-1) · (1+d1·x/d2)^(-(d1+d2)/2) |
| 4996 |
% définie pour x > 0 → penser à mettre Debut=0.001 |
| 4997 |
% #3 = d1, #4 = d2 (degrés de liberté) |
| 4998 |
\NewDocumentCommand\DefinirLoiFischer{ O{} D<>{fdfischer} m m }{% |
| 4999 |
%#1=options #2=nom fonction #3=d1 #4=d2 |
| 5000 |
\restoreKV[GraphiqueTikzLoiProbasCont]% |
| 5001 |
\setKV[GraphiqueTikzLoiProbasCont]{#1}% |
| 5002 |
\xintdeffloatfunc #2(x) := |
| 5003 |
(pflgamma((#3+(#4))/2)/(pflgamma((#3)/2)*pflgamma((#4)/2))) |
| 5004 |
* ((#3)/(#4))^((#3)/2) * (x)^((#3)/2-1) |
| 5005 |
* (1+(#3)*(x)/(#4))^(-((#3+(#4))/2)) ;% |
| 5006 |
\IfStrEq{\pflloiprobastep}{}% |
| 5007 |
{% |
| 5008 |
\xdef\pflloiprobastep{\xintfloateval{% |
| 5009 |
((\useKV[GraphiqueTikzLoiProbasCont]{Fin})-(\useKV[GraphiqueTikzLoiProbasCont]{Debut}))/100}}% |
| 5010 |
}{}% |
| 5011 |
\xdef\tmpminloifischer{\xintfloateval{max(0.001,\useKV[GraphiqueTikzLoiProbasCont]{Debut})}}% |
| 5012 |
\begin{scope} |
| 5013 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 5014 |
\ifboolKV[GraphiqueTikzLoiProbasCont]{Trace}% |
| 5015 |
{% |
| 5016 |
\path[draw,pflcourbe,{\useKV[GraphiqueTikzLoiProbasCont]{Couleur}},name path global=\pflloiprobaname] |
| 5017 |
plot[smooth] coordinates {% |
| 5018 |
\xintthecoords\xintfloatexpr |
| 5019 |
seq((x,#2(x)), |
| 5020 |
x={\tmpminloifischer}% |
| 5021 |
..[\pflloiprobastep]..% |
| 5022 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},% |
| 5023 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 5024 |
\relax |
| 5025 |
} ; |
| 5026 |
}% |
| 5027 |
{% |
| 5028 |
\path[draw=none,pflcourbe,name path global=\pflloiprobaname] |
| 5029 |
plot[smooth] coordinates {% |
| 5030 |
\xintthecoords\xintfloatexpr |
| 5031 |
seq((x,#2(x)), |
| 5032 |
x={\tmpminloifischer}% |
| 5033 |
..[\pflloiprobastep]..% |
| 5034 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},% |
| 5035 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 5036 |
\relax |
| 5037 |
} ; |
| 5038 |
}% |
| 5039 |
\end{scope} |
| 5040 |
} |
| 5041 |
|
| 5042 |
\NewDocumentCommand\TracerLoiFischer{ O{} m }{% |
| 5043 |
%#1=options #2=nom fonction xint (définie par \DefinirLoiFischer) |
| 5044 |
\restoreKV[GraphiqueTikzLoiProbasCont]% |
| 5045 |
\setKV[GraphiqueTikzLoiProbasCont]{#1}% |
| 5046 |
\IfStrEq{\pflloiprobastep}{}% |
| 5047 |
{% |
| 5048 |
\xdef\pflloiprobastep{\xintfloateval{% |
| 5049 |
((\useKV[GraphiqueTikzLoiProbasCont]{Fin})-(\useKV[GraphiqueTikzLoiProbasCont]{Debut}))/100}}% |
| 5050 |
}{}% |
| 5051 |
\xdef\tmpminloifischer{\xintfloateval{max(0.001,\useKV[GraphiqueTikzLoiProbasCont]{Debut})}}% |
| 5052 |
\begin{scope} |
| 5053 |
\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}); |
| 5054 |
\draw[pflcourbe,{\useKV[GraphiqueTikzLoiProbasCont]{Couleur}}] |
| 5055 |
plot[smooth] coordinates {% |
| 5056 |
\xintthecoords\xintfloatexpr |
| 5057 |
seq((x,#2), |
| 5058 |
x={\tmpminloifischer}% |
| 5059 |
..[\pflloiprobastep]..% |
| 5060 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}},% |
| 5061 |
{\useKV[GraphiqueTikzLoiProbasCont]{Fin}}) |
| 5062 |
\relax |
| 5063 |
} ; |
| 5064 |
\end{scope} |
| 5065 |
} |
| 5066 |
%alias intégrale--proba ;-) |
| 5067 |
\NewCommandCopy\RepresenterProbaContinue\TracerIntegrale |
| 5068 |
|
| 5069 |
%====HISTO POISSON |
| 5070 |
% P(X=k) = e^(-λ) * λ^k / k! |
| 5071 |
% #3 = λ (paramètre), k = 0,1,2,... |
| 5072 |
\defKV[tkzHistoPoisson]{% |
| 5073 |
CouleurTraits=\def\tkzGraphPoissonColTraits{#1},% |
| 5074 |
Plage=\def\tkzGraphPoissonPlage{#1},% |
| 5075 |
CouleurPlage=\def\tkzGraphPoissonColPlage{#1},% |
| 5076 |
ClipX=\def\tkzGraphPoissonXminmax{#1},% |
| 5077 |
CouleurNormale=\def\tkzGraphPoissonColNorm{#1},% |
| 5078 |
Nmax=\def\tkzGraphPoissonNmax{#1},% |
| 5079 |
Style=\def\tkzGraphPoissonStyle{#1} |
| 5080 |
} |
| 5081 |
\setKVdefault[tkzHistoPoisson]{% |
| 5082 |
CouleurTraits=black,% |
| 5083 |
Plage={},% |
| 5084 |
CouleurPlage=black,% |
| 5085 |
ClipX={},% |
| 5086 |
AffNormale=false,% |
| 5087 |
CouleurNormale=black,% |
| 5088 |
Nmax={},% |
| 5089 |
Style=histo |
| 5090 |
} |
| 5091 |
\NewDocumentCommand\TracerLoiPoisson{ O{} D<>{phipoisson} m }{% |
| 5092 |
% #1=clés #2=nom courbe normale approx #3=λ |
| 5093 |
\restoreKV[tkzHistoPoisson]% |
| 5094 |
\setKV[tkzHistoPoisson]{#1}% |
| 5095 |
\def\tkzGraphPoissonL{#3}% |
| 5096 |
% Nmax auto si non fourni : on prend λ + 4√λ arrondi |
| 5097 |
\IfStrEq{\tkzGraphPoissonNmax}{}% |
| 5098 |
{\xdef\tkzGraphPoissonNmax{\xinttheexpr round(#3+4*sqrt(#3))\relax}}% |
| 5099 |
{}% |
| 5100 |
% bornes d'affichage |
| 5101 |
\IfStrEq{\tkzGraphPoissonXminmax}{}% |
| 5102 |
{% |
| 5103 |
\xdef\tkzGraphPoissonXmin{0}% |
| 5104 |
\xdef\tkzGraphPoissonXmax{\tkzGraphPoissonNmax}% |
| 5105 |
}% |
| 5106 |
{% |
| 5107 |
\StrCut{\tkzGraphPoissonXminmax}{-}{\tkzGraphPoissonXmin}{\tkzGraphPoissonXmax}% |
| 5108 |
\IfStrEq{\tkzGraphPoissonXmin}{*}{\xdef\tkzGraphPoissonXmin{0}}{}% |
| 5109 |
\IfStrEq{\tkzGraphPoissonXmax}{*}{\xdef\tkzGraphPoissonXmax{\tkzGraphPoissonNmax}}{}% |
| 5110 |
}% |
| 5111 |
% bornes de coloriage |
| 5112 |
\IfStrEq{\tkzGraphPoissonPlage}{}% |
| 5113 |
{}% |
| 5114 |
{% |
| 5115 |
\StrCut{\tkzGraphPoissonPlage}{-}{\tkzGraphPoissonColorMin}{\tkzGraphPoissonColorMax}% |
| 5116 |
\IfStrEq{\tkzGraphPoissonColorMin}{*}{\xdef\tkzGraphPoissonColorMin{\tkzGraphPoissonXmin}}{}% |
| 5117 |
\IfStrEq{\tkzGraphPoissonColorMax}{*}{\xdef\tkzGraphPoissonColorMax{\tkzGraphPoissonXmax}}{}% |
| 5118 |
}% |
| 5119 |
% coloriage éventuel |
| 5120 |
\IfStrEq{\tkzGraphPoissonPlage}{}% |
| 5121 |
{}% |
| 5122 |
{% |
| 5123 |
\xintFor* ##1 in {\xintSeq{\tkzGraphPoissonColorMin}{\tkzGraphPoissonColorMax}}\do{% |
| 5124 |
\xdef\tkztmpYYY{\xintfloateval{exp(-(#3))*(#3)^(##1)/factorial(##1)}}% |
| 5125 |
% |
| 5126 |
\IfStrEq{\tkzGraphPoissonStyle}{batons}% |
| 5127 |
{% |
| 5128 |
\draw[pflbarresprobas,\tkzGraphPoissonColPlage] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5129 |
|
| 5130 |
}% |
| 5131 |
{% |
| 5132 |
\draw[draw=none,fill=\tkzGraphPoissonColPlage,fill opacity=0.5] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5133 |
}% |
| 5134 |
% |
| 5135 |
}% |
| 5136 |
}% |
| 5137 |
% tracé |
| 5138 |
\xintFor* ##1 in {\xintSeq{\tkzGraphPoissonXmin}{\tkzGraphPoissonXmax}}\do{% |
| 5139 |
\xdef\tkztmpYYY{\xintfloateval{exp(-(#3))*(#3)^(##1)/factorial(##1)}}% |
| 5140 |
\IfStrEq{\tkzGraphPoissonStyle}{batons}% |
| 5141 |
{% |
| 5142 |
\IfStrEq{\tkzGraphPoissonPlage}{}%si plage, on colorie tout |
| 5143 |
{% |
| 5144 |
\draw[pflbarresprobas,\tkzGraphPoissonColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5145 |
}% |
| 5146 |
{% |
| 5147 |
\xintifboolexpr{\tkzGraphPoissonColorMin <= ##1 <= \tkzGraphPoissonColorMax}% |
| 5148 |
{}% |
| 5149 |
{% |
| 5150 |
\draw[pflbarresprobas,\tkzGraphPoissonColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5151 |
}% |
| 5152 |
}% |
| 5153 |
}% |
| 5154 |
{% |
| 5155 |
\draw[pfltrait,\tkzGraphPoissonColTraits] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5156 |
}% |
| 5157 |
}% |
| 5158 |
% approximation normale : N(λ, √λ) (why not !) |
| 5159 |
\ifboolKV[tkzHistoPoisson]{AffNormale}% |
| 5160 |
{% |
| 5161 |
\xdef\tkzMinNormHistoPoisson{\xintfloateval{\tkzGraphPoissonXmin-0.5}}% |
| 5162 |
\xdef\tkzMaxNormHistoPoisson{\xintfloateval{\tkzGraphPoissonXmax+0.5}}% |
| 5163 |
\xdef\tkzEsperNorm{\xintfloateval{#3}}% |
| 5164 |
\xdef\tkzVarNorm{\xintfloateval{sqrt(#3)}}% |
| 5165 |
\DefinirLoiNormale[Trace,Couleur=\tkzGraphPoissonColNorm,pflcourbe,% |
| 5166 |
Debut=\tkzMinNormHistoPoisson,Fin=\tkzMaxNormHistoPoisson]% |
| 5167 |
<#2>{\tkzEsperNorm}{\tkzVarNorm}% |
| 5168 |
}% |
| 5169 |
{}% |
| 5170 |
} |
| 5171 |
|
| 5172 |
%====HISTO HYPERGÉOMÉTRIQUE |
| 5173 |
% P(X=k) = C(K,k)*C(N-K,n-k) / C(N,n) |
| 5174 |
% #3=N (population totale) #4=K (succès dans population) #5=n (taille tirage) |
| 5175 |
% k varie de max(0,n+K-N) à min(n,K) |
| 5176 |
\defKV[tkzHistoHyperGeo]{% |
| 5177 |
CouleurTraits=\def\tkzGraphHyperColTraits{#1},% |
| 5178 |
Plage=\def\tkzGraphHyperPlage{#1},% |
| 5179 |
CouleurPlage=\def\tkzGraphHyperColPlage{#1},% |
| 5180 |
ClipX=\def\tkzGraphHyperXminmax{#1},% |
| 5181 |
CouleurNormale=\def\tkzGraphHyperColNorm{#1},% |
| 5182 |
Style=\def\tkzGraphHyperStyle{#1} |
| 5183 |
} |
| 5184 |
\setKVdefault[tkzHistoHyperGeo]{% |
| 5185 |
CouleurTraits=black,% |
| 5186 |
Plage={},% |
| 5187 |
CouleurPlage=black,% |
| 5188 |
ClipX={},% |
| 5189 |
AffNormale=false,% |
| 5190 |
CouleurNormale=black,% |
| 5191 |
Style=histo |
| 5192 |
} |
| 5193 |
\NewDocumentCommand\TracerLoiHyperGeo{ O{} D<>{phihypergeo} m m m }{% |
| 5194 |
% #1=clés #2=nom courbe normale approx #3=N #4=K #5=n |
| 5195 |
\restoreKV[tkzHistoHyperGeo]% |
| 5196 |
\setKV[tkzHistoHyperGeo]{#1}% |
| 5197 |
% bornes naturelles de k |
| 5198 |
\xdef\tkzGraphHyperKmin{\xinttheexpr max(0,#5+#4-#3)\relax}% |
| 5199 |
\xdef\tkzGraphHyperKmax{\xinttheexpr min(#5,#4)\relax}% |
| 5200 |
% bornes d'affichage |
| 5201 |
\IfStrEq{\tkzGraphHyperXminmax}{}% |
| 5202 |
{% |
| 5203 |
\xdef\tkzGraphHyperXmin{\tkzGraphHyperKmin}% |
| 5204 |
\xdef\tkzGraphHyperXmax{\tkzGraphHyperKmax}% |
| 5205 |
}% |
| 5206 |
{% |
| 5207 |
\StrCut{\tkzGraphHyperXminmax}{-}{\tkzGraphHyperXmin}{\tkzGraphHyperXmax}% |
| 5208 |
\IfStrEq{\tkzGraphHyperXmin}{*}{\xdef\tkzGraphHyperXmin{\tkzGraphHyperKmin}}{}% |
| 5209 |
\IfStrEq{\tkzGraphHyperXmax}{*}{\xdef\tkzGraphHyperXmax{\tkzGraphHyperKmax}}{}% |
| 5210 |
}% |
| 5211 |
% bornes de coloriage |
| 5212 |
\IfStrEq{\tkzGraphHyperPlage}{}% |
| 5213 |
{}% |
| 5214 |
{% |
| 5215 |
\StrCut{\tkzGraphHyperPlage}{-}{\tkzGraphHyperColorMin}{\tkzGraphHyperColorMax}% |
| 5216 |
\IfStrEq{\tkzGraphHyperColorMin}{*}{\xdef\tkzGraphHyperColorMin{\tkzGraphHyperXmin}}{}% |
| 5217 |
\IfStrEq{\tkzGraphHyperColorMax}{*}{\xdef\tkzGraphHyperColorMax{\tkzGraphHyperXmax}}{}% |
| 5218 |
}% |
| 5219 |
% coloriage éventuel |
| 5220 |
\IfStrEq{\tkzGraphHyperPlage}{}% |
| 5221 |
{}% |
| 5222 |
{% |
| 5223 |
\xintFor* ##1 in {\xintSeq{\tkzGraphHyperColorMin}{\tkzGraphHyperColorMax}}\do{% |
| 5224 |
\xdef\tkztmpYYY{\xintfloateval{binomial(#4,##1)*binomial(#3-(#4),#5-(##1))/binomial(#3,#5)}}% |
| 5225 |
\IfStrEq{\tkzGraphHyperStyle}{batons}% |
| 5226 |
{% |
| 5227 |
\draw[pflbarresprobas,\tkzGraphHyperColPlage] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5228 |
}% |
| 5229 |
{% |
| 5230 |
\draw[draw=none,fill=\tkzGraphHyperColPlage,fill opacity=0.5] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5231 |
}% |
| 5232 |
}% |
| 5233 |
}% |
| 5234 |
% tracé |
| 5235 |
\xintFor* ##1 in {\xintSeq{\tkzGraphHyperXmin}{\tkzGraphHyperXmax}}\do{% |
| 5236 |
\xdef\tkztmpYYY{\xintfloateval{binomial(#4,##1)*binomial(#3-(#4),#5-(##1))/binomial(#3,#5)}}% |
| 5237 |
% |
| 5238 |
\IfStrEq{\tkzGraphHyperStyle}{batons}% |
| 5239 |
{% |
| 5240 |
\IfStrEq{\tkzGraphHyperPlage}{}%si plage, on colorie tout |
| 5241 |
{% |
| 5242 |
\draw[pflbarresprobas,\tkzGraphHyperColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5243 |
}% |
| 5244 |
{% |
| 5245 |
\xintifboolexpr{\tkzGraphHyperColorMin <= ##1 <= \tkzGraphHyperColorMax}% |
| 5246 |
{}% |
| 5247 |
{% |
| 5248 |
\draw[pflbarresprobas,\tkzGraphHyperColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5249 |
}% |
| 5250 |
}% |
| 5251 |
}% |
| 5252 |
{% |
| 5253 |
\draw[pfltrait,\tkzGraphHyperColTraits] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5254 |
}% |
| 5255 |
% |
| 5256 |
}% |
| 5257 |
% approximation normale : N(nK/N, √(nK(N-K)(N-n)/(N²(N-1)))) |
| 5258 |
\ifboolKV[tkzHistoHyperGeo]{AffNormale}% |
| 5259 |
{% |
| 5260 |
\xdef\tkzMinNormHistoHyper{\xintfloateval{\tkzGraphHyperXmin-0.5}}% |
| 5261 |
\xdef\tkzMaxNormHistoHyper{\xintfloateval{\tkzGraphHyperXmax+0.5}}% |
| 5262 |
\xdef\tkzEsperNorm{\xintfloateval{(#5)*(#4)/(#3)}}% |
| 5263 |
\xdef\tkzVarNorm{\xintfloateval{sqrt((#5)*(#4)*((#3)-(#4))*((#3)-(#5))/((#3)^2*((#3)-1)))}}% |
| 5264 |
\DefinirLoiNormale[Trace,Couleur=\tkzGraphHyperColNorm,pflcourbe,% |
| 5265 |
Debut=\tkzMinNormHistoHyper,Fin=\tkzMaxNormHistoHyper]% |
| 5266 |
<#2>{\tkzEsperNorm}{\tkzVarNorm}% |
| 5267 |
}% |
| 5268 |
{}% |
| 5269 |
} |
| 5270 |
|
| 5271 |
%====HISTO LOI GÉOMÉTRIQUE |
| 5272 |
% P(X=k) = (1-p)^(k-1) * p pour k = 1, 2, 3, ... |
| 5273 |
% #3 = p (probabilité de succès) |
| 5274 |
\defKV[tkzHistoGeo]{% |
| 5275 |
CouleurTraits=\def\tkzGraphGeoColTraits{#1},% |
| 5276 |
Plage=\def\tkzGraphGeoPlage{#1},% |
| 5277 |
CouleurPlage=\def\tkzGraphGeoColPlage{#1},% |
| 5278 |
ClipX=\def\tkzGraphGeoXminmax{#1},% |
| 5279 |
Nmax=\def\tkzGraphGeoNmax{#1},% |
| 5280 |
Style=\def\tkzGraphGeoStyle{#1},% |
| 5281 |
CouleurExpo=\def\tkzGraphGeoColExpo{#1} |
| 5282 |
} |
| 5283 |
\setKVdefault[tkzHistoGeo]{% |
| 5284 |
CouleurTraits=black,% |
| 5285 |
Plage={},% |
| 5286 |
CouleurPlage=black,% |
| 5287 |
ClipX={},% |
| 5288 |
Nmax={},% |
| 5289 |
Style=histo,% |
| 5290 |
AffExpo=false,% |
| 5291 |
CouleurExpo=black |
| 5292 |
} |
| 5293 |
\NewDocumentCommand\TracerLoiGeo{ O{} m }{% |
| 5294 |
% #1=clés #2=p |
| 5295 |
\restoreKV[tkzHistoGeo]% |
| 5296 |
\setKV[tkzHistoGeo]{#1}% |
| 5297 |
% Nmax auto si non fourni : 1/p + 4*sqrt((1-p)/p²) |
| 5298 |
\IfStrEq{\tkzGraphGeoNmax}{}% |
| 5299 |
{\xdef\tkzGraphGeoNmax{\xinttheexpr round(1/(#2)+4*sqrt((1-(#2))/(#2)^2))\relax}}% |
| 5300 |
{}% |
| 5301 |
% bornes d'affichage |
| 5302 |
\IfStrEq{\tkzGraphGeoXminmax}{}% |
| 5303 |
{% |
| 5304 |
\xdef\tkzGraphGeoXmin{1}% |
| 5305 |
\xdef\tkzGraphGeoXmax{\tkzGraphGeoNmax}% |
| 5306 |
}% |
| 5307 |
{% |
| 5308 |
\StrCut{\tkzGraphGeoXminmax}{-}{\tkzGraphGeoXmin}{\tkzGraphGeoXmax}% |
| 5309 |
\IfStrEq{\tkzGraphGeoXmin}{*}{\xdef\tkzGraphGeoXmin{1}}{}% |
| 5310 |
\IfStrEq{\tkzGraphGeoXmax}{*}{\xdef\tkzGraphGeoXmax{\tkzGraphGeoNmax}}{}% |
| 5311 |
}% |
| 5312 |
% bornes de coloriage |
| 5313 |
\IfStrEq{\tkzGraphGeoPlage}{}% |
| 5314 |
{}% |
| 5315 |
{% |
| 5316 |
\StrCut{\tkzGraphGeoPlage}{-}{\tkzGraphGeoColorMin}{\tkzGraphGeoColorMax}% |
| 5317 |
\IfStrEq{\tkzGraphGeoColorMin}{*}{\xdef\tkzGraphGeoColorMin{\tkzGraphGeoXmin}}{}% |
| 5318 |
\IfStrEq{\tkzGraphGeoColorMax}{*}{\xdef\tkzGraphGeoColorMax{\tkzGraphGeoXmax}}{}% |
| 5319 |
}% |
| 5320 |
% coloriage éventuel |
| 5321 |
\IfStrEq{\tkzGraphGeoPlage}{}% |
| 5322 |
{}% |
| 5323 |
{% |
| 5324 |
\xintFor* ##1 in {\xintSeq{\tkzGraphGeoColorMin}{\tkzGraphGeoColorMax}}\do{% |
| 5325 |
\xdef\tkztmpYYY{\xintfloateval{(1-(#2))^(##1-1)*(#2)}}% |
| 5326 |
\IfStrEq{\tkzGraphGeoStyle}{batons}% |
| 5327 |
{% |
| 5328 |
\draw[pflbarresprobas,\tkzGraphGeoColPlage] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5329 |
}% |
| 5330 |
{% |
| 5331 |
\draw[draw=none,fill=\tkzGraphGeoColPlage,fill opacity=0.5] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5332 |
}% |
| 5333 |
}% |
| 5334 |
}% |
| 5335 |
% tracé |
| 5336 |
\xintFor* ##1 in {\xintSeq{\tkzGraphGeoXmin}{\tkzGraphGeoXmax}}\do{% |
| 5337 |
\xdef\tkztmpYYY{\xintfloateval{(1-(#2))^(##1-1)*(#2)}}% |
| 5338 |
\IfStrEq{\tkzGraphGeoStyle}{batons}% |
| 5339 |
{% |
| 5340 |
\IfStrEq{\tkzGraphGeoPlage}{}% |
| 5341 |
{% |
| 5342 |
\draw[pflbarresprobas,\tkzGraphGeoColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5343 |
}% |
| 5344 |
{% |
| 5345 |
\xintifboolexpr{\tkzGraphGeoColorMin <= ##1 <= \tkzGraphGeoColorMax}% |
| 5346 |
{}% |
| 5347 |
{% |
| 5348 |
\draw[pflbarresprobas,\tkzGraphGeoColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5349 |
}% |
| 5350 |
}% |
| 5351 |
}% |
| 5352 |
{% |
| 5353 |
\draw[pfltrait,\tkzGraphGeoColTraits] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5354 |
}% |
| 5355 |
}% |
| 5356 |
\ifboolKV[tkzHistoGeo]{AffExpo}% |
| 5357 |
{% |
| 5358 |
\xdef\tkzMinExpoGeo{\xintfloateval{\tkzGraphGeoXmin-0.5}}% |
| 5359 |
\xdef\tkzMaxExpoGeo{\xintfloateval{\tkzGraphGeoXmax+0.5}}% |
| 5360 |
\xdef\tkzExpoParam{\xintfloateval{-ln(1-(#2))}}% |
| 5361 |
\DefinirLoiExponentielle[Trace,Couleur=\tkzGraphGeoColExpo,pflcourbe,% |
| 5362 |
Debut=\tkzMinExpoGeo,Fin=\tkzMaxExpoGeo]% |
| 5363 |
<phiexpo>{\tkzExpoParam}% |
| 5364 |
}% |
| 5365 |
{}% |
| 5366 |
} |
| 5367 |
|
| 5368 |
%====HISTOBINOM (mis à jour : CouleurTraits + Style) |
| 5369 |
\defKV[tkzHistoBinom]{% |
| 5370 |
CouleurTraits=\def\tkzGraphBinomColTraits{#1},% |
| 5371 |
Plage=\def\tkzGraphBinomPlage{#1},% |
| 5372 |
CouleurPlage=\def\tkzGraphBimomColPlage{#1},% |
| 5373 |
ClipX=\def\tkzGraphBinomXminmax{#1},% |
| 5374 |
CouleurNormale=\def\tkzGraphBinomColNorm{#1},% |
| 5375 |
Style=\def\tkzGraphBinomStyle{#1} |
| 5376 |
} |
| 5377 |
\setKVdefault[tkzHistoBinom]{% |
| 5378 |
CouleurTraits=black,% |
| 5379 |
Plage={},% |
| 5380 |
CouleurPlage=black,% |
| 5381 |
ClipX={},% |
| 5382 |
AffNormale=false,% |
| 5383 |
CouleurNormale=black,% |
| 5384 |
Style=histo% |
| 5385 |
} |
| 5386 |
\NewDocumentCommand\TracerHistoBinomiale{ O{} D<>{phi} m m }{% |
| 5387 |
\restoreKV[tkzHistoBinom]% |
| 5388 |
\setKV[tkzHistoBinom]{#1}% |
| 5389 |
\def\tkzGraphBinomN{#3}% |
| 5390 |
\def\tkzGraphBinomP{#4}% |
| 5391 |
% bornes d'affichage |
| 5392 |
\IfStrEq{\tkzGraphBinomXminmax}{}% |
| 5393 |
{% |
| 5394 |
\xdef\tkzGraphBinomXmin{0}% |
| 5395 |
\xdef\tkzGraphBinomXmax{\tkzGraphBinomN}% |
| 5396 |
}% |
| 5397 |
{% |
| 5398 |
\StrCut{\tkzGraphBinomXminmax}{-}{\tkzGraphBinomXmin}{\tkzGraphBinomXmax}% |
| 5399 |
\IfStrEq{\tkzGraphBinomXmin}{*}{\xdef\tkzGraphBinomXmin{0}}{}% |
| 5400 |
\IfStrEq{\tkzGraphBinomXmax}{*}{\xdef\tkzGraphBinomXmax{\tkzGraphBinomN}}{}% |
| 5401 |
}% |
| 5402 |
% bornes de coloriage |
| 5403 |
\IfStrEq{\tkzGraphBinomPlage}{}% |
| 5404 |
{}% |
| 5405 |
{% |
| 5406 |
\StrCut{\tkzGraphBinomPlage}{-}{\tkzGraphBinomColorMin}{\tkzGraphBinomColorMax}% |
| 5407 |
\IfStrEq{\tkzGraphBinomColorMin}{*}{\xdef\tkzGraphBinomColorMin{\tkzGraphBinomXmin}}{}% |
| 5408 |
\IfStrEq{\tkzGraphBinomColorMax}{*}{\xdef\tkzGraphBinomColorMax{\tkzGraphBinomXmax}}{}% |
| 5409 |
}% |
| 5410 |
% coloriage éventuel |
| 5411 |
\IfStrEq{\tkzGraphBinomPlage}{}% |
| 5412 |
{}% |
| 5413 |
{% |
| 5414 |
\xintFor* ##1 in {\xintSeq{\tkzGraphBinomColorMin}{\tkzGraphBinomColorMax}}\do{% |
| 5415 |
\xdef\tkztmpYYY{\xintfloateval{binomial(\tkzGraphBinomN,##1)*(\tkzGraphBinomP)^(##1)*(1-(\tkzGraphBinomP))^((\tkzGraphBinomN)-(##1))}}% |
| 5416 |
\IfStrEq{\tkzGraphBinomStyle}{batons}% |
| 5417 |
{% |
| 5418 |
\draw[pflbarresprobas,\tkzGraphBimomColPlage] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5419 |
}% |
| 5420 |
{% |
| 5421 |
\draw[draw=none,fill=\tkzGraphBimomColPlage,fill opacity=0.5] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5422 |
}% |
| 5423 |
}% |
| 5424 |
}% |
| 5425 |
% tracé |
| 5426 |
\xintFor* ##1 in {\xintSeq{\tkzGraphBinomXmin}{\tkzGraphBinomXmax}}\do{% |
| 5427 |
\xdef\tkztmpYYY{\xintfloateval{binomial(\tkzGraphBinomN,##1)*(\tkzGraphBinomP)^(##1)*(1-(\tkzGraphBinomP))^((\tkzGraphBinomN)-(##1))}}% |
| 5428 |
\IfStrEq{\tkzGraphBinomStyle}{batons}% |
| 5429 |
{% |
| 5430 |
\IfStrEq{\tkzGraphBinomPlage}{}% |
| 5431 |
{% |
| 5432 |
\draw[pflbarresprobas,\tkzGraphBinomColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5433 |
}% |
| 5434 |
{% |
| 5435 |
\xintifboolexpr{\tkzGraphBinomColorMin <= ##1 <= \tkzGraphBinomColorMax}% |
| 5436 |
{}% |
| 5437 |
{% |
| 5438 |
\draw[pflbarresprobas,\tkzGraphBinomColTraits] ({##1},{\pflymin}) -- ({##1},{\tkztmpYYY-\pflymin}) ; |
| 5439 |
}% |
| 5440 |
}% |
| 5441 |
}% |
| 5442 |
{% |
| 5443 |
\draw[pfltrait,\tkzGraphBinomColTraits] ({##1-0.5},{\pflymin}) rectangle++ (1,{\tkztmpYYY-\pflymin}) ; |
| 5444 |
}% |
| 5445 |
}% |
| 5446 |
% approximation normale |
| 5447 |
\ifboolKV[tkzHistoBinom]{AffNormale}% |
| 5448 |
{% |
| 5449 |
\xdef\tkzMinNormHistoBinom{\xintfloateval{\tkzGraphBinomXmin-0.5}}% |
| 5450 |
\xdef\tkzMaxNormHistoBinom{\xintfloateval{\tkzGraphBinomXmax+0.5}}% |
| 5451 |
\xdef\tkzEsperNorm{\xintfloateval{(#3)*(#4)}}% |
| 5452 |
\xdef\tkzVarNorm{\xintfloateval{sqrt((#3)*(#4)*(1-(#4)))}}% |
| 5453 |
\DefinirLoiNormale[Trace,Couleur=\tkzGraphBinomColNorm,pflcourbe,% |
| 5454 |
Debut=\tkzMinNormHistoBinom,Fin=\tkzMaxNormHistoBinom]% |
| 5455 |
<#2>{\tkzEsperNorm}{\tkzVarNorm}% |
| 5456 |
}% |
| 5457 |
{}% |
| 5458 |
} |
| 5459 |
\NewCommandCopy\TracerLoiBinomiale\TracerHistoBinomiale |
| 5460 |
|
| 5461 |
%====RACINES ET LISTE D'ABSCISSES |
| 5462 |
\NewDocumentCommand\TrouverRacines{ O{} m D<>{\myracines} }{% |
| 5463 |
% wrapper de \TrouverAntecedents avec y=0 (zéros de la fonction) |
| 5464 |
% #1 = clés (Nom, Aff, Traits, Couleur, AffDroite, Style) |
| 5465 |
% #2 = nom de la courbe |
| 5466 |
% #3 = macro stockant le nb de racines (défaut \myracines) |
| 5467 |
\TrouverAntecedents[#1]{#2}{0}<#3>% |
| 5468 |
} |
| 5469 |
|
| 5470 |
\NewDocumentCommand\PlacerRacines{ O{} m }{% |
| 5471 |
% wrapper de \PlacerAntecedents avec y=Oy (zéros de la fonction) |
| 5472 |
% #1 = clés (Traits, Couleurs, Nom, Style) |
| 5473 |
% #2 = nom de la courbe |
| 5474 |
\PlacerAntecedents[#1]{#2}{0}% |
| 5475 |
} |
| 5476 |
|
| 5477 |
\NewDocumentCommand\CreerListeAbscisses{ m m O{mylistabs} }{% |
| 5478 |
% #1 = préfixe des nœuds (ex: R, S, A...) sans \ |
| 5479 |
% #2 = nb de nœuds |
| 5480 |
% #3 = nom de la macro de sortie (ex: mesracines) sans \ |
| 5481 |
\xdef\tkzgtmplistabsc{}% |
| 5482 |
\xintifboolexpr{#2 == 0}{}% |
| 5483 |
{% |
| 5484 |
\foreach \i in {1,...,#2}{% |
| 5485 |
\RecupererAbscisse{(#1-\i)}[\tmpabsi]% |
| 5486 |
\xintifboolexpr{\i == 1}% |
| 5487 |
{\xdef\tkzgtmplistabsc{\tmpabsi}}% |
| 5488 |
{\xdef\tkzgtmplistabsc{\tkzgtmplistabsc,\tmpabsi}}% |
| 5489 |
}% |
| 5490 |
}% |
| 5491 |
\expandafter\xdef\csname#3\endcsname{\tkzgtmplistabsc}% |
| 5492 |
} |
| 5493 |
|
| 5494 |
%====GÉNÉRATION DE FONCTIONS HORS ENVIRONNEMENT |
| 5495 |
\NewDocumentCommand\GenererFonction{ s D<>{f} m }{% |
| 5496 |
% #2 = nom fonction xint |
| 5497 |
% #3 = expression |
| 5498 |
\IfBooleanT{#1}{\xintglobaldefstrue}% |
| 5499 |
\xintdeffloatfunc #2(x) = #3 ;% |
| 5500 |
\IfBooleanT{#1}{\xintglobaldefsfalse}% |
| 5501 |
} |
| 5502 |
|
| 5503 |
\NewDocumentCommand\GenererFamilleFonctions{ s D<>{f} m m m }{% |
| 5504 |
% #2 = nom famille (namespace) |
| 5505 |
% #3 = expression avec n comme paramètre xint |
| 5506 |
% #4 = indice début |
| 5507 |
% #5 = indice fin |
| 5508 |
\IfBooleanT{#1}{\xintglobaldefstrue}% |
| 5509 |
% 1/ fonction à 2 variables |
| 5510 |
\xintdeffloatfunc #2(x,n) = #3 ;% |
| 5511 |
% 2/ spécialisation → fonctions à 1 variable |
| 5512 |
\xintFor* ##1 in {\xintSeq{#4}{#5}} \do {% |
| 5513 |
\xintdeffloatfunc #2_##1(x) = #2(x,##1) ;% |
| 5514 |
}% |
| 5515 |
\IfBooleanT{#1}{\xintglobaldefsfalse}% |
| 5516 |
% stockage |
| 5517 |
\expandafter\xdef\csname pflnb@#2\endcsname{\inteval{(#5)-(#4)+1}}% |
| 5518 |
\expandafter\xdef\csname pfldeb@#2\endcsname{#4}% |
| 5519 |
\expandafter\xdef\csname pflfin@#2\endcsname{#5}% |
| 5520 |
} |
| 5521 |
|
| 5522 |
%====FAMILLES DE COURBES (indexées sur N) |
| 5523 |
\defKV[GraphiqueTikzFamille]{% |
| 5524 |
Couleur=\def\pflfamcouleur{#1},% |
| 5525 |
Couleurs=\def\pflfamcouleurs{#1},% |
| 5526 |
CouleurBase=\def\pflfamcouleurbase{#1},% |
| 5527 |
Debut=\def\pflfamdebut{#1},% |
| 5528 |
Fin=\def\pflfamfin{#1},% |
| 5529 |
Pas=\def\pflfampas{#1} |
| 5530 |
} |
| 5531 |
\setKVdefault[GraphiqueTikzFamille]{% |
| 5532 |
Couleur=black,% |
| 5533 |
Couleurs={},% |
| 5534 |
CouleurBase={},% |
| 5535 |
Debut={\pflxmin},% |
| 5536 |
Fin={\pflxmax},% |
| 5537 |
Pas={},% |
| 5538 |
Trace=false,% |
| 5539 |
Clip=true,% |
| 5540 |
RestreindreY=false,% |
| 5541 |
DefGlobale=false |
| 5542 |
} |
| 5543 |
|
| 5544 |
\NewDocumentCommand\DefinirFamilleCourbes{ O{} D<>{f} m m m }{% |
| 5545 |
\restoreKV[GraphiqueTikzFamille]% |
| 5546 |
\setKV[GraphiqueTikzFamille]{#1}% |
| 5547 |
% offsets |
| 5548 |
\xdef\pfloffsetV{\xintfloateval{((\pflymax)-(\pflymin))/20}}% |
| 5549 |
\xdef\pflMinoffsetV{\xintfloateval{(\pflymin)-(\pfloffsetV)}}% |
| 5550 |
\xdef\pflMaxoffsetV{\xintfloateval{(\pflymax)+(\pfloffsetV)}}% |
| 5551 |
% nb courbes |
| 5552 |
\xdef\tmpnbfam{\inteval{(#5)-(#4)+1}}% |
| 5553 |
% lecture couleurs hors boucle |
| 5554 |
\IfEq{\pflfamcouleurs}{}% |
| 5555 |
{}% |
| 5556 |
{\setsepchar{,}\readlist*\tmplistecouleurs{\pflfamcouleurs}}% |
| 5557 |
% 1/ fonction 2 variables |
| 5558 |
\ifboolKV[GraphiqueTikzFamille]{DefGlobale}{\xintglobaldefstrue}{}% |
| 5559 |
\xintdeffloatfunc #2(x,n) = #3 ;% |
| 5560 |
% 2/ boucle |
| 5561 |
\xdef\tmpi{0}% |
| 5562 |
\xintFor* ##1 in {\xintSeq{#4}{#5}} \do {% |
| 5563 |
\xdef\tmpi{\inteval{\tmpi+1}}% |
| 5564 |
% fonction xint à 1 variable |
| 5565 |
\xintdeffloatfunc #2_##1(x) = #2(x,##1) ;% |
| 5566 |
% couleur courante |
| 5567 |
\IfEq{\pflfamcouleurs}{}% |
| 5568 |
{% |
| 5569 |
\IfEq{\pflfamcouleurbase}{}% |
| 5570 |
{\def\tmpcoulcourante{\pflfamcouleur}}% |
| 5571 |
{% |
| 5572 |
\xdef\tmpopac{\xintfloateval{% |
| 5573 |
round(30+\tmpi/\tmpnbfam*70,0)}}% |
| 5574 |
\edef\tmpcoulcourante{\pflfamcouleurbase!\tmpopac}% |
| 5575 |
}% |
| 5576 |
}% |
| 5577 |
{\itemtomacro\tmplistecouleurs[\tmpi]\tmpcoulcourante}% |
| 5578 |
% nom du name path courant |
| 5579 |
\edef\pflnamecurve{famille-#2-\tmpi}% |
| 5580 |
% pas |
| 5581 |
\xdef\pflstepcurve{\xintfloateval{% |
| 5582 |
((\pflfamfin)-(\pflfamdebut))/100}}% |
| 5583 |
% bifurcation VI/noVI |
| 5584 |
\IfStrEq{\pflvalsinterdites}{}% |
| 5585 |
{%si pas de VI |
| 5586 |
\ifboolKV[GraphiqueTikzFamille]{Clip}% |
| 5587 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}% |
| 5588 |
\ifboolKV[GraphiqueTikzFamille]{Trace}% |
| 5589 |
{% |
| 5590 |
\ifboolKV[GraphiqueTikzFamille]{RestreindreY}% |
| 5591 |
{% |
| 5592 |
\path[draw,pflcourbe,\pflstylecurve,\tmpcoulcourante,% |
| 5593 |
name path global=\pflnamecurve] |
| 5594 |
plot[smooth] coordinates {% |
| 5595 |
\xintthecoords\xintfloatexpr |
| 5596 |
seq((x,min(max(#2_##1(x),\pflMinoffsetV),\pflMaxoffsetV)),% |
| 5597 |
x={\pflfamdebut}..[\pflstepcurve]..{\pflfamfin},% |
| 5598 |
{\pflfamfin}) |
| 5599 |
\relax |
| 5600 |
};% |
| 5601 |
}% |
| 5602 |
{% |
| 5603 |
\path[draw,pflcourbe,\pflstylecurve,\tmpcoulcourante,% |
| 5604 |
name path global=\pflnamecurve] |
| 5605 |
plot[smooth] coordinates {% |
| 5606 |
\xintthecoords\xintfloatexpr |
| 5607 |
seq((x,#2_##1(x)),% |
| 5608 |
x={\pflfamdebut}..[\pflstepcurve]..{\pflfamfin},% |
| 5609 |
{\pflfamfin}) |
| 5610 |
\relax |
| 5611 |
};% |
| 5612 |
}% |
| 5613 |
}% |
| 5614 |
{% |
| 5615 |
\ifboolKV[GraphiqueTikzFamille]{RestreindreY}% |
| 5616 |
{% |
| 5617 |
\path[draw=none,pflcourbe,\pflstylecurve,\tmpcoulcourante,% |
| 5618 |
name path global=\pflnamecurve] |
| 5619 |
plot[smooth] coordinates {% |
| 5620 |
\xintthecoords\xintfloatexpr |
| 5621 |
seq((x,min(max(#2_##1(x),\pflMinoffsetV),\pflMaxoffsetV)),% |
| 5622 |
x={\pflfamdebut}..[\pflstepcurve]..{\pflfamfin},% |
| 5623 |
{\pflfamfin}) |
| 5624 |
\relax |
| 5625 |
};% |
| 5626 |
}% |
| 5627 |
{% |
| 5628 |
\path[draw=none,pflcourbe,\pflstylecurve,\tmpcoulcourante,% |
| 5629 |
name path global=\pflnamecurve] |
| 5630 |
plot[smooth] coordinates {% |
| 5631 |
\xintthecoords\xintfloatexpr |
| 5632 |
seq((x,#2_##1(x)),% |
| 5633 |
x={\pflfamdebut}..[\pflstepcurve]..{\pflfamfin},% |
| 5634 |
{\pflfamfin}) |
| 5635 |
\relax |
| 5636 |
};% |
| 5637 |
}% |
| 5638 |
}% |
| 5639 |
\ifboolKV[GraphiqueTikzFamille]{Clip}{\end{scope}}{}% |
| 5640 |
}% |
| 5641 |
{%sinon, VI |
| 5642 |
\xdef\pflstepcurve{\xintfloateval{% |
| 5643 |
((\pflfamfin)-(\pflfamdebut))/250}}% |
| 5644 |
\xdef\pfllistebornes{\pflfamdebut}% |
| 5645 |
\foreach \i in \pflvalsinterdites{% |
| 5646 |
\xdef\pfllistebornes{\pfllistebornes,% |
| 5647 |
\xintfloateval{\i-(\pflstepcurve)},% |
| 5648 |
\xintfloateval{\i+(\pflstepcurve)}}% |
| 5649 |
}% |
| 5650 |
\xdef\pfllistebornes{\pfllistebornes,\pflfamfin}% |
| 5651 |
\setsepchar{,}% |
| 5652 |
\readlist*\tkzintlistebornes{\pfllistebornes}% |
| 5653 |
\xdef\tkzgrphnbbranches{\fpeval{\tkzintlisteborneslen/2}}% |
| 5654 |
\ifboolKV[GraphiqueTikzFamille]{Clip}% |
| 5655 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}% |
| 5656 |
\ifboolKV[GraphiqueTikzFamille]{Trace}% |
| 5657 |
{% |
| 5658 |
\path[draw,pflcourbe,\pflstylecurve,\tmpcoulcourante,% |
| 5659 |
name path global=\pflnamecurve] |
| 5660 |
\foreach \ib [evaluate=\ib as \ibdeb using {int(2*\ib-1)},% |
| 5661 |
evaluate=\ib as \ibfin using {int(2*\ib)}]% |
| 5662 |
in {1,...,\tkzgrphnbbranches}{% |
| 5663 |
plot[smooth] coordinates {% |
| 5664 |
\xintthecoords\xintfloatexpr |
| 5665 |
seq((x,min(max(#2_##1(x),\pflMinoffsetV),\pflMaxoffsetV)),% |
| 5666 |
x={\tkzintlistebornes[\ibdeb]}..[\pflstepcurve]..% |
| 5667 |
{\tkzintlistebornes[\ibfin]},% |
| 5668 |
{\tkzintlistebornes[\ibfin]}) |
| 5669 |
\relax} |
| 5670 |
} ;% |
| 5671 |
}% |
| 5672 |
{% |
| 5673 |
\path[draw=none,pflcourbe,\pflstylecurve,\tmpcoulcourante,% |
| 5674 |
name path global=\pflnamecurve] |
| 5675 |
\foreach \ib [evaluate=\ib as \ibdeb using {int(2*\ib-1)},% |
| 5676 |
evaluate=\ib as \ibfin using {int(2*\ib)}]% |
| 5677 |
in {1,...,\tkzgrphnbbranches}{% |
| 5678 |
plot[smooth] coordinates {% |
| 5679 |
\xintthecoords\xintfloatexpr |
| 5680 |
seq((x,min(max(#2_##1(x),\pflMinoffsetV),\pflMaxoffsetV)),% |
| 5681 |
x={\tkzintlistebornes[\ibdeb]}..[\pflstepcurve]..% |
| 5682 |
{\tkzintlistebornes[\ibfin]},% |
| 5683 |
{\tkzintlistebornes[\ibfin]}) |
| 5684 |
\relax} |
| 5685 |
} ;% |
| 5686 |
}% |
| 5687 |
\ifboolKV[GraphiqueTikzFamille]{Clip}{\end{scope}}{}% |
| 5688 |
}% |
| 5689 |
}% |
| 5690 |
\ifboolKV[GraphiqueTikzFamille]{DefGlobale}{\xintglobaldefsfalse}{}% |
| 5691 |
% stockage |
| 5692 |
\expandafter\xdef\csname pflnb@#2\endcsname{\tmpnbfam}% |
| 5693 |
\expandafter\xdef\csname pfldeb@#2\endcsname{#4}% |
| 5694 |
\expandafter\xdef\csname pflfin@#2\endcsname{#5}% |
| 5695 |
} |
| 5696 |
|
| 5697 |
\NewDocumentCommand\TracerFamilleCourbes{ O{} m }{% |
| 5698 |
\restoreKV[GraphiqueTikzFamille]% |
| 5699 |
\setKV[GraphiqueTikzFamille]{#1}% |
| 5700 |
\edef\tmpdeb{\csname pfldeb@#2\endcsname}% |
| 5701 |
\edef\tmpfin{\csname pflfin@#2\endcsname}% |
| 5702 |
\edef\tmpnb{\csname pflnb@#2\endcsname}% |
| 5703 |
% offsets |
| 5704 |
\xdef\pfloffsetV{\xintfloateval{((\pflymax)-(\pflymin))/20}}% |
| 5705 |
\xdef\pflMinoffsetV{\xintfloateval{(\pflymin)-(\pfloffsetV)}}% |
| 5706 |
\xdef\pflMaxoffsetV{\xintfloateval{(\pflymax)+(\pfloffsetV)}}% |
| 5707 |
% lecture couleurs hors boucle |
| 5708 |
\IfEq{\pflfamcouleurs}{}% |
| 5709 |
{}% |
| 5710 |
{\setsepchar{,}\readlist*\tmplistecouleurs{\pflfamcouleurs}}% |
| 5711 |
% boucle |
| 5712 |
\xdef\tmpi{0}% |
| 5713 |
\xintFor* ##1 in {\xintSeq{\tmpdeb}{\tmpfin}} \do {% |
| 5714 |
\xdef\tmpi{\inteval{\tmpi+1}}% |
| 5715 |
% couleur courante |
| 5716 |
\IfEq{\pflfamcouleurs}{}% |
| 5717 |
{% |
| 5718 |
\IfEq{\pflfamcouleurbase}{}% |
| 5719 |
{\def\tmpcoulcourante{\pflfamcouleur}}% |
| 5720 |
{% |
| 5721 |
\xdef\tmpopac{\xintfloateval{% |
| 5722 |
round(30+\tmpi/\tmpnb*70,0)}}% |
| 5723 |
\edef\tmpcoulcourante{\pflfamcouleurbase!\tmpopac}% |
| 5724 |
}% |
| 5725 |
}% |
| 5726 |
{\itemtomacro\tmplistecouleurs[\tmpi]\tmpcoulcourante}% |
| 5727 |
% pas |
| 5728 |
\xdef\pflstepcurve{\xintfloateval{% |
| 5729 |
((\pflfamfin)-(\pflfamdebut))/100}}% |
| 5730 |
% bifurcation VI/noVI |
| 5731 |
\IfStrEq{\pflvalsinterdites}{}% |
| 5732 |
{% |
| 5733 |
\ifboolKV[GraphiqueTikzFamille]{Clip}% |
| 5734 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}% |
| 5735 |
\ifboolKV[GraphiqueTikzFamille]{RestreindreY}% |
| 5736 |
{% |
| 5737 |
\draw[pflcourbe,\pflstylecurve,\tmpcoulcourante] |
| 5738 |
plot[smooth] coordinates {% |
| 5739 |
\xintthecoords\xintfloatexpr |
| 5740 |
seq((x,min(max(#2_##1(x),\pflMinoffsetV),\pflMaxoffsetV)),% |
| 5741 |
x={\pflfamdebut}..[\pflstepcurve]..{\pflfamfin},% |
| 5742 |
{\pflfamfin}) |
| 5743 |
\relax |
| 5744 |
};% |
| 5745 |
}% |
| 5746 |
{% |
| 5747 |
\draw[pflcourbe,\pflstylecurve,\tmpcoulcourante] |
| 5748 |
plot[smooth] coordinates {% |
| 5749 |
\xintthecoords\xintfloatexpr |
| 5750 |
seq((x,#2_##1(x)),% |
| 5751 |
x={\pflfamdebut}..[\pflstepcurve]..{\pflfamfin},% |
| 5752 |
{\pflfamfin}) |
| 5753 |
\relax |
| 5754 |
};% |
| 5755 |
}% |
| 5756 |
\ifboolKV[GraphiqueTikzFamille]{Clip}{\end{scope}}{}% |
| 5757 |
}% |
| 5758 |
{%sinon VI |
| 5759 |
\xdef\pflstepcurve{\xintfloateval{% |
| 5760 |
((\pflfamfin)-(\pflfamdebut))/250}}% |
| 5761 |
\xdef\pfllistebornes{\pflfamdebut}% |
| 5762 |
\foreach \i in \pflvalsinterdites{% |
| 5763 |
\xdef\pfllistebornes{\pfllistebornes,% |
| 5764 |
\xintfloateval{\i-(\pflstepcurve)},% |
| 5765 |
\xintfloateval{\i+(\pflstepcurve)}}% |
| 5766 |
}% |
| 5767 |
\xdef\pfllistebornes{\pfllistebornes,\pflfamfin}% |
| 5768 |
\setsepchar{,}% |
| 5769 |
\readlist*\tkzintlistebornes{\pfllistebornes}% |
| 5770 |
\xdef\tkzgrphnbbranches{\fpeval{\tkzintlisteborneslen/2}}% |
| 5771 |
\ifboolKV[GraphiqueTikzFamille]{Clip}% |
| 5772 |
{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}% |
| 5773 |
\draw[pflcourbe,\pflstylecurve,\tmpcoulcourante] |
| 5774 |
\foreach \ib [evaluate=\ib as \ibdeb using {int(2*\ib-1)},% |
| 5775 |
evaluate=\ib as \ibfin using {int(2*\ib)}]% |
| 5776 |
in {1,...,\tkzgrphnbbranches}{% |
| 5777 |
plot[smooth] coordinates {% |
| 5778 |
\xintthecoords\xintfloatexpr |
| 5779 |
seq((x,min(max(#2_##1(x),\pflMinoffsetV),\pflMaxoffsetV)),% |
| 5780 |
x={\tkzintlistebornes[\ibdeb]}..[\pflstepcurve]..% |
| 5781 |
{\tkzintlistebornes[\ibfin]},% |
| 5782 |
{\tkzintlistebornes[\ibfin]}) |
| 5783 |
\relax} |
| 5784 |
} ;% |
| 5785 |
\ifboolKV[GraphiqueTikzFamille]{Clip}{\end{scope}}{}% |
| 5786 |
}% |
| 5787 |
}% |
| 5788 |
} |
| 5789 |
|
| 5790 |
%====SEMILOG - LOGLOG |
| 5791 |
\NewDocumentEnvironment{GraphiqueTikzSemiLog}{ O{} D<>{} }% |
| 5792 |
%1 = options tikz, classiques |
| 5793 |
%2 = clés spécifiques |
| 5794 |
{% |
| 5795 |
\restoreKV[GraphiqueTikz]% |
| 5796 |
\setKV[GraphiqueTikz]{#2}% |
| 5797 |
%l'environnement |
| 5798 |
\IfStrEq{\pflgraphdims}{}% |
| 5799 |
{% |
| 5800 |
\begin{tikzpicture}[#1]% |
| 5801 |
}% |
| 5802 |
{% |
| 5803 |
\StrCut{\pflgraphdims}{/}{\pfltmpwidth}{\pfltmpheight}% |
| 5804 |
\setlength\pflglobalwidth{\fpeval{(\pfltmpwidth)/(\pflxmaxtmp-\pflxmintmp)}pt}%\the\pflglobalwidth+% |
| 5805 |
\setlength\pflglobalheight{\fpeval{(\pfltmpheight)/(\pflymaxtmp-\pflymintmp)}pt}%\the\pflglobalheight% |
| 5806 |
\begin{tikzpicture}[x=\pflglobalwidth,y=\pflglobalheight,Xmin=\pflxmintmp,Xmax=\pflxmaxtmp,Ymin=\pflymintmp,Ymax=\pflymaxtmp,#1]% |
| 5807 |
}% |
| 5808 |
%translationY |
| 5809 |
% valeurs réelles → exposants |
| 5810 |
\xdef\pflslogexpomin{\xintfloateval{log10(\pflymin)}}% |
| 5811 |
\xdef\pflslogexpomax{\xintfloateval{log10(\pflymax)}}% |
| 5812 |
% nb décades |
| 5813 |
\xdef\pflymax{\xintfloateval{log10(\pflymax)-log10(\pflymin)}}% |
| 5814 |
\xdef\pflymin{0}% |
| 5815 |
\xdef\pflOy{0}% |
| 5816 |
%thèmes personnalisés |
| 5817 |
\IfStrEqCase{\pflgraphthem}{% |
| 5818 |
{standard}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepdefault!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillesdefault}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleidefault}}}% |
| 5819 |
{gris}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepgray!75}}\tikzset{pflgrillei/.style={line width\pflthickgrids,pflgrillesgray}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleigray}}}% |
| 5820 |
{bleu}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepblue!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillesblue}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleiblue}}}% |
| 5821 |
{vert}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepgreen!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillesgreen}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleigreen}}}% |
| 5822 |
{chaud}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepwarm!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrilleswarm}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleiwarm}}}% |
| 5823 |
{contraste}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepcontrast!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillescontrast}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleicontrast}}}% |
| 5824 |
}% |
| 5825 |
%unités x/y pour des calculs de coordonnées |
| 5826 |
\TikZUnites |
| 5827 |
%noeuds fenêtre + axes |
| 5828 |
\IfStrEq{\pflgraphnom}{}% |
| 5829 |
{% |
| 5830 |
\coordinate (graphe-ne) at ({\pflxmax},{\pflymax}) ; |
| 5831 |
\coordinate (graphe-nw) at ({\pflxmin},{\pflymax}) ; |
| 5832 |
\coordinate (graphe-se) at ({\pflxmax},{\pflymin}) ; |
| 5833 |
\coordinate (graphe-sw) at ({\pflxmin},{\pflymin}) ; |
| 5834 |
\coordinate (graphe-n) at ($(graphe-ne)!0.5!(graphe-nw)$) ; |
| 5835 |
\coordinate (graphe-e) at ($(graphe-ne)!0.5!(graphe-se)$) ; |
| 5836 |
\coordinate (graphe-s) at ($(graphe-se)!0.5!(graphe-sw)$) ; |
| 5837 |
\coordinate (graphe-w) at ($(graphe-sw)!0.5!(graphe-nw)$) ; |
| 5838 |
\coordinate (graphe-c) at ($(graphe-sw)!0.5!(graphe-ne)$) ; |
| 5839 |
\coordinate (axeox-w) at ({\pflxmin},{\pflOy}) ; |
| 5840 |
\coordinate (axeox-e) at ({\pflxmax},{\pflOy}) ; |
| 5841 |
\coordinate (axeoy-s) at ({\pflOx},{\pflymin}) ; |
| 5842 |
\coordinate (axeoy-n) at ({\pflOx},{\pflymax}) ; |
| 5843 |
\coordinate (axes-orig) at ({\pflOx},{\pflOy}) ; |
| 5844 |
}% |
| 5845 |
{% |
| 5846 |
\coordinate (\pflgraphnom-graphe-ne) at ({\pflxmax},{\pflymax}) ; |
| 5847 |
\coordinate (\pflgraphnom-graphe-nw) at ({\pflxmin},{\pflymax}) ; |
| 5848 |
\coordinate (\pflgraphnom-graphe-se) at ({\pflxmax},{\pflymin}) ; |
| 5849 |
\coordinate (\pflgraphnom-graphe-sw) at ({\pflxmin},{\pflymin}) ; |
| 5850 |
\coordinate (\pflgraphnom-graphe-n) at ($(\pflgraphnom-graphe-ne)!0.5!(\pflgraphnom-graphe-nw)$) ; |
| 5851 |
\coordinate (\pflgraphnom-graphe-e) at ($(\pflgraphnom-graphe-ne)!0.5!(\pflgraphnom-graphe-se)$) ; |
| 5852 |
\coordinate (\pflgraphnom-graphe-s) at ($(\pflgraphnom-graphe-se)!0.5!(\pflgraphnom-graphe-sw)$) ; |
| 5853 |
\coordinate (\pflgraphnom-graphe-w) at ($(\pflgraphnom-graphe-sw)!0.5!(\pflgraphnom-graphe-nw)$) ; |
| 5854 |
\coordinate (\pflgraphnom-graphe-c) at ($(\pflgraphnom-graphe-sw)!0.5!(\pflgraphnom-graphe-ne)$) ; |
| 5855 |
\coordinate (\pflgraphnom-axeox-w) at ({\pflxmin},{\pflOy}) ; |
| 5856 |
\coordinate (\pflgraphnom-axeox-e) at ({\pflxmax},{\pflOy}) ; |
| 5857 |
\coordinate (\pflgraphnom-axeoy-s) at ({\pflOx},{\pflymin}) ; |
| 5858 |
\coordinate (\pflgraphnom-axeoy-n) at ({\pflOx},{\pflymax}) ; |
| 5859 |
\coordinate (\pflgraphnom-axes-orig) at ({\pflOx},{\pflOy}) ; |
| 5860 |
}% |
| 5861 |
%noeuds utiles pour les calculs |
| 5862 |
\coordinate (bbxTop) at (current bounding box.north) ; |
| 5863 |
\coordinate (bbxBottom) at (current bounding box.south) ; |
| 5864 |
\ifboolKV[GraphiqueTikz]{AffCadre}{\draw[pflcadre] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}{}% |
| 5865 |
%back to normal |
| 5866 |
}% |
| 5867 |
{% |
| 5868 |
\end{tikzpicture}% |
| 5869 |
} |
| 5870 |
|
| 5871 |
\NewDocumentCommand\TracerAxesGrillesSemiLog{ s O{} m }{% |
| 5872 |
% #1 = étoile (masquer origine) |
| 5873 |
% #2 = clés |
| 5874 |
% #3 = valeurs X, les Y sont faites automatiquement |
| 5875 |
\restoreKV[GraphiqueTikzAxes]% |
| 5876 |
\setKV[GraphiqueTikzAxes]{#2}% |
| 5877 |
% nœuds axes élargis |
| 5878 |
\IfStrEq{\pflgraphnom}{}% |
| 5879 |
{% |
| 5880 |
\coordinate (axeox-ee) at ([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{\pflOy}) ; |
| 5881 |
\coordinate (axeoy-nn) at ([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 5882 |
}% |
| 5883 |
{% |
| 5884 |
\coordinate (\pflgraphnom-axeox-ee) at ([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{\pflOy}) ; |
| 5885 |
\coordinate (\pflgraphnom-axeoy-nn) at ([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 5886 |
}% |
| 5887 |
% cas particuliers |
| 5888 |
\ifboolKV[GraphiqueTikzAxes]{Derriere}{\setKV[GraphiqueTikzAxes]{Grads=false}}{}% |
| 5889 |
\ifboolKV[GraphiqueTikzAxes]{Devant}{\setKV[GraphiqueTikzAxes]{Grille=false}}{}% |
| 5890 |
% format axe X |
| 5891 |
\IfSubStr{\pflformataxes}{/}% |
| 5892 |
{\StrCut{\pflformataxes}{/}{\pflformataxex}{\pflformataxey}}% |
| 5893 |
{\xdef\pflformataxex{\pflformataxes}\xdef\pflformataxey{\pflformataxes}}% |
| 5894 |
% grille |
| 5895 |
\ifboolKV[GraphiqueTikzAxes]{Grille}% |
| 5896 |
{% |
| 5897 |
% sous-décades Y |
| 5898 |
\foreach \n in {0,...,\inteval{\pflymax-1}}{% |
| 5899 |
\foreach \k in {2,3,4,5,6,7,8,9}{% |
| 5900 |
\xdef\tmpsousdec{\xintfloateval{\n+log10(\k)}}% |
| 5901 |
\draw[pflgrilles] ({\pflxmin},{\tmpsousdec})--({\pflxmax},{\tmpsousdec}) ;% |
| 5902 |
}% |
| 5903 |
}% |
| 5904 |
% grille X |
| 5905 |
\draw[pflgrilles,xstep=\pflgrillexs,ystep=99] |
| 5906 |
({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax}) ;% |
| 5907 |
\draw[pflgrillep,xstep=\pflgrillex,ystep=99] |
| 5908 |
({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax}) ;% |
| 5909 |
% décades Y |
| 5910 |
\foreach \n in {0,...,\pflymax}{% |
| 5911 |
\draw[pflgrillep] ({\pflxmin},{\n})--({\pflxmax},{\n}) ;% |
| 5912 |
}% |
| 5913 |
\ifboolKV[GraphiqueTikzAxes]{Dernier}% |
| 5914 |
{% |
| 5915 |
\draw[pflgrillep] ({\pflxmin},{\pflymax})--({\pflxmax},{\pflymax}) ; |
| 5916 |
\draw[pflgrillep] ({\pflxmax},{\pflymin})--({\pflxmax},{\pflymax}) ; |
| 5917 |
}% |
| 5918 |
{}% |
| 5919 |
}% |
| 5920 |
{}% |
| 5921 |
% axes |
| 5922 |
\ifboolKV[GraphiqueTikzAxes]{Fleches}% |
| 5923 |
{% |
| 5924 |
\draw[pflaxes] ({\pflxmin},{0})--([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{0}) ; |
| 5925 |
\draw[pflaxes] ({\pflOx},{0})--([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 5926 |
}% |
| 5927 |
{% |
| 5928 |
\draw[pflaxessansfleche] ({\pflxmin},{0})--([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{0}) ; |
| 5929 |
\draw[pflaxessansfleche] ({\pflOx},{0})--([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflOx},{\pflymax}) ; |
| 5930 |
}% |
| 5931 |
% valeurs X — gestion auto |
| 5932 |
\IfEq{#3}{auto}% |
| 5933 |
{% |
| 5934 |
\xdef\tmprangexvalues{\xintfloateval{seq(i,i=\pflxmin..[\pflgrillex]..\pflxmax)}}% |
| 5935 |
\StrDel{\tmprangexvalues}{ }[\tmprangexvalues]% |
| 5936 |
\xdef\pflformataxex{num}% |
| 5937 |
}% |
| 5938 |
{\xdef\tmprangexvalues{#3}}% |
| 5939 |
% graduations X |
| 5940 |
\draw[pfltrait] ([yshift=\pflthickgradu]{\pflxmin},{0})--++(0,{-\pflthickgradu-\pflthickgradd}) ; |
| 5941 |
\foreach \x in \tmprangexvalues{% |
| 5942 |
\draw[pfltrait] ([yshift=\pflthickgradu]{\x},{0})--++(0,{-\pflthickgradu-\pflthickgradd}) ;% |
| 5943 |
}% |
| 5944 |
% graduations Y |
| 5945 |
\foreach \n in {0,...,\pflymax}{% |
| 5946 |
\xdef\tmpexpo{\inteval{\n+\pflslogexpomin}}% |
| 5947 |
\draw[pfltrait] ([xshift=\pflthickgradu]{\pflxmin},{\n})--++({-\pflthickgradu-\pflthickgradd},0) ;% |
| 5948 |
}% |
| 5949 |
\ifboolKV[GraphiqueTikzAxes]{Grads}% |
| 5950 |
{% |
| 5951 |
% labels X |
| 5952 |
\foreach \x in \tmprangexvalues{% |
| 5953 |
\IfBooleanTF{#1}% |
| 5954 |
{\xintifboolexpr{\x == \pflOx}{}% |
| 5955 |
{\draw ([yshift={-\pflthickgradd}]{\x},{0}) node[pflnoeud,below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\x}} ;}}% |
| 5956 |
{\draw ([yshift={-\pflthickgradd}]{\x},{0}) node[pflnoeud,below,font={\useKV[GraphiqueTikzAxes]{Police}}] {\FormatterValeurAxex{\pflformataxex}{\x}} ;}% |
| 5957 |
}% |
| 5958 |
% labels Y —> $10^n$ |
| 5959 |
\foreach \n in {0,...,\pflymax}{% |
| 5960 |
\xdef\tmpexpo{\inteval{\n+\pflslogexpomin}}% |
| 5961 |
\draw ([xshift={-\pflthickgradd}]{\pflxmin},{\n}) node[left,pflnoeud,font={\useKV[GraphiqueTikzAxes]{Police}}] { \ifboolKV[GraphiqueTikzAxes]{Puissance}{$10^{\tmpexpo}$}{\num{\xintfloateval{10^(\tmpexpo)}}} } ; |
| 5962 |
}% |
| 5963 |
}% |
| 5964 |
{}% |
| 5965 |
} |
| 5966 |
|
| 5967 |
\NewDocumentEnvironment{GraphiqueTikzLogLog}{ O{} D<>{} }% |
| 5968 |
{% |
| 5969 |
\restoreKV[GraphiqueTikz]% |
| 5970 |
\setKV[GraphiqueTikz]{#2}% |
| 5971 |
\IfStrEq{\pflgraphdims}{}% |
| 5972 |
{\begin{tikzpicture}[#1]}% |
| 5973 |
{% |
| 5974 |
\StrCut{\pflgraphdims}{/}{\pfltmpwidth}{\pfltmpheight}% |
| 5975 |
\setlength\pflglobalwidth{\fpeval{(\pfltmpwidth)/(\pflxmaxtmp-\pflxmintmp)}pt}% |
| 5976 |
\setlength\pflglobalheight{\fpeval{(\pfltmpheight)/(\pflymaxtmp-\pflymintmp)}pt}% |
| 5977 |
\begin{tikzpicture}[x=\pflglobalwidth,y=\pflglobalheight,% |
| 5978 |
Xmin=\pflxmintmp,Xmax=\pflxmaxtmp,Ymin=\pflymintmp,Ymax=\pflymaxtmp,#1]% |
| 5979 |
}% |
| 5980 |
% translation X ET Y |
| 5981 |
\xdef\pflslogexpominx{\xintfloateval{log10(\pflxmin)}}% |
| 5982 |
\xdef\pflslogexpomaxx{\xintfloateval{log10(\pflxmax)}}% |
| 5983 |
\xdef\pflxmax{\xintfloateval{log10(\pflxmax)-log10(\pflxmin)}}% |
| 5984 |
\xdef\pflxmin{0}% |
| 5985 |
\xdef\pflslogexpomin{\xintfloateval{log10(\pflymin)}}% |
| 5986 |
\xdef\pflslogexpomax{\xintfloateval{log10(\pflymax)}}% |
| 5987 |
\xdef\pflymax{\xintfloateval{log10(\pflymax)-log10(\pflymin)}}% |
| 5988 |
\xdef\pflymin{0}% |
| 5989 |
\xdef\pflOx{0}\xdef\pflOy{0}% |
| 5990 |
%thèmes personnalisés |
| 5991 |
\IfStrEqCase{\pflgraphthem}{% |
| 5992 |
{standard}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepdefault!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillesdefault}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleidefault}}}% |
| 5993 |
{gris}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepgray!75}}\tikzset{pflgrillei/.style={line width\pflthickgrids,pflgrillesgray}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleigray}}}% |
| 5994 |
{bleu}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepblue!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillesblue}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleiblue}}}% |
| 5995 |
{vert}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepgreen!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillesgreen}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleigreen}}}% |
| 5996 |
{chaud}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepwarm!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrilleswarm}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleiwarm}}}% |
| 5997 |
{contraste}{\tikzset{pflgrillep/.style={line width=\pflthickgridp,pflgrillepcontrast!75}}\tikzset{pflgrillei/.style={line width=\pflthickgrids,pflgrillescontrast}}\tikzset{pflgrilles/.style={line width=\pflthickgridi,pflgrilleicontrast}}}% |
| 5998 |
}% |
| 5999 |
%unités x/y pour des calculs de coordonnées |
| 6000 |
\TikZUnites |
| 6001 |
%noeuds fenêtre + axes |
| 6002 |
\IfStrEq{\pflgraphnom}{}% |
| 6003 |
{% |
| 6004 |
\coordinate (graphe-ne) at ({\pflxmax},{\pflymax}) ; |
| 6005 |
\coordinate (graphe-nw) at ({\pflxmin},{\pflymax}) ; |
| 6006 |
\coordinate (graphe-se) at ({\pflxmax},{\pflymin}) ; |
| 6007 |
\coordinate (graphe-sw) at ({\pflxmin},{\pflymin}) ; |
| 6008 |
\coordinate (graphe-n) at ($(graphe-ne)!0.5!(graphe-nw)$) ; |
| 6009 |
\coordinate (graphe-e) at ($(graphe-ne)!0.5!(graphe-se)$) ; |
| 6010 |
\coordinate (graphe-s) at ($(graphe-se)!0.5!(graphe-sw)$) ; |
| 6011 |
\coordinate (graphe-w) at ($(graphe-sw)!0.5!(graphe-nw)$) ; |
| 6012 |
\coordinate (graphe-c) at ($(graphe-sw)!0.5!(graphe-ne)$) ; |
| 6013 |
\coordinate (axeox-w) at ({\pflxmin},{\pflOy}) ; |
| 6014 |
\coordinate (axeox-e) at ({\pflxmax},{\pflOy}) ; |
| 6015 |
\coordinate (axeoy-s) at ({\pflOx},{\pflymin}) ; |
| 6016 |
\coordinate (axeoy-n) at ({\pflOx},{\pflymax}) ; |
| 6017 |
\coordinate (axes-orig) at ({\pflOx},{\pflOy}) ; |
| 6018 |
}% |
| 6019 |
{% |
| 6020 |
\coordinate (\pflgraphnom-graphe-ne) at ({\pflxmax},{\pflymax}) ; |
| 6021 |
\coordinate (\pflgraphnom-graphe-nw) at ({\pflxmin},{\pflymax}) ; |
| 6022 |
\coordinate (\pflgraphnom-graphe-se) at ({\pflxmax},{\pflymin}) ; |
| 6023 |
\coordinate (\pflgraphnom-graphe-sw) at ({\pflxmin},{\pflymin}) ; |
| 6024 |
\coordinate (\pflgraphnom-graphe-n) at ($(\pflgraphnom-graphe-ne)!0.5!(\pflgraphnom-graphe-nw)$) ; |
| 6025 |
\coordinate (\pflgraphnom-graphe-e) at ($(\pflgraphnom-graphe-ne)!0.5!(\pflgraphnom-graphe-se)$) ; |
| 6026 |
\coordinate (\pflgraphnom-graphe-s) at ($(\pflgraphnom-graphe-se)!0.5!(\pflgraphnom-graphe-sw)$) ; |
| 6027 |
\coordinate (\pflgraphnom-graphe-w) at ($(\pflgraphnom-graphe-sw)!0.5!(\pflgraphnom-graphe-nw)$) ; |
| 6028 |
\coordinate (\pflgraphnom-graphe-c) at ($(\pflgraphnom-graphe-sw)!0.5!(\pflgraphnom-graphe-ne)$) ; |
| 6029 |
\coordinate (\pflgraphnom-axeox-w) at ({\pflxmin},{\pflOy}) ; |
| 6030 |
\coordinate (\pflgraphnom-axeox-e) at ({\pflxmax},{\pflOy}) ; |
| 6031 |
\coordinate (\pflgraphnom-axeoy-s) at ({\pflOx},{\pflymin}) ; |
| 6032 |
\coordinate (\pflgraphnom-axeoy-n) at ({\pflOx},{\pflymax}) ; |
| 6033 |
\coordinate (\pflgraphnom-axes-orig) at ({\pflOx},{\pflOy}) ; |
| 6034 |
}% |
| 6035 |
%noeuds utiles pour les calculs |
| 6036 |
\coordinate (bbxTop) at (current bounding box.north) ; |
| 6037 |
\coordinate (bbxBottom) at (current bounding box.south) ; |
| 6038 |
\ifboolKV[GraphiqueTikz]{AffCadre}{\draw[pflcadre] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}{}% |
| 6039 |
%back to normal |
| 6040 |
} |
| 6041 |
{% |
| 6042 |
\end{tikzpicture}% |
| 6043 |
} |
| 6044 |
|
| 6045 |
\NewDocumentCommand\TracerAxesGrillesLogLog{ s O{} }{% |
| 6046 |
% pas d'argument X — les deux axes sont automatiques |
| 6047 |
\restoreKV[GraphiqueTikzAxes]% |
| 6048 |
\setKV[GraphiqueTikzAxes]{#2}% |
| 6049 |
\ifboolKV[GraphiqueTikzAxes]{Grille}% |
| 6050 |
{% |
| 6051 |
% sous-décades X |
| 6052 |
\foreach \n in {0,...,\inteval{\pflxmax-1}}{% |
| 6053 |
\foreach \k in {2,3,4,5,6,7,8,9}{% |
| 6054 |
\xdef\tmpsousdecx{\xintfloateval{\n+log10(\k)}}% |
| 6055 |
\draw[pflgrilles] ({\tmpsousdecx},{\pflymin})--({\tmpsousdecx},{\pflymax}) ;% |
| 6056 |
}% |
| 6057 |
}% |
| 6058 |
% sous-décades Y |
| 6059 |
\foreach \n in {0,...,\inteval{\pflymax-1}}{% |
| 6060 |
\foreach \k in {2,3,4,5,6,7,8,9}{% |
| 6061 |
\xdef\tmpsousdecy{\xintfloateval{\n+log10(\k)}}% |
| 6062 |
\draw[pflgrilles] ({\pflxmin},{\tmpsousdecy})--({\pflxmax},{\tmpsousdecy}) ;% |
| 6063 |
}% |
| 6064 |
}% |
| 6065 |
% décades X et Y |
| 6066 |
\foreach \n in {0,...,\pflxmax}{% |
| 6067 |
\draw[pflgrillep] ({\n},{\pflymin})--({\n},{\pflymax}) ;% |
| 6068 |
}% |
| 6069 |
\foreach \n in {0,...,\pflymax}{% |
| 6070 |
\draw[pflgrillep] ({\pflxmin},{\n})--({\pflxmax},{\n}) ;% |
| 6071 |
}% |
| 6072 |
}% |
| 6073 |
{}% |
| 6074 |
% axes |
| 6075 |
\ifboolKV[GraphiqueTikzAxes]{Fleches}% |
| 6076 |
{% |
| 6077 |
\draw[pflaxes] ({0},{0})--([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{0}) ; |
| 6078 |
\draw[pflaxes] ({0},{0})--([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{0},{\pflymax}) ; |
| 6079 |
}% |
| 6080 |
{% |
| 6081 |
\draw[pflaxessansfleche] ({0},{0})--([xshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{\pflxmax},{0}) ; |
| 6082 |
\draw[pflaxessansfleche] ({0},{0})--([yshift={\useKV[GraphiqueTikzAxes]{Elargir}}]{0},{\pflymax}) ; |
| 6083 |
}% |
| 6084 |
\ifboolKV[GraphiqueTikzAxes]{Grads}% |
| 6085 |
{% |
| 6086 |
% labels X — $10^n$ |
| 6087 |
\foreach \n in {0,...,\pflxmax}{% |
| 6088 |
\xdef\tmpexpox{\inteval{\n+\pflslogexpominx}}% |
| 6089 |
\draw[pfltrait] ([yshift={\pflthickgradu}]{\n},{0})--++(0,{-\pflthickgradu-\pflthickgradd}) ;% |
| 6090 |
\draw ([yshift={-\pflthickgradd}]{\n},{0}) node[pflnoeud,below,font={\useKV[GraphiqueTikzAxes]{Police}}] { \ifboolKV[GraphiqueTikzAxes]{Puissance}{$10^{\tmpexpox}$}{\num{\xintfloateval{10^(\tmpexpox)}}} } ; |
| 6091 |
}% |
| 6092 |
% labels Y — $10^n$ |
| 6093 |
\foreach \n in {0,...,\pflymax}{% |
| 6094 |
\xdef\tmpexpo{\inteval{\n+\pflslogexpomin}}% |
| 6095 |
\draw[pfltrait] ([xshift={\pflthickgradu}]{0},{\n})--++({-\pflthickgradu-\pflthickgradd},0) ;% |
| 6096 |
\draw ([xshift={-\pflthickgradd}]{0},{\n}) node[left,pflnoeud,font={\useKV[GraphiqueTikzAxes]{Police}}] { \ifboolKV[GraphiqueTikzAxes]{Puissance}{$10^{\tmpexpo}$}{\num{\xintfloateval{10^(\tmpexpo)}}} } ; |
| 6097 |
}% |
| 6098 |
}% |
| 6099 |
{}% |
| 6100 |
} |
| 6101 |
|
| 6102 |
\NewDocumentCommand\TracerCourbeSemiLog{ O{} m }{% |
| 6103 |
% protection : si f(x) <= 0 → on renvoie une valeur hors fenêtre |
| 6104 |
\TracerCourbe[RestreindreY,#1]{log10(#2)-(\pflslogexpomin)}% |
| 6105 |
} |
| 6106 |
|
| 6107 |
\NewDocumentCommand\TracerCourbeLogLog{ O{} m }{% |
| 6108 |
% définition avec x réel → f(10^(x+expominx)) |
| 6109 |
\xintdeffloatfunc pfltmploglogfct(x) = #2 ;% |
| 6110 |
\TracerCourbe[RestreindreY,#1]{log10(pfltmploglogfct(10^(x+\pflslogexpominx)))-(\pflslogexpomin)}% |
| 6111 |
} |
| 6112 |
|
| 6113 |
\NewDocumentCommand\TracerNuageSemiLog{ O{} D<>{d} m m }{% |
| 6114 |
\setsepchar{,}% |
| 6115 |
\readlist*\LX{#3}% |
| 6116 |
\readlist*\LY{#4}% |
| 6117 |
\foreach \i in {1,...,\LXlen}{% |
| 6118 |
\itemtomacro\LX[\i]\tmpmavalx% |
| 6119 |
\itemtomacro\LY[\i]\tmpmavaly% |
| 6120 |
% transformation y → log10(y) - expomin |
| 6121 |
\xdef\tmpmavalytrans{\xintfloateval{log10(\tmpmavaly)-(\pflslogexpomin)}}% |
| 6122 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpmavalytrans)}% |
| 6123 |
}% |
| 6124 |
} |
| 6125 |
|
| 6126 |
\NewDocumentCommand\TracerNuageLogLog{ O{} D<>{d} m m }{% |
| 6127 |
\setsepchar{,}% |
| 6128 |
\readlist*\LX{#3}% |
| 6129 |
\readlist*\LY{#4}% |
| 6130 |
\foreach \i in {1,...,\LXlen}{% |
| 6131 |
\itemtomacro\LX[\i]\tmpmavalx% |
| 6132 |
\itemtomacro\LY[\i]\tmpmavaly% |
| 6133 |
% transformation x ET y |
| 6134 |
\xdef\tmpmavalxtrans{\xintfloateval{log10(\tmpmavalx)-(\pflslogexpominx)}}% |
| 6135 |
\xdef\tmpmavalytrans{\xintfloateval{log10(\tmpmavaly)-(\pflslogexpomin)}}% |
| 6136 |
\MarquerPts*[#1]{(\tmpmavalxtrans,\tmpmavalytrans)}% |
| 6137 |
}% |
| 6138 |
} |
| 6139 |
|
| 6140 |
%====LECTURE CSV ET TRACÉ |
| 6141 |
\defKV[GraphiqueTikzCSV]{% |
| 6142 |
Separateur=\def\pflcsvsep{#1},% |
| 6143 |
MaxLignes=\def\pflcsvmaxlignes{#1},% |
| 6144 |
ModeTransfo=\def\pflcsvmode{#1}% |
| 6145 |
} |
| 6146 |
\setKVdefault[GraphiqueTikzCSV]{% |
| 6147 |
Separateur=semicolon,% |
| 6148 |
MaxLignes=100000,% |
| 6149 |
ModeTransfo=lin% |
| 6150 |
} |
| 6151 |
|
| 6152 |
\NewDocumentCommand\CreerListesDepuisCSV{ O{} m m m m m }{% |
| 6153 |
% #1 = clés (Separateur, MaxLignes) |
| 6154 |
% #2 = fichier csv |
| 6155 |
% #3 = nom colonne X |
| 6156 |
% #4 = nom colonne Y |
| 6157 |
% #5 = nom macro liste X (sans \) |
| 6158 |
% #6 = nom macro liste Y (sans \) |
| 6159 |
\@ifpackageloaded{csvsimple}% |
| 6160 |
{% |
| 6161 |
\restoreKV[GraphiqueTikzCSV]% |
| 6162 |
\setKV[GraphiqueTikzCSV]{#1}% |
| 6163 |
\xdef\tmpcsvlistX{}% |
| 6164 |
\xdef\tmpcsvlistY{}% |
| 6165 |
\xdef\tmpcsvcompteur{0}% |
| 6166 |
\csvreader[head to column names,separator=\pflcsvsep]{#2}{}% |
| 6167 |
{% |
| 6168 |
\xintifboolexpr{\tmpcsvcompteur < \pflcsvmaxlignes}% |
| 6169 |
{% |
| 6170 |
\xdef\tmpvalX{\csname#3\endcsname}% |
| 6171 |
\xdef\tmpvalY{\csname#4\endcsname}% |
| 6172 |
\xdef\tmpcsvlistX{\tmpcsvlistX\ifx\tmpcsvlistX\empty\else,\fi\tmpvalX}% |
| 6173 |
\xdef\tmpcsvlistY{\tmpcsvlistY\ifx\tmpcsvlistY\empty\else,\fi\tmpvalY}% |
| 6174 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6175 |
}{}% |
| 6176 |
}% |
| 6177 |
\expandafter\xdef\csname#5\endcsname{\tmpcsvlistX}% |
| 6178 |
\expandafter\xdef\csname#6\endcsname{\tmpcsvlistY}% |
| 6179 |
}% |
| 6180 |
{% |
| 6181 |
\PackageWarning{tkz-grapheur}% |
| 6182 |
{csvsimple not loaded .: \CreerListesDepuisCSV or \CreateListsFromCSV not available :.}% |
| 6183 |
}% |
| 6184 |
} |
| 6185 |
\NewCommandCopy\CreateListsFromCSV\CreerListesDepuisCSV |
| 6186 |
|
| 6187 |
\NewDocumentCommand\TracerNuageDepuisCSV{ O{} D<>{} m m m }{% |
| 6188 |
% #1 = clés CSV (Mode, Separateur, MaxLignes) |
| 6189 |
% #2 = clés points pour \MarquerPts |
| 6190 |
% #3 = fichier csv |
| 6191 |
% #4 = nom colonne X |
| 6192 |
% #5 = nom colonne Y |
| 6193 |
\@ifpackageloaded{csvsimple}% |
| 6194 |
{% |
| 6195 |
\restoreKV[GraphiqueTikzCSV]% |
| 6196 |
\setKV[GraphiqueTikzCSV]{#1}% |
| 6197 |
\xdef\tmpcsvcompteur{0}% |
| 6198 |
\csvreader[% |
| 6199 |
head to column names,% |
| 6200 |
separator=\pflcsvsep% |
| 6201 |
]{#3}{}% |
| 6202 |
{% |
| 6203 |
\xintifboolexpr{\tmpcsvcompteur < \pflcsvmaxlignes}% |
| 6204 |
{% |
| 6205 |
\IfStrEqCase{\pflcsvmode}{% |
| 6206 |
{lin}{% |
| 6207 |
\xdef\tmpvalX{\csname#4\endcsname}% |
| 6208 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6209 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6210 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6211 |
}% |
| 6212 |
{xlog}{% |
| 6213 |
\xintifboolexpr{\csname#4\endcsname > 0}% |
| 6214 |
{% |
| 6215 |
\xdef\tmpvalX{\xintfloateval{log10(\csname#4\endcsname)}}% |
| 6216 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6217 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6218 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6219 |
}{}% |
| 6220 |
}% |
| 6221 |
{ylog}{% |
| 6222 |
\xintifboolexpr{\csname#5\endcsname > 0}% |
| 6223 |
{% |
| 6224 |
\xdef\tmpvalX{\csname#4\endcsname}% |
| 6225 |
\xdef\tmpvalY{\xintfloateval{log10(\csname#5\endcsname)}}% |
| 6226 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6227 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6228 |
}{}% |
| 6229 |
}% |
| 6230 |
{xylog}{% |
| 6231 |
\xintifboolexpr{% |
| 6232 |
\csname#4\endcsname > 0 && \csname#5\endcsname > 0}% |
| 6233 |
{% |
| 6234 |
\xdef\tmpvalX{\xintfloateval{log10(\csname#4\endcsname)}}% |
| 6235 |
\xdef\tmpvalY{\xintfloateval{log10(\csname#5\endcsname)}}% |
| 6236 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6237 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6238 |
}{}% |
| 6239 |
}% |
| 6240 |
{semilogy}{% |
| 6241 |
\xintifboolexpr{\csname#5\endcsname > 0}% |
| 6242 |
{% |
| 6243 |
\xdef\tmpvalX{\csname#4\endcsname}% |
| 6244 |
\xdef\tmpvalY{\xintfloateval{log10(\csname#5\endcsname)-\pflslogexpomin}}% |
| 6245 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6246 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6247 |
}{}% |
| 6248 |
}% |
| 6249 |
{semilogx}{% |
| 6250 |
\xintifboolexpr{\csname#4\endcsname > 0}% |
| 6251 |
{% |
| 6252 |
\xdef\tmpvalX{\xintfloateval{log10(\csname#4\endcsname)-\pflslogexpominx}}% |
| 6253 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6254 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6255 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6256 |
}{}% |
| 6257 |
}% |
| 6258 |
{loglog}{% |
| 6259 |
\xintifboolexpr{% |
| 6260 |
\csname#4\endcsname > 0 && \csname#5\endcsname > 0}% |
| 6261 |
{% |
| 6262 |
\xdef\tmpvalX{\xintfloateval{log10(\csname#4\endcsname)-\pflslogexpominx}}% |
| 6263 |
\xdef\tmpvalY{\xintfloateval{log10(\csname#5\endcsname)-\pflslogexpomin}}% |
| 6264 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6265 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6266 |
}{}% |
| 6267 |
}% |
| 6268 |
{lnx}{% |
| 6269 |
\xintifboolexpr{\csname#4\endcsname > 0}% |
| 6270 |
{\xdef\tmpvalX{\xintfloateval{ln(\csname#4\endcsname)}}% |
| 6271 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6272 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6273 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6274 |
}% |
| 6275 |
{lny}{% |
| 6276 |
\xintifboolexpr{\csname#5\endcsname > 0}% |
| 6277 |
{\xdef\tmpvalX{\csname#4\endcsname}% |
| 6278 |
\xdef\tmpvalY{\xintfloateval{ln(\csname#5\endcsname)}}% |
| 6279 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6280 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6281 |
}% |
| 6282 |
{lnxy}{% |
| 6283 |
\xintifboolexpr{\csname#4\endcsname > 0 && \csname#5\endcsname > 0}% |
| 6284 |
{\xdef\tmpvalX{\xintfloateval{ln(\csname#4\endcsname)}}% |
| 6285 |
\xdef\tmpvalY{\xintfloateval{ln(\csname#5\endcsname)}}% |
| 6286 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6287 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6288 |
}% |
| 6289 |
{log10x}{% |
| 6290 |
\xintifboolexpr{\csname#4\endcsname > 0}% |
| 6291 |
{\xdef\tmpvalX{\xintfloateval{log10(\csname#4\endcsname)}}% |
| 6292 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6293 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6294 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6295 |
}% |
| 6296 |
{log10y}{% |
| 6297 |
\xintifboolexpr{\csname#5\endcsname > 0}% |
| 6298 |
{\xdef\tmpvalX{\csname#4\endcsname}% |
| 6299 |
\xdef\tmpvalY{\xintfloateval{log10(\csname#5\endcsname)}}% |
| 6300 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6301 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6302 |
}% |
| 6303 |
{log10xy}{% |
| 6304 |
\xintifboolexpr{\csname#4\endcsname > 0 && \csname#5\endcsname > 0}% |
| 6305 |
{\xdef\tmpvalX{\xintfloateval{log10(\csname#4\endcsname)}}% |
| 6306 |
\xdef\tmpvalY{\xintfloateval{log10(\csname#5\endcsname)}}% |
| 6307 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6308 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6309 |
}% |
| 6310 |
{expx}{% |
| 6311 |
\xdef\tmpvalX{\xintfloateval{exp(\csname#4\endcsname)}}% |
| 6312 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6313 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6314 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6315 |
}% |
| 6316 |
{expy}{% |
| 6317 |
\xdef\tmpvalX{\csname#4\endcsname}% |
| 6318 |
\xdef\tmpvalY{\xintfloateval{exp(\csname#5\endcsname)}}% |
| 6319 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6320 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6321 |
}% |
| 6322 |
{expxy}{% |
| 6323 |
\xdef\tmpvalX{\xintfloateval{exp(\csname#4\endcsname)}}% |
| 6324 |
\xdef\tmpvalY{\xintfloateval{exp(\csname#5\endcsname)}}% |
| 6325 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6326 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6327 |
}% |
| 6328 |
{invx}{% |
| 6329 |
\xintifboolexpr{\csname#4\endcsname != 0}% |
| 6330 |
{\xdef\tmpvalX{\xintfloateval{1/(\csname#4\endcsname)}}% |
| 6331 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6332 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6333 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6334 |
}% |
| 6335 |
{invy}{% |
| 6336 |
\xintifboolexpr{\csname#5\endcsname != 0}% |
| 6337 |
{\xdef\tmpvalX{\csname#4\endcsname}% |
| 6338 |
\xdef\tmpvalY{\xintfloateval{1/(\csname#5\endcsname)}}% |
| 6339 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6340 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6341 |
}% |
| 6342 |
{invxy}{% |
| 6343 |
\xintifboolexpr{\csname#4\endcsname != 0 && \csname#5\endcsname != 0}% |
| 6344 |
{\xdef\tmpvalX{\xintfloateval{1/(\csname#4\endcsname)}}% |
| 6345 |
\xdef\tmpvalY{\xintfloateval{1/(\csname#5\endcsname)}}% |
| 6346 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6347 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6348 |
}% |
| 6349 |
{sqrtx}{% |
| 6350 |
\xintifboolexpr{\csname#4\endcsname >= 0}% |
| 6351 |
{\xdef\tmpvalX{\xintfloateval{sqrt(\csname#4\endcsname)}}% |
| 6352 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6353 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6354 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6355 |
}% |
| 6356 |
{sqrty}{% |
| 6357 |
\xintifboolexpr{\csname#5\endcsname >= 0}% |
| 6358 |
{\xdef\tmpvalX{\csname#4\endcsname}% |
| 6359 |
\xdef\tmpvalY{\xintfloateval{sqrt(\csname#5\endcsname)}}% |
| 6360 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6361 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6362 |
}% |
| 6363 |
{sqrtxy}{% |
| 6364 |
\xintifboolexpr{\csname#4\endcsname >= 0 && \csname#5\endcsname >= 0}% |
| 6365 |
{\xdef\tmpvalX{\xintfloateval{sqrt(\csname#4\endcsname)}}% |
| 6366 |
\xdef\tmpvalY{\xintfloateval{sqrt(\csname#5\endcsname)}}% |
| 6367 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6368 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}}{}% |
| 6369 |
}% |
| 6370 |
{carrex}{% |
| 6371 |
\xdef\tmpvalX{\xintfloateval{(\csname#4\endcsname)^2}}% |
| 6372 |
\xdef\tmpvalY{\csname#5\endcsname}% |
| 6373 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6374 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6375 |
}% |
| 6376 |
{carrey}{% |
| 6377 |
\xdef\tmpvalX{\csname#4\endcsname}% |
| 6378 |
\xdef\tmpvalY{\xintfloateval{(\csname#5\endcsname)^2}}% |
| 6379 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6380 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6381 |
}% |
| 6382 |
{carrexy}{% |
| 6383 |
\xdef\tmpvalX{\xintfloateval{(\csname#4\endcsname)^2}}% |
| 6384 |
\xdef\tmpvalY{\xintfloateval{(\csname#5\endcsname)^2}}% |
| 6385 |
\MarquerPts*[#2]{(\tmpvalX,\tmpvalY)}% |
| 6386 |
\xdef\tmpcsvcompteur{\inteval{\tmpcsvcompteur+1}}% |
| 6387 |
}% |
| 6388 |
}% |
| 6389 |
}% |
| 6390 |
{}% |
| 6391 |
}% |
| 6392 |
}% |
| 6393 |
{% |
| 6394 |
\PackageWarning{tkz-grapheur}% |
| 6395 |
{csvsimple not loaded .: \TracerNuageDepuisCSV or \PlotFromCSV not available :.}% |
| 6396 |
}% |
| 6397 |
} |
| 6398 |
\NewCommandCopy\PlotFromCSV\TracerNuageDepuisCSV |
| 6399 |
%\makeatother |
| 6400 |
|
| 6401 |
\NewDocumentCommand\TracerNuagePoints{ O{} m m }{% |
| 6402 |
% #1 = clés GraphiqueTikzRegLin (dont ModeTransfo) |
| 6403 |
% #2 = liste X |
| 6404 |
% #3 = liste Y |
| 6405 |
\restoreKV[GraphiqueTikzRegLin]% |
| 6406 |
\setKV[GraphiqueTikzRegLin]{#1}% |
| 6407 |
\setsepchar{,}% |
| 6408 |
\readlist*\tmpLX{#2}% |
| 6409 |
\readlist*\tmpLY{#3}% |
| 6410 |
\foreach \i in {1,...,\tmpLXlen}{% |
| 6411 |
\itemtomacro\tmpLX[\i]\tmpmavalx% |
| 6412 |
\itemtomacro\tmpLY[\i]\tmpmavaly% |
| 6413 |
\IfStrEqCase{\pflreglinmode}{% |
| 6414 |
{lin}{% |
| 6415 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpmavaly)}% |
| 6416 |
}% |
| 6417 |
{xlog}{% |
| 6418 |
\xintifboolexpr{\tmpmavalx > 0}% |
| 6419 |
{% |
| 6420 |
\xdef\tmpvalX{\xintfloateval{log10(\tmpmavalx)}}% |
| 6421 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6422 |
}{}% |
| 6423 |
}% |
| 6424 |
{ylog}{% |
| 6425 |
\xintifboolexpr{\tmpmavaly > 0}% |
| 6426 |
{% |
| 6427 |
\xdef\tmpvalY{\xintfloateval{log10(\tmpmavaly)}}% |
| 6428 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6429 |
}{}% |
| 6430 |
}% |
| 6431 |
{xylog}{% |
| 6432 |
\xintifboolexpr{\tmpmavalx > 0 && \tmpmavaly > 0}% |
| 6433 |
{% |
| 6434 |
\xdef\tmpvalX{\xintfloateval{log10(\tmpmavalx)}}% |
| 6435 |
\xdef\tmpvalY{\xintfloateval{log10(\tmpmavaly)}}% |
| 6436 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6437 |
}{}% |
| 6438 |
}% |
| 6439 |
{semilogy}{% |
| 6440 |
\xintifboolexpr{\tmpmavaly > 0}% |
| 6441 |
{% |
| 6442 |
\xdef\tmpvalY{\xintfloateval{log10(\tmpmavaly)-\pflslogexpomin}}% |
| 6443 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6444 |
}{}% |
| 6445 |
}% |
| 6446 |
{semilogx}{% |
| 6447 |
\xintifboolexpr{\tmpmavalx > 0}% |
| 6448 |
{% |
| 6449 |
\xdef\tmpvalX{\xintfloateval{log10(\tmpmavalx)-\pflslogexpominx}}% |
| 6450 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6451 |
}{}% |
| 6452 |
}% |
| 6453 |
{loglog}{% |
| 6454 |
\xintifboolexpr{\tmpmavalx > 0 && \tmpmavaly > 0}% |
| 6455 |
{% |
| 6456 |
\xdef\tmpvalX{\xintfloateval{log10(\tmpmavalx)-\pflslogexpominx}}% |
| 6457 |
\xdef\tmpvalY{\xintfloateval{log10(\tmpmavaly)-\pflslogexpomin}}% |
| 6458 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6459 |
}{}% |
| 6460 |
}% |
| 6461 |
{lnx}{% |
| 6462 |
\xintifboolexpr{\tmpmavalx > 0}% |
| 6463 |
{% |
| 6464 |
\xdef\tmpvalX{\xintfloateval{ln(\tmpmavalx)}}% |
| 6465 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6466 |
}{}% |
| 6467 |
}% |
| 6468 |
{lny}{% |
| 6469 |
\xintifboolexpr{\tmpmavaly > 0}% |
| 6470 |
{% |
| 6471 |
\xdef\tmpvalY{\xintfloateval{ln(\tmpmavaly)}}% |
| 6472 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6473 |
}{}% |
| 6474 |
}% |
| 6475 |
{lnxy}{% |
| 6476 |
\xintifboolexpr{\tmpmavalx > 0 && \tmpmavaly > 0}% |
| 6477 |
{% |
| 6478 |
\xdef\tmpvalX{\xintfloateval{ln(\tmpmavalx)}}% |
| 6479 |
\xdef\tmpvalY{\xintfloateval{ln(\tmpmavaly)}}% |
| 6480 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6481 |
}{}% |
| 6482 |
}% |
| 6483 |
{log10x}{% |
| 6484 |
\xintifboolexpr{\tmpmavalx > 0}% |
| 6485 |
{% |
| 6486 |
\xdef\tmpvalX{\xintfloateval{log10(\tmpmavalx)}}% |
| 6487 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6488 |
}{}% |
| 6489 |
}% |
| 6490 |
{log10y}{% |
| 6491 |
\xintifboolexpr{\tmpmavaly > 0}% |
| 6492 |
{% |
| 6493 |
\xdef\tmpvalY{\xintfloateval{log10(\tmpmavaly)}}% |
| 6494 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6495 |
}{}% |
| 6496 |
}% |
| 6497 |
{log10xy}{% |
| 6498 |
\xintifboolexpr{\tmpmavalx > 0 && \tmpmavaly > 0}% |
| 6499 |
{% |
| 6500 |
\xdef\tmpvalX{\xintfloateval{log10(\tmpmavalx)}}% |
| 6501 |
\xdef\tmpvalY{\xintfloateval{log10(\tmpmavaly)}}% |
| 6502 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6503 |
}{}% |
| 6504 |
}% |
| 6505 |
{expx}{% |
| 6506 |
\xdef\tmpvalX{\xintfloateval{exp(\tmpmavalx)}}% |
| 6507 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6508 |
}% |
| 6509 |
{expy}{% |
| 6510 |
\xdef\tmpvalY{\xintfloateval{exp(\tmpmavaly)}}% |
| 6511 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6512 |
}% |
| 6513 |
{expxy}{% |
| 6514 |
\xdef\tmpvalX{\xintfloateval{exp(\tmpmavalx)}}% |
| 6515 |
\xdef\tmpvalY{\xintfloateval{exp(\tmpmavaly)}}% |
| 6516 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6517 |
}% |
| 6518 |
{invx}{% |
| 6519 |
\xintifboolexpr{\tmpmavalx != 0}% |
| 6520 |
{% |
| 6521 |
\xdef\tmpvalX{\xintfloateval{1/(\tmpmavalx)}}% |
| 6522 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6523 |
}{}% |
| 6524 |
}% |
| 6525 |
{invy}{% |
| 6526 |
\xintifboolexpr{\tmpmavaly != 0}% |
| 6527 |
{% |
| 6528 |
\xdef\tmpvalY{\xintfloateval{1/(\tmpmavaly)}}% |
| 6529 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6530 |
}{}% |
| 6531 |
}% |
| 6532 |
{invxy}{% |
| 6533 |
\xintifboolexpr{\tmpmavalx != 0 && \tmpmavaly != 0}% |
| 6534 |
{% |
| 6535 |
\xdef\tmpvalX{\xintfloateval{1/(\tmpmavalx)}}% |
| 6536 |
\xdef\tmpvalY{\xintfloateval{1/(\tmpmavaly)}}% |
| 6537 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6538 |
}{}% |
| 6539 |
}% |
| 6540 |
{sqrtx}{% |
| 6541 |
\xintifboolexpr{\tmpmavalx >= 0}% |
| 6542 |
{% |
| 6543 |
\xdef\tmpvalX{\xintfloateval{sqrt(\tmpmavalx)}}% |
| 6544 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6545 |
}{}% |
| 6546 |
}% |
| 6547 |
{sqrty}{% |
| 6548 |
\xintifboolexpr{\tmpmavaly >= 0}% |
| 6549 |
{% |
| 6550 |
\xdef\tmpvalY{\xintfloateval{sqrt(\tmpmavaly)}}% |
| 6551 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6552 |
}{}% |
| 6553 |
}% |
| 6554 |
{sqrtxy}{% |
| 6555 |
\xintifboolexpr{\tmpmavalx >= 0 && \tmpmavaly >= 0}% |
| 6556 |
{% |
| 6557 |
\xdef\tmpvalX{\xintfloateval{sqrt(\tmpmavalx)}}% |
| 6558 |
\xdef\tmpvalY{\xintfloateval{sqrt(\tmpmavaly)}}% |
| 6559 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6560 |
}{}% |
| 6561 |
}% |
| 6562 |
{carrex}{% |
| 6563 |
\xdef\tmpvalX{\xintfloateval{(\tmpmavalx)^2}}% |
| 6564 |
\MarquerPts*[#1]{(\tmpvalX,\tmpmavaly)}% |
| 6565 |
}% |
| 6566 |
{carrey}{% |
| 6567 |
\xdef\tmpvalY{\xintfloateval{(\tmpmavaly)^2}}% |
| 6568 |
\MarquerPts*[#1]{(\tmpmavalx,\tmpvalY)}% |
| 6569 |
}% |
| 6570 |
{carrexy}{% |
| 6571 |
\xdef\tmpvalX{\xintfloateval{(\tmpmavalx)^2}}% |
| 6572 |
\xdef\tmpvalY{\xintfloateval{(\tmpmavaly)^2}}% |
| 6573 |
\MarquerPts*[#1]{(\tmpvalX,\tmpvalY)}% |
| 6574 |
}% |
| 6575 |
}% |
| 6576 |
}% |
| 6577 |
} |
| 6578 |
\NewCommandCopy\PlotPoints\TracerNuagePoints |
| 6579 |
|
| 6580 |
%====DIAGRAMME EN BÂTONS (données statistiques quelconques) |
| 6581 |
\defKV[tkzDiagBatons]{% |
| 6582 |
CouleurTraits=\def\tkzDiagBatCouleurTraits{#1},% |
| 6583 |
Couleurs=\def\tkzDiagBatCouleurs{#1},% |
| 6584 |
Style=\def\tkzDiagBatStyle{#1},% |
| 6585 |
Largeur=\def\tkzDiagBatLargeur{#1},% |
| 6586 |
Arrondi=\def\tkzDiagBatArrondi{#1},% |
| 6587 |
CouleurValeurs=\def\tkzDiagBatColVal{#1}% |
| 6588 |
} |
| 6589 |
\setKVdefault[tkzDiagBatons]{% |
| 6590 |
CouleurTraits=black,% |
| 6591 |
Couleurs={black},% |
| 6592 |
Style=batons,% |
| 6593 |
Largeur=0.8,% |
| 6594 |
AffValeurs=false,% |
| 6595 |
Arrondi=0,% |
| 6596 |
CouleurValeurs=black% |
| 6597 |
} |
| 6598 |
|
| 6599 |
\NewDocumentCommand\TracerDiagrammeBatons{ O{} m }{% |
| 6600 |
% #1 = clés |
| 6601 |
% #2 = série : x1/y1,x2/y2,... |
| 6602 |
\restoreKV[tkzDiagBatons]% |
| 6603 |
\setKV[tkzDiagBatons]{#1}% |
| 6604 |
% lecture de la liste de couleurs (cyclique) |
| 6605 |
\setsepchar{,}% |
| 6606 |
\readlist*\tkzDiagBatListeCoul{\tkzDiagBatCouleurs}% |
| 6607 |
% lecture des données |
| 6608 |
\setsepchar[.]{,./}% |
| 6609 |
\readlist*\tkzDiagBatListe{#2}% |
| 6610 |
% demi-largeur pour le style histo |
| 6611 |
\xdef\tkzDiagBatDemiLarg{\xintfloateval{\tkzDiagBatLargeur/2}}% |
| 6612 |
% tracé barre par barre |
| 6613 |
\foreach \i in {1,...,\tkzDiagBatListelen}{% |
| 6614 |
\itemtomacro\tkzDiagBatListe[\i,1]\tkzDiagBatX% |
| 6615 |
\itemtomacro\tkzDiagBatListe[\i,2]\tkzDiagBatY% |
| 6616 |
% couleur cyclique selon l'indice |
| 6617 |
\itemcycltomacro\tkzDiagBatListeCoul[\i]\tkzDiagBatCoulCour% |
| 6618 |
% coordonnées pré-calculées pour le style histo |
| 6619 |
\xdef\tkzDiagBatXmin{\xintfloateval{\tkzDiagBatX-\tkzDiagBatDemiLarg}}% |
| 6620 |
\xdef\tkzDiagBatHauteur{\xintfloateval{\tkzDiagBatY-\pflymin}}% |
| 6621 |
% tracé : bâton ou rectangle |
| 6622 |
\IfStrEq{\tkzDiagBatStyle}{batons}% |
| 6623 |
{% |
| 6624 |
\draw[pflbarresprobas,\tkzDiagBatCoulCour]% |
| 6625 |
({\tkzDiagBatX},{\pflymin}) -- ({\tkzDiagBatX},{\tkzDiagBatY}) ;% |
| 6626 |
}% |
| 6627 |
{% |
| 6628 |
\draw[pfltrait,\tkzDiagBatCouleurTraits,fill=\tkzDiagBatCoulCour,fill opacity=0.5]% |
| 6629 |
({\tkzDiagBatXmin},{\pflymin})% |
| 6630 |
rectangle++ ({\tkzDiagBatLargeur},{\tkzDiagBatHauteur}) ;% |
| 6631 |
}% |
| 6632 |
% affichage de la valeur au-dessus de la barre |
| 6633 |
\ifboolKV[tkzDiagBatons]{AffValeurs}% |
| 6634 |
{% |
| 6635 |
\node[\tkzDiagBatColVal,pfllabeleffectifs,above]% |
| 6636 |
at ({\tkzDiagBatX},{\tkzDiagBatY})% |
| 6637 |
{\num{\tkzDiagBatY}} ;% |
| 6638 |
}% |
| 6639 |
{}% |
| 6640 |
}% |
| 6641 |
} |
| 6642 |
|
| 6643 |
%====HISTOGRAMME (données statistiques quelconques, classes régulières ou non) |
| 6644 |
\defKV[tkzHistoStat]{% |
| 6645 |
CouleurTraits=\def\tkzHistoStatCouleurtraits{#1},% |
| 6646 |
Couleurs=\def\tkzHistoStatCouleurs{#1},% |
| 6647 |
CouleurValeurs=\def\tkzHistoStatColVal{#1},% |
| 6648 |
PosValeurs=\def\tkzHistoStatPosVal{#1}% |
| 6649 |
} |
| 6650 |
\setKVdefault[tkzHistoStat]{% |
| 6651 |
CouleurTraits=black,% |
| 6652 |
Couleurs={black},% |
| 6653 |
Densite=false,% |
| 6654 |
AffValeurs=false,% |
| 6655 |
CouleurValeurs=black,% |
| 6656 |
PosValeurs=above% |
| 6657 |
} |
| 6658 |
|
| 6659 |
\NewDocumentCommand\TracerHistogramme{ O{} m }{% |
| 6660 |
% #1 = clés |
| 6661 |
% #2 = données : bi1/bs1/eff1,bi2/bs2/eff2,... |
| 6662 |
\restoreKV[tkzHistoStat]% |
| 6663 |
\setKV[tkzHistoStat]{#1}% |
| 6664 |
% lecture de la liste de couleurs (cyclique) |
| 6665 |
\setsepchar{,}% |
| 6666 |
\readlist*\tkzHistoStatListeCoul{\tkzHistoStatCouleurs}% |
| 6667 |
% lecture des données |
| 6668 |
\setsepchar[.]{,./}% |
| 6669 |
\readlist*\tkzHistoStatListe{#2}% |
| 6670 |
% tracé classe par classe |
| 6671 |
\foreach \i in {1,...,\tkzHistoStatListelen}{% |
| 6672 |
\itemtomacro\tkzHistoStatListe[\i,1]\tkzHistoStatBI% |
| 6673 |
\itemtomacro\tkzHistoStatListe[\i,2]\tkzHistoStatBS% |
| 6674 |
\itemtomacro\tkzHistoStatListe[\i,3]\tkzHistoStatEff% |
| 6675 |
% couleur cyclique selon l'indice |
| 6676 |
\itemcycltomacro\tkzHistoStatListeCoul[\i]\tkzHistoStatCoulCour% |
| 6677 |
% hauteur : effectif brut ou densité = effectif / amplitude |
| 6678 |
\ifboolKV[tkzHistoStat]{Densite}% |
| 6679 |
{% |
| 6680 |
\xdef\tkzHistoStatH{% |
| 6681 |
\xintfloateval{(\tkzHistoStatEff)/((\tkzHistoStatBS)-(\tkzHistoStatBI))}}% |
| 6682 |
}% |
| 6683 |
{\xdef\tkzHistoStatH{\tkzHistoStatEff}}% |
| 6684 |
% hauteur du rectangle dans le repère |
| 6685 |
\xdef\tkzHistoStatHrect{\xintfloateval{\tkzHistoStatH-(\pflymin)}}% |
| 6686 |
% tracé du rectangle |
| 6687 |
\draw[pfltrait,\tkzHistoStatCouleurtraits,fill=\tkzHistoStatCoulCour,fill opacity=0.5]% |
| 6688 |
({\tkzHistoStatBI},{\pflymin})% |
| 6689 |
rectangle++ ({\tkzHistoStatBS-(\tkzHistoStatBI)},{\tkzHistoStatHrect}) ;% |
| 6690 |
% affichage de la valeur |
| 6691 |
\ifboolKV[tkzHistoStat]{AffValeurs}% |
| 6692 |
{% |
| 6693 |
\xdef\tkzHistoStatMilieu{\xintfloateval{(\tkzHistoStatBI+(\tkzHistoStatBS))/2}}% |
| 6694 |
\node[\tkzHistoStatPosVal,\tkzHistoStatColVal,pfllabeleffectifs]% |
| 6695 |
at ({\tkzHistoStatMilieu},{\tkzHistoStatH})% |
| 6696 |
{\num{\tkzHistoStatEff}} ;% |
| 6697 |
}% |
| 6698 |
{}% |
| 6699 |
}% |
| 6700 |
} |
| 6701 |
|
| 6702 |
%====CARREAU DE RÉFÉRENCE POUR HISTOGRAMME EN DENSITÉ |
| 6703 |
\defKV[tkzCarrDensite]{% |
| 6704 |
Couleur=\def\tkzCarrCouleur{#1},% |
| 6705 |
CouleurBordure=\def\tkzCarrColBord{#1},% |
| 6706 |
Opacite=\def\tkzCarrOpacite{#1},% |
| 6707 |
Police=\def\tkzCarrPolice{#1},% |
| 6708 |
Legende=\def\tkzCarrLegende{#1} |
| 6709 |
} |
| 6710 |
\setKVdefault[tkzCarrDensite]{% |
| 6711 |
Couleur=gray,% |
| 6712 |
CouleurBordure=black,% |
| 6713 |
Opacite=0.5,% |
| 6714 |
Police=\normalsize\normalfont,% |
| 6715 |
Legende={} |
| 6716 |
} |
| 6717 |
|
| 6718 |
\NewDocumentCommand\PlaceCarreauHistoDensite{ O{} m m m m }{% |
| 6719 |
% #1 = clés |
| 6720 |
% #2 = x coin bas-gauche (unités du repère) |
| 6721 |
% #3 = y coin bas-gauche (unités du repère) |
| 6722 |
% #4 = largeur (unités x → amplitude) |
| 6723 |
% #5 = hauteur (unités y → densité) |
| 6724 |
% aire = #4 × #5 = effectif correspondant |
| 6725 |
\restoreKV[tkzCarrDensite]% |
| 6726 |
\setKV[tkzCarrDensite]{#1}% |
| 6727 |
% calcul de l'effectif représenté par ce carreau |
| 6728 |
\xdef\tkzCarrAire{\xintfloateval{(#4)*(#5)}}% |
| 6729 |
% label : fourni ou calculé automatiquement |
| 6730 |
\IfStrEq{\tkzCarrLegende}{}% |
| 6731 |
{\def\tkzCarrLabel{$\equiv \num{\tkzCarrAire}$ individu(s)}}% |
| 6732 |
{\def\tkzCarrLabel{\tkzCarrLegende}}% |
| 6733 |
% tracé du carreau |
| 6734 |
\draw[pfltrait,\tkzCarrColBord,fill=\tkzCarrCouleur,fill opacity=\tkzCarrOpacite]% |
| 6735 |
({#2},{#3}) rectangle++ ({#4},{#5}) ; |
| 6736 |
% label positionné au milieu |
| 6737 |
\node[font=\tkzCarrPolice]% |
| 6738 |
at ({(#2)+0.5*(#4)},{(#3)+0.5*(#5)}) {\tkzCarrLabel} ;% |
| 6739 |
} |
| 6740 |
|
| 6741 |
%====BOÎTE À MOUSTACHES |
| 6742 |
\defKV[tkzBoiteMoustaches]{% |
| 6743 |
Couleur=\def\tkzBaMCouleur{#1},% |
| 6744 |
CouleurPointilles=\def\tkzBaMCouleurTraits{#1},% |
| 6745 |
Elevation=\def\tkzBaMElevation{#1},% |
| 6746 |
Hauteur=\def\tkzBaMHauteur{#1},% |
| 6747 |
Moyenne=\def\tkzBaMMoyenne{#1},% |
| 6748 |
Remplissage=\def\tkzBaMRemplissage{#1},% |
| 6749 |
Arrondi=\def\tkzBaMArrondi{#1}% |
| 6750 |
} |
| 6751 |
\setKVdefault[tkzBoiteMoustaches]{% |
| 6752 |
Couleur=black,% |
| 6753 |
CouleurPointilles=black,% |
| 6754 |
Elevation=0,% |
| 6755 |
Hauteur=1,% |
| 6756 |
AffMoyenne=false,% |
| 6757 |
Moyenne=0,% |
| 6758 |
Pointilles=false,% |
| 6759 |
Valeurs=false,% |
| 6760 |
Remplissage=white,% |
| 6761 |
Arrondi=0,% |
| 6762 |
Regroup=false |
| 6763 |
} |
| 6764 |
|
| 6765 |
% macro interne : dessin à partir de 5 params déjà extraits |
| 6766 |
\NewDocumentCommand\tkzg@bam@draw{ m m m m m m }{% |
| 6767 |
% #1=clés #2=min #3=Q1 #4=med #5=Q3 #6=max |
| 6768 |
\xdef\tkzBaMbas{\xintfloateval{\tkzBaMElevation-(\tkzBaMHauteur)/2}}% |
| 6769 |
\xdef\tkzBaMhaut{\xintfloateval{\tkzBaMElevation+(\tkzBaMHauteur)/2}}% |
| 6770 |
% pointillés vers l'axe Ox, en sous-impression ;-) |
| 6771 |
\ifboolKV[tkzBoiteMoustaches]{Pointilles}% |
| 6772 |
{% |
| 6773 |
\draw[pfltraitantec,\tkzBaMCouleurTraits]% |
| 6774 |
({#2},{\tkzBaMbas}) -- ({#2},{\pflOy})% |
| 6775 |
({#3},{\tkzBaMbas}) -- ({#3},{\pflOy})% |
| 6776 |
({#4},{\tkzBaMbas}) -- ({#4},{\pflOy})% |
| 6777 |
({#5},{\tkzBaMbas}) -- ({#5},{\pflOy})% |
| 6778 |
({#6},{\tkzBaMbas}) -- ({#6},{\pflOy}) ;% |
| 6779 |
}% |
| 6780 |
{}% |
| 6781 |
% boîte Q1--Q3 |
| 6782 |
\draw[pflcourbe,\tkzBaMCouleur,fill=\tkzBaMRemplissage]% |
| 6783 |
({#3},{\tkzBaMbas}) rectangle ({#5},{\tkzBaMhaut}) ;% |
| 6784 |
% moustaches horizontales |
| 6785 |
\draw[pflcourbe,\tkzBaMCouleur]% |
| 6786 |
({#2},{\tkzBaMElevation}) -- ({#3},{\tkzBaMElevation})% |
| 6787 |
({#5},{\tkzBaMElevation}) -- ({#6},{\tkzBaMElevation}) ;% |
| 6788 |
% barres verticales : min, médiane, max |
| 6789 |
\draw[pflcourbe,\tkzBaMCouleur]% |
| 6790 |
({#2},{\tkzBaMbas}) -- ({#2},{\tkzBaMhaut})% |
| 6791 |
({#6},{\tkzBaMbas}) -- ({#6},{\tkzBaMhaut})% |
| 6792 |
({#4},{\tkzBaMbas}) -- ({#4},{\tkzBaMhaut}) ;% |
| 6793 |
% moyenne optionnelle |
| 6794 |
\ifboolKV[tkzBoiteMoustaches]{AffMoyenne}% |
| 6795 |
{\filldraw[\tkzBaMCouleur] ({\tkzBaMMoyenne},{\tkzBaMElevation}) circle[pflpointmc] ;}% |
| 6796 |
{}% |
| 6797 |
% valeurs des 5 paramètres sur l'axe Ox |
| 6798 |
\ifboolKV[tkzBoiteMoustaches]{Valeurs}% |
| 6799 |
{% |
| 6800 |
\foreach \tkzBaMval in {#2,#3,#4,#5,#6}{% |
| 6801 |
\draw[\tkzBaMCouleur]% |
| 6802 |
({\tkzBaMval},{\pflOy}) node[below,pfllabeleffectifs]% |
| 6803 |
{\ArrondirNum[\tkzBaMArrondi]{\tkzBaMval}} ;% |
| 6804 |
}% |
| 6805 |
}% |
| 6806 |
{}% |
| 6807 |
} |
| 6808 |
|
| 6809 |
\NewDocumentCommand\TracerBoiteMoustaches{ s O{} m }{% |
| 6810 |
% version normale : #3 = min/Q1/mediane/Q3/max (valeurs explicites) |
| 6811 |
% version étoilée : #3 = liste CSV brute (calcul auto des params) |
| 6812 |
\restoreKV[tkzBoiteMoustaches]% |
| 6813 |
\setKV[tkzBoiteMoustaches]{#2}% |
| 6814 |
\IfBooleanTF{#1}% |
| 6815 |
{% |
| 6816 |
% calcul des 5 paramètres depuis la liste brute (données individuelles ou groupées) |
| 6817 |
\ifboolKV[tkzBoiteMoustaches]{Regroup}% |
| 6818 |
{% |
| 6819 |
\tkzgCalcParamStats*{#3}% |
| 6820 |
[\tkzBaMautomin][\tkzBaMautoquun][\tkzBaMautomed][\tkzBaMautoqutr][\tkzBaMautomax]% |
| 6821 |
}% |
| 6822 |
{% |
| 6823 |
\tkzgCalcParamStats{#3}% |
| 6824 |
[\tkzBaMautomin][\tkzBaMautoquun][\tkzBaMautomed][\tkzBaMautoqutr][\tkzBaMautomax]% |
| 6825 |
}% |
| 6826 |
\tkzg@bam@draw{}% |
| 6827 |
{\tkzBaMautomin}{\tkzBaMautoquun}{\tkzBaMautomed}% |
| 6828 |
{\tkzBaMautoqutr}{\tkzBaMautomax}% |
| 6829 |
}% |
| 6830 |
{% |
| 6831 |
% lecture des 5 paramètres explicites (format min/Q1/med/Q3/max) |
| 6832 |
\setsepchar[.]{/}% |
| 6833 |
\readlist*\tkzBaMParams{#3}% |
| 6834 |
\itemtomacro\tkzBaMParams[1]\tkzBaMp@min% |
| 6835 |
\itemtomacro\tkzBaMParams[2]\tkzBaMp@qu% |
| 6836 |
\itemtomacro\tkzBaMParams[3]\tkzBaMp@med% |
| 6837 |
\itemtomacro\tkzBaMParams[4]\tkzBaMp@qt% |
| 6838 |
\itemtomacro\tkzBaMParams[5]\tkzBaMp@max% |
| 6839 |
\tkzg@bam@draw{}% |
| 6840 |
{\tkzBaMp@min}{\tkzBaMp@qu}{\tkzBaMp@med}% |
| 6841 |
{\tkzBaMp@qt}{\tkzBaMp@max}% |
| 6842 |
}% |
| 6843 |
} |
| 6844 |
|
| 6845 |
%====DIAGRAMME CIRCULAIRE |
| 6846 |
\defKV[GraphiqueTikzCamembert]{% |
| 6847 |
CouleurDefaut=\def\pflcamcouldef{#1},% |
| 6848 |
RayonInt=\def\pflcamrayonint{#1},% |
| 6849 |
Rayon=\def\pflcamrayon{#1},% |
| 6850 |
Titre=\def\pflcamtitre{#1},% |
| 6851 |
NomGraphique=\def\pflcamnomgraph{#1}% |
| 6852 |
} |
| 6853 |
\setKVdefault[GraphiqueTikzCamembert]{% |
| 6854 |
CouleurDefaut=lightgray,% |
| 6855 |
RayonInt=1.75,% |
| 6856 |
Rayon=3,% |
| 6857 |
Titre={},% |
| 6858 |
NomGraphique={} |
| 6859 |
} |
| 6860 |
|
| 6861 |
\defKV[GraphiqueTikzCamembertLeg]{% |
| 6862 |
TailleCarreau=\def\pflcamlegtaille{#1},% |
| 6863 |
Arrondi=\def\pflcamlegarrondi{#1},% |
| 6864 |
Espacement=\def\pflcamespleg{#1},% |
| 6865 |
DecalEst=\def\pflcamdecalest{#1}% |
| 6866 |
} |
| 6867 |
\setKVdefault[GraphiqueTikzCamembertLeg]{% |
| 6868 |
TailleCarreau=0.28,% |
| 6869 |
Pct=true,% |
| 6870 |
Arrondi=0,% |
| 6871 |
Espacement=0.55,% |
| 6872 |
DecalEst=0.4% |
| 6873 |
} |
| 6874 |
|
| 6875 |
%====DIAGRAMME |
| 6876 |
\NewDocumentCommand\DiagrammeCirculaire{ O{} m }{% |
| 6877 |
\restoreKV[GraphiqueTikzCamembert]% |
| 6878 |
\setKV[GraphiqueTikzCamembert]{#1}% |
| 6879 |
\setsepchar[.]{,./}% |
| 6880 |
\readlist*\pflcamlist{#2}% |
| 6881 |
% calcul du total |
| 6882 |
\xdef\pflcamtotalglobal{0}% |
| 6883 |
\xintFor* ##1 in {\xintSeq{1}{\pflcamlistlen}} \do{% |
| 6884 |
\itemtomacro\pflcamlist[##1,2]\tmpval% |
| 6885 |
\xdef\pflcamtotalglobal{\xintfloateval{\pflcamtotalglobal+\tmpval}}% |
| 6886 |
}% |
| 6887 |
% nœuds cardinaux |
| 6888 |
\IfEq{\pflcamnomgraph}{}% |
| 6889 |
{% |
| 6890 |
\coordinate (cam-centre) at (0,0) ;% |
| 6891 |
\coordinate (cam-nord) at (0,\pflcamrayon) ;% |
| 6892 |
\coordinate (cam-sud) at (0,-\pflcamrayon) ;% |
| 6893 |
\coordinate (cam-est) at (\pflcamrayon,0) ;% |
| 6894 |
\coordinate (cam-ouest) at (-\pflcamrayon,0) ;% |
| 6895 |
}% |
| 6896 |
{% |
| 6897 |
\coordinate (\pflcamnomgraph-cam-centre) at (0,0) ;% |
| 6898 |
\coordinate (\pflcamnomgraph-cam-nord) at (0,\pflcamrayon) ;% |
| 6899 |
\coordinate (\pflcamnomgraph-cam-sud) at (0,-\pflcamrayon) ;% |
| 6900 |
\coordinate (\pflcamnomgraph-cam-est) at (\pflcamrayon,0) ;% |
| 6901 |
\coordinate (\pflcamnomgraph-cam-ouest) at (-\pflcamrayon,0) ;% |
| 6902 |
}% |
| 6903 |
% tracé des secteurs + nœuds |
| 6904 |
\xdef\pflcamangle{90}% |
| 6905 |
\xintFor* ##1 in {\xintSeq{1}{\pflcamlistlen}} \do{% |
| 6906 |
\itemtomacro\pflcamlist[##1,2]\tmpval% |
| 6907 |
\itemtomacro\pflcamlist[##1,3]\tmpcoulcam% |
| 6908 |
\itemtomacro\pflcamlist[##1,4]\tmptypecam% |
| 6909 |
\IfEq{\tmpcoulcam}{}% |
| 6910 |
{\def\tmpcoulcam{\pflcamcouldef}}% |
| 6911 |
{} |
| 6912 |
\IfEq{\tmptypecam}{}% |
| 6913 |
{\def\tmptypecam{solid}}% |
| 6914 |
{} |
| 6915 |
\xdef\pflcamsectangle{\xintfloateval{360*\tmpval/\pflcamtotalglobal}}% |
| 6916 |
\xdef\pflcamanglefin{\xintfloateval{\pflcamangle-\pflcamsectangle}}% |
| 6917 |
\xdef\pflcamanglemil{\xintfloateval{\pflcamangle-\pflcamsectangle/2}}% |
| 6918 |
\IfEq{\tmptypecam}{solid}% |
| 6919 |
{% |
| 6920 |
\draw[fill=\tmpcoulcam,pfltraitcamembert] (0,0) |
| 6921 |
-- (\pflcamangle:\pflcamrayon) |
| 6922 |
arc (\pflcamangle:\pflcamanglefin:\pflcamrayon) |
| 6923 |
-- cycle ;% |
| 6924 |
}% |
| 6925 |
{% |
| 6926 |
\draw[pattern={\tmptypecam},pattern color={\tmpcoulcam},pfltraitcamembert] (0,0) |
| 6927 |
-- (\pflcamangle:\pflcamrayon) |
| 6928 |
arc (\pflcamangle:\pflcamanglefin:\pflcamrayon) |
| 6929 |
-- cycle ;% |
| 6930 |
}% |
| 6931 |
\IfEq{\pflcamnomgraph}{}% |
| 6932 |
{% |
| 6933 |
\coordinate (cam-##1-debut) at (\pflcamangle:\pflcamrayon) ;% |
| 6934 |
\coordinate (cam-##1-fin) at (\pflcamanglefin:\pflcamrayon) ;% |
| 6935 |
\coordinate (cam-##1-mil) at (\pflcamanglemil:\pflcamrayon) ;% |
| 6936 |
\coordinate (cam-##1-int) at (\pflcamanglemil:{0.68*\pflcamrayon}) ;% |
| 6937 |
\coordinate (cam-##1-ext) at (\pflcamanglemil:{1.15*\pflcamrayon}) ;% |
| 6938 |
}% |
| 6939 |
{% |
| 6940 |
\coordinate (\pflcamnomgraph-cam-##1-debut) at (\pflcamangle:\pflcamrayon) ;% |
| 6941 |
\coordinate (\pflcamnomgraph-cam-##1-fin) at (\pflcamanglefin:\pflcamrayon) ;% |
| 6942 |
\coordinate (\pflcamnomgraph-cam-##1-mil) at (\pflcamanglemil:\pflcamrayon) ;% |
| 6943 |
\coordinate (\pflcamnomgraph-cam-##1-int) at (\pflcamanglemil:{0.68*\pflcamrayon}) ;% |
| 6944 |
\coordinate (\pflcamnomgraph-cam-##1-ext) at (\pflcamanglemil:{1.15*\pflcamrayon}) ;% |
| 6945 |
}% |
| 6946 |
\xdef\pflcamangle{\pflcamanglefin}% |
| 6947 |
}% |
| 6948 |
\draw[pfltraitcamembert] (0,0) circle (\pflcamrayon) ;% |
| 6949 |
\IfStrEq{\pflcamtitre}{}{}% |
| 6950 |
{\node[pfllegendetitre] at (cam-nord) {\pflcamtitre} ;}% |
| 6951 |
} |
| 6952 |
|
| 6953 |
\NewCommandCopy\TracerDiagrammeCirculaire\DiagrammeCirculaire |
| 6954 |
|
| 6955 |
\NewDocumentCommand\TracerDiagrammeAnneau{ O{} m }{% |
| 6956 |
\restoreKV[GraphiqueTikzCamembert]% |
| 6957 |
\setKV[GraphiqueTikzCamembert]{#1}% |
| 6958 |
\setsepchar[.]{,./}% |
| 6959 |
\readlist*\pflcamlist{#2}% |
| 6960 |
% calcul du total |
| 6961 |
\xdef\pflcamtotalglobal{0}% |
| 6962 |
\xintFor* ##1 in {\xintSeq{1}{\pflcamlistlen}} \do{% |
| 6963 |
\itemtomacro\pflcamlist[##1,2]\tmpval% |
| 6964 |
\xdef\pflcamtotalglobal{\xintfloateval{\pflcamtotalglobal+\tmpval}}% |
| 6965 |
}% |
| 6966 |
% nœuds cardinaux |
| 6967 |
\IfEq{\pflcamnomgraph}{}% |
| 6968 |
{% |
| 6969 |
\coordinate (cam-centre) at (0,0) ;% |
| 6970 |
\coordinate (cam-nord) at (0,\pflcamrayon) ;% |
| 6971 |
\coordinate (cam-sud) at (0,-\pflcamrayon) ;% |
| 6972 |
\coordinate (cam-est) at (\pflcamrayon,0) ;% |
| 6973 |
\coordinate (cam-ouest) at (-\pflcamrayon,0) ;% |
| 6974 |
}% |
| 6975 |
{% |
| 6976 |
\coordinate (\pflcamnomgraph-cam-centre) at (0,0) ;% |
| 6977 |
\coordinate (\pflcamnomgraph-cam-nord) at (0,\pflcamrayon) ;% |
| 6978 |
\coordinate (\pflcamnomgraph-cam-sud) at (0,-\pflcamrayon) ;% |
| 6979 |
\coordinate (\pflcamnomgraph-cam-est) at (\pflcamrayon,0) ;% |
| 6980 |
\coordinate (\pflcamnomgraph-cam-ouest) at (-\pflcamrayon,0) ;% |
| 6981 |
}% |
| 6982 |
% tracé des secteurs + nœuds |
| 6983 |
\xdef\pflcamangle{90}% |
| 6984 |
\begin{scope} |
| 6985 |
%\clip[even odd rule] (0,0) circle (\pflcamrayon) (0,0) circle (\pflcamrayonint) ; |
| 6986 |
% tracé des secteurs |
| 6987 |
\xintFor* ##1 in {\xintSeq{1}{\pflcamlistlen}} \do{% |
| 6988 |
\itemtomacro\pflcamlist[##1,2]\tmpval% |
| 6989 |
\itemtomacro\pflcamlist[##1,3]\tmpcoulcam% |
| 6990 |
\itemtomacro\pflcamlist[##1,4]\tmptypecam% |
| 6991 |
\IfEq{\tmpcoulcam}{}% |
| 6992 |
{\def\tmpcoulcam{\pflcamcouldef}}% |
| 6993 |
{} |
| 6994 |
\IfEq{\tmptypecam}{}% |
| 6995 |
{\def\tmptypecam{solid}}% |
| 6996 |
{} |
| 6997 |
\xdef\pflcamsectangle{\xintfloateval{360*\tmpval/\pflcamtotalglobal}}% |
| 6998 |
\xdef\pflcamanglefin{\xintfloateval{\pflcamangle-\pflcamsectangle}}% |
| 6999 |
\xdef\pflcamanglemil{\xintfloateval{\pflcamangle-\pflcamsectangle/2}}% |
| 7000 |
\IfEq{\tmptypecam}{solid}% |
| 7001 |
{% |
| 7002 |
\draw[fill=\tmpcoulcam, pfltraitcamembert] |
| 7003 |
(\pflcamangle:\pflcamrayonint) % départ arc intérieur |
| 7004 |
-- (\pflcamangle:\pflcamrayon) % rayon de départ |
| 7005 |
arc (\pflcamangle:\pflcamanglefin:\pflcamrayon) % arc extérieur |
| 7006 |
-- (\pflcamanglefin:\pflcamrayonint) % rayon de fin |
| 7007 |
arc (\pflcamanglefin:\pflcamangle:\pflcamrayonint) % arc intérieur (sens inverse) |
| 7008 |
-- cycle ; |
| 7009 |
}% |
| 7010 |
{% |
| 7011 |
\draw[even odd rule,pattern={\tmptypecam},pattern color={\tmpcoulcam},pfltraitcamembert] |
| 7012 |
(\pflcamangle:\pflcamrayonint) % départ arc intérieur |
| 7013 |
-- (\pflcamangle:\pflcamrayon) % rayon de départ |
| 7014 |
arc (\pflcamangle:\pflcamanglefin:\pflcamrayon) % arc extérieur |
| 7015 |
-- (\pflcamanglefin:\pflcamrayonint) % rayon de fin |
| 7016 |
arc (\pflcamanglefin:\pflcamangle:\pflcamrayonint) % arc intérieur (sens inverse) |
| 7017 |
-- cycle ; |
| 7018 |
}% |
| 7019 |
\IfEq{\pflcamnomgraph}{}% |
| 7020 |
{% |
| 7021 |
\coordinate (cam-##1-debut) at (\pflcamangle:\pflcamrayon) ;% |
| 7022 |
\coordinate (cam-##1-fin) at (\pflcamanglefin:\pflcamrayon) ;% |
| 7023 |
\coordinate (cam-##1-mil) at (\pflcamanglemil:\pflcamrayon) ;% |
| 7024 |
\coordinate (cam-##1-int) at (\pflcamanglemil:{0.68*\pflcamrayon}) ;% |
| 7025 |
\coordinate (cam-##1-ext) at (\pflcamanglemil:{1.15*\pflcamrayon}) ;% |
| 7026 |
}% |
| 7027 |
{% |
| 7028 |
\coordinate (\pflcamnomgraph-cam-##1-debut) at (\pflcamangle:\pflcamrayon) ;% |
| 7029 |
\coordinate (\pflcamnomgraph-cam-##1-fin) at (\pflcamanglefin:\pflcamrayon) ;% |
| 7030 |
\coordinate (\pflcamnomgraph-cam-##1-mil) at (\pflcamanglemil:\pflcamrayon) ;% |
| 7031 |
\coordinate (\pflcamnomgraph-cam-##1-int) at (\pflcamanglemil:{0.68*\pflcamrayon}) ;% |
| 7032 |
\coordinate (\pflcamnomgraph-cam-##1-ext) at (\pflcamanglemil:{1.15*\pflcamrayon}) ;% |
| 7033 |
}% |
| 7034 |
\xdef\pflcamangle{\pflcamanglefin}% |
| 7035 |
}% |
| 7036 |
\end{scope} |
| 7037 |
\draw[pfltraitcamembert] (0,0) circle (\pflcamrayon) ;% |
| 7038 |
\draw[pfltraitcamembert] (0,0) circle (\pflcamrayonint) ;% |
| 7039 |
\IfStrEq{\pflcamtitre}{}{}% |
| 7040 |
{\node[pfllegendetitre] at (cam-nord) {\pflcamtitre} ;}% |
| 7041 |
} |
| 7042 |
|
| 7043 |
%====LÉGENDE — sous-tikzpicture ancré sur cam-est |
| 7044 |
\NewDocumentCommand\LegendeCirculaire{ O{} m }{% |
| 7045 |
\restoreKV[GraphiqueTikzCamembertLeg]% |
| 7046 |
\setKV[GraphiqueTikzCamembertLeg]{#1}% |
| 7047 |
\setsepchar[.]{,./}% |
| 7048 |
\readlist*\pflcamleglist{#2}% |
| 7049 |
% calcul du total |
| 7050 |
\xdef\pflcamlegtotal{0}% |
| 7051 |
\xintFor* ##1 in {\xintSeq{1}{\pflcamleglistlen}} \do{% |
| 7052 |
\itemtomacro\pflcamleglist[##1,2]\tmpval% |
| 7053 |
\xdef\pflcamlegtotal{\xintfloateval{\pflcamlegtotal+\tmpval}}% |
| 7054 |
}% |
| 7055 |
% sous-tikzpicture dans un node ancré sur cam-est |
| 7056 |
\IfEq{\pflcamnomgraph}{}% |
| 7057 |
{% |
| 7058 |
\coordinate (cam-legende) at ([xshift=\pflcamdecalest cm]cam-est) ; |
| 7059 |
}% |
| 7060 |
{% |
| 7061 |
\coordinate (cam-legende) at ([xshift=\pflcamdecalest cm]\pflcamnomgraph-cam-est) ; |
| 7062 |
}% |
| 7063 |
\node[anchor=west] at (cam-legende) {% |
| 7064 |
\begin{tikzpicture} |
| 7065 |
\xintFor* ##1 in {\xintSeq{1}{\pflcamleglistlen}} \do{% |
| 7066 |
\itemtomacro\pflcamleglist[##1,1]\tmplabel% |
| 7067 |
\itemtomacro\pflcamleglist[##1,2]\tmpval% |
| 7068 |
\itemtomacro\pflcamleglist[##1,3]\tmpcoulcam% |
| 7069 |
\itemtomacro\pflcamleglist[##1,4]\tmptypecam% |
| 7070 |
\IfEq{\tmptypecam}{}% |
| 7071 |
{\def\tmptypecam{solid}}% |
| 7072 |
{}% |
| 7073 |
\IfEq{\tmpcoulcam}{}% |
| 7074 |
{\def\tmpcoulcam{\pflcamcouldef}}% |
| 7075 |
{} |
| 7076 |
\xdef\tmppct{\xintfloateval{% |
| 7077 |
round(100*\tmpval/\pflcamlegtotal,\pflcamlegarrondi)}}% |
| 7078 |
\xdef\tmpy{\xintfloateval{-(##1-1)*\pflcamespleg}}% |
| 7079 |
% carreau coloré |
| 7080 |
\IfEq{\tmptypecam}{solid}% |
| 7081 |
{% |
| 7082 |
\draw[pflpointggb,fill={\tmpcoulcam}] (0,{\tmpy-\pflcamlegtaille/2}) rectangle (\pflcamlegtaille,{\tmpy+\pflcamlegtaille/2}) ;% |
| 7083 |
}% |
| 7084 |
{% |
| 7085 |
\draw[pflpointggb,pattern={\tmptypecam},pattern color={\tmpcoulcam}] (0,{\tmpy-\pflcamlegtaille/2}) rectangle (\pflcamlegtaille,{\tmpy+\pflcamlegtaille/2}) ;% |
| 7086 |
}% |
| 7087 |
% label — colonne 1 |
| 7088 |
\node[anchor=west,pfllegendelabels] |
| 7089 |
at ({\pflcamlegtaille+0.1},\tmpy) {{\tmplabel} (\ifboolKV[GraphiqueTikzCamembertLeg]{Pct}{\tmppct\,\%}{\ArrondirNum[\pflcamlegarrondi]{\tmpval}})} ;% |
| 7090 |
}% |
| 7091 |
\end{tikzpicture}% |
| 7092 |
} ;% |
| 7093 |
} |
| 7094 |
|
| 7095 |
\endinput |