| 1 |
% !TeX TXS-program:compile = txs:///arara |
| 2 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} |
| 3 |
% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)') |
| 4 |
|
| 5 |
\documentclass[11pt,a4paper]{ltxdoc} |
| 6 |
\usepackage[utf8]{inputenc} |
| 7 |
\usepackage[T1]{fontenc} |
| 8 |
\usepackage{tkz-grapheur} |
| 9 |
\usetikzlibrary{fit,backgrounds} |
| 10 |
\pgfplotsset{compat=newest} |
| 11 |
\usepackage{amsmath} |
| 12 |
\usepackage{enumitem} |
| 13 |
\usepackage{fancyhdr} |
| 14 |
\usepackage{hyperref} |
| 15 |
\usepackage{fontawesome5} |
| 16 |
\usepackage{tcolorbox} |
| 17 |
\usepackage{minted2} |
| 18 |
\tcbuselibrary{skins,minted} |
| 19 |
\fancyhf{} |
| 20 |
\renewcommand{\headrulewidth}{0pt} |
| 21 |
\lfoot{\sffamily\small [tkz-grapheur-altversion]} |
| 22 |
\rfoot{\sffamily\small - \thepage{} -} |
| 23 |
\providecommand\tikzlogo{Ti\textit{k}Z} |
| 24 |
\let\TikZ\tikzlogo |
| 25 |
\urlstyle{same} |
| 26 |
\hypersetup{pdfborder=0 0 0} |
| 27 |
\usepackage[margin=2cm]{geometry} |
| 28 |
\setlength{\parindent}{0pt} |
| 29 |
\usepackage{soul} |
| 30 |
\sethlcolor{lightgray!25} |
| 31 |
\NewDocumentCommand\MontreCode{ m }{% |
| 32 |
\hl{\vphantom{\texttt{pf}}\texttt{#1}}% |
| 33 |
} |
| 34 |
\usepackage[french]{babel} |
| 35 |
\sisetup{group-minimum-digits=4} |
| 36 |
\renewcommand{\footnoterule}{\vfill\kern -3pt \hrule width 0.4\columnwidth \kern 2.6pt} |
| 37 |
|
| 38 |
\begin{document} |
| 39 |
|
| 40 |
\pagestyle{fancy} |
| 41 |
\thispagestyle{empty} |
| 42 |
|
| 43 |
\begin{center} |
| 44 |
\begin{minipage}{0.88\linewidth} |
| 45 |
\begin{tcolorbox}[colframe=orange!80!black,colback=orange!10] |
| 46 |
\begin{center} |
| 47 |
\begin{tabular}{c} |
| 48 |
{\huge\texttt{tkz-grapheur-altversion (v\tkzgrapheurversion)}}\vspace{10pt}\\ |
| 49 |
{\LARGE Version alternative de l'environnement graphique,}\\ |
| 50 |
\\ |
| 51 |
{\LARGE basée sur \textsf{\TikZ}, \textsf{xint} et la normalisation interne.}\\ |
| 52 |
\\ |
| 53 |
{\small Chargé automatiquement avec \texttt{tkz-grapheur}} |
| 54 |
\end{tabular} |
| 55 |
\end{center} |
| 56 |
\end{tcolorbox} |
| 57 |
\end{minipage} |
| 58 |
\end{center} |
| 59 |
|
| 60 |
\begin{center} |
| 61 |
\begin{tabular}{c} |
| 62 |
\texttt{Cédric Pierquet}\\ |
| 63 |
{\ttfamily c pierquet -- at -- outlook . fr}\\ |
| 64 |
\texttt{\url{https://github.com/cpierquet/latex-packages/tree/main/tkz-grapheur}} \\ |
| 65 |
\end{tabular} |
| 66 |
\end{center} |
| 67 |
|
| 68 |
\hrule\vfill |
| 69 |
|
| 70 |
\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center] |
| 71 |
\begin{tkzGrph}% |
| 72 |
<Xmin=2990,Xmax=3020,Xgrille=5,Xgrilles=1, |
| 73 |
Ymin=0,Ymax=5000000,Ygrille=1000000,Ygrilles=100000, |
| 74 |
Origx=2990,Largeur=12cm,Hauteur=6cm,Theme=bleu> |
| 75 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small,labels=false]{}{} |
| 76 |
\tkzGrphDefineCurve[name=cf]<f>{2000*(x-2990)^2+500000} |
| 77 |
\tkzGrphDefineSpline[alt,name=sp]% |
| 78 |
{2990/300000/0.5 § 3000/2000000/0 § 3010/250000/0 § 3020/4500000/0.8} |
| 79 |
\tkzGrphDrawIntg[colors=orange!60]{sp}[cf]{2995}{3015} |
| 80 |
\tkzGrphDrawExistingCurves{cf/red,sp/blue} |
| 81 |
\tkzGrphFindItsc[show,lines,reslist=LISTRES,color=olive]{cf}{sp} |
| 82 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small,grid=false]% |
| 83 |
{2990,2995,3000,3005,3010,3015,3020}% |
| 84 |
{0,1000000,2000000,3000000,4000000,5000000} |
| 85 |
\end{tkzGrph} |
| 86 |
|
| 87 |
Solutions := \LISTRES |
| 88 |
\end{tcolorbox} |
| 89 |
|
| 90 |
\vfill\hfill{\footnotesize\textit{\ttfamily À mon papa.}}\vspace*{5mm} |
| 91 |
|
| 92 |
\pagebreak |
| 93 |
|
| 94 |
\tableofcontents |
| 95 |
\vspace*{5mm}\hrule\vspace*{5mm} |
| 96 |
\pagebreak |
| 97 |
|
| 98 |
%============================================================= |
| 99 |
\section{Introduction et philosophie} |
| 100 |
%============================================================= |
| 101 |
|
| 102 |
\subsection{Problématique} |
| 103 |
|
| 104 |
L'environnement \MontreCode{GraphiqueTikz} de \MontreCode{tkz-grapheur} travaille directement en coordonnées \TikZ\ — des valeurs extrêmes sur les axes (années, populations, distances\ldots) génèrent des erreurs \MontreCode{dimension too large}. |
| 105 |
|
| 106 |
\smallskip |
| 107 |
|
| 108 |
L'environnement alternatif \MontreCode{tkzGrph} résout ce problème par une \textbf{normalisation interne} : \TikZ\ travaille toujours dans $[0,L] \times [0,H]$ (en cm), quelle que soit l'amplitude réelle. |
| 109 |
|
| 110 |
\subsection{Principe de la normalisation} |
| 111 |
|
| 112 |
Pour une fenêtre $[\text{Xmin}, \text{Xmax}] \times [\text{Ymin}, \text{Ymax}]$ et des dimensions $L \times H$ : |
| 113 |
|
| 114 |
\[ |
| 115 |
x_{\text{norm}} = \frac{x - x_{\min}}{x_{\max} - x_{\min}} \times L |
| 116 |
\qquad |
| 117 |
y_{\text{norm}} = \frac{y - y_{\min}}{y_{\max} - y_{\min}} \times H |
| 118 |
\] |
| 119 |
|
| 120 |
\TikZ\ ne voit jamais que des coordonnées dans $[0,L] \times [0,H]$. |
| 121 |
|
| 122 |
\subsection{Philosophie : tout est un \texttt{path}} |
| 123 |
|
| 124 |
\textbf{Toutes les courbes sont des \MontreCode{name path} nommés} — fonction xint, interpolation ou spline. Cela permet : |
| 125 |
|
| 126 |
\begin{itemize} |
| 127 |
\item de \textbf{réutiliser} un tracé avec des styles différents via \MontreCode{\textbackslash tkzGrphDrawExistingCurve(s)} ; |
| 128 |
\item de calculer des \textbf{intersections} entre n'importe quelles courbes ; |
| 129 |
\item de calculer des \textbf{intégrales} entre n'importe quelles courbes ; |
| 130 |
\item d'\textbf{unifier} la syntaxe indépendamment du type de courbe. |
| 131 |
\end{itemize} |
| 132 |
|
| 133 |
\subsection{Rétrocompatibilité} |
| 134 |
|
| 135 |
L'environnement \MontreCode{tkzGrph} accepte les mêmes noms de clés que \MontreCode{GraphiqueTikz} (\MontreCode{Xmin}, \MontreCode{Xgrille}\ldots) ainsi que leurs alias anglais (\MontreCode{width}, \MontreCode{xgrid}\ldots). |
| 136 |
|
| 137 |
\pagebreak |
| 138 |
|
| 139 |
%============================================================= |
| 140 |
\section{Environnement \texttt{tkzGrph}} |
| 141 |
%============================================================= |
| 142 |
|
| 143 |
\subsection{Syntaxe} |
| 144 |
|
| 145 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 146 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 147 |
\begin{tkzGrph}[options tikz]<clés> |
| 148 |
... |
| 149 |
\end{tkzGrph} |
| 150 |
\end{tcblisting} |
| 151 |
|
| 152 |
\subsection{Clés disponibles} |
| 153 |
|
| 154 |
\begin{itemize} |
| 155 |
\item \MontreCode{Xmin}/\MontreCode{Xmax} : bornes de l'axe $Ox$, \MontreCode{0}/\MontreCode{10} par défaut ; |
| 156 |
\item \MontreCode{Ymin}/\MontreCode{Ymax} : bornes de l'axe $Oy$, \MontreCode{0}/\MontreCode{10} par défaut ; |
| 157 |
\item \MontreCode{Largeur=...} / \MontreCode{width=...} : largeur (dimension pure), \MontreCode{8cm} par défaut ; |
| 158 |
\item \MontreCode{Hauteur=...} / \MontreCode{height=...} : hauteur (dimension pure), \MontreCode{6cm} par défaut ; |
| 159 |
\item \MontreCode{Origx=...} / \MontreCode{Origy=...} : position de l'origine, \MontreCode{\{0\}} par défaut ; |
| 160 |
\item \MontreCode{Xgrille=...} / \MontreCode{xgrid=...} : pas de grille principale en $x$, \MontreCode{1} par défaut ; |
| 161 |
\item \MontreCode{Xgrilles=...} / \MontreCode{xgrids=...} : pas de grille secondaire en $x$, \MontreCode{0.5} par défaut ; |
| 162 |
\item \MontreCode{Xgrillei=...} / \MontreCode{xgridi=...} : pas de grille intermédiaire en $x$ ; |
| 163 |
\item \MontreCode{Ygrille=...}, \MontreCode{Ygrilles=...}, \MontreCode{Ygrillei=...} : idem en $y$ ; |
| 164 |
\item \MontreCode{Theme=...} / \MontreCode{theme=...} : thème de couleurs (\MontreCode{standard}, \MontreCode{gris}, \MontreCode{bleu}, \MontreCode{vert}, \MontreCode{chaud}, \MontreCode{contraste}) ; |
| 165 |
\item \MontreCode{NomFigure=...} / \MontreCode{figurename=...} : préfixe des nœuds pour plusieurs figures ; |
| 166 |
\item \MontreCode{TailleGrad=...} / \MontreCode{gradsize=...} : taille des graduations (\texttt{longueur} ou \texttt{dessus/dessous}) ; |
| 167 |
\item \MontreCode{AffCadre} / \MontreCode{showframe} : affiche un cadre ; |
| 168 |
\item \MontreCode{Milli} / \MontreCode{milli} : grille millimétrée. |
| 169 |
\end{itemize} |
| 170 |
|
| 171 |
{\footnotesize\faBomb}~\MontreCode{Largeur} et \MontreCode{Hauteur} attendent des \textbf{dimensions pures} (\MontreCode{8cm}, \MontreCode{120mm}\ldots). |
| 172 |
|
| 173 |
\subsection{Nœuds créés} |
| 174 |
|
| 175 |
\begin{itemize} |
| 176 |
\item \MontreCode{grph-ne}, \MontreCode{grph-nw}, \MontreCode{grph-se}, \MontreCode{grph-sw} : coins de la fenêtre ; |
| 177 |
\item \MontreCode{grph-n}, \MontreCode{grph-s}, \MontreCode{grph-e}, \MontreCode{grph-w}, \MontreCode{grph-c} : milieux des bords et centre ; |
| 178 |
\item \MontreCode{grph-axox-w}, \MontreCode{grph-axox-e}, \MontreCode{grph-axoy-s}, \MontreCode{grph-axoy-n} : bords des axes ; |
| 179 |
\item \MontreCode{grph-orig} : origine du repère. |
| 180 |
\end{itemize} |
| 181 |
|
| 182 |
\pagebreak |
| 183 |
|
| 184 |
%============================================================= |
| 185 |
\subsection{Axes et grilles} |
| 186 |
%============================================================= |
| 187 |
|
| 188 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 189 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 190 |
\tkzGrphDrawGridAxis[clés]{liste valeurs X}{liste valeurs Y} |
| 191 |
% alias FR : |
| 192 |
\tkzGrphTracerAxesGrille[clés]{liste valeurs X}{liste valeurs Y} |
| 193 |
\end{tcblisting} |
| 194 |
|
| 195 |
Les listes sont des \textbf{valeurs réelles} — la conversion est automatique. |
| 196 |
|
| 197 |
\smallskip |
| 198 |
|
| 199 |
Les \MontreCode{[clés]} disponibles sont : |
| 200 |
|
| 201 |
\begin{itemize} |
| 202 |
\item \MontreCode{Grille} / \MontreCode{grid} : booléen, \MontreCode{true} par défaut ; |
| 203 |
\item \MontreCode{GrilleIntermediaire} / \MontreCode{intermediategrid} : booléen ; |
| 204 |
\item \MontreCode{Grads} / \MontreCode{labels} : booléen, \MontreCode{true} par défaut ; |
| 205 |
\item \MontreCode{AxeOy} / \MontreCode{yaxis} : booléen, \MontreCode{true} par défaut ; |
| 206 |
\item \MontreCode{Fleches} / \MontreCode{arrows} : booléen, \MontreCode{true} par défaut ; |
| 207 |
\item \MontreCode{Elargir} / \MontreCode{enlarge} : élargissement des axes ; |
| 208 |
\item \MontreCode{Police} / \MontreCode{font} : police des labels ; |
| 209 |
\item \MontreCode{Format} / \MontreCode{format} : format des labels (\MontreCode{num}, \MontreCode{annee}, \MontreCode{frac}\ldots) ; |
| 210 |
\item \MontreCode{Derriere} / \MontreCode{behind} : grille en arrière-plan ; |
| 211 |
\item \MontreCode{Devant} / \MontreCode{front} : axes en avant-plan (sans grille). |
| 212 |
\end{itemize} |
| 213 |
|
| 214 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 215 |
colframe=lightgray,colback=lightgray!5} |
| 216 |
\begin{tkzGrph}% |
| 217 |
<Xmin=1990,Xmax=2020,Ymin=0,Ymax=5000000, |
| 218 |
Largeur=10cm,hauteur=5cm,Xgrille=5,Xgrilles=1, |
| 219 |
Ygrille=1000000,Ygrilles=500000,Origx=1990> |
| 220 |
\tkzGrphTracerAxesGrille[Elargir=2.5mm,Police=\small,Format=annee/num]% |
| 221 |
{1990,1995,2000,2005,2010,2015,2020}% |
| 222 |
{0,1000000,2000000,3000000,4000000,5000000} |
| 223 |
\end{tkzGrph} |
| 224 |
\end{tcblisting} |
| 225 |
|
| 226 |
\pagebreak |
| 227 |
|
| 228 |
%============================================================= |
| 229 |
\section{Définir et tracer des courbes} |
| 230 |
%============================================================= |
| 231 |
|
| 232 |
\subsection{Courbe de fonction : \texttt{\textbackslash tkzGrphDefineCurve}} |
| 233 |
|
| 234 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 235 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 236 |
\tkzGrphDefineCurve[clés]<nom fct>{expression xint} |
| 237 |
% alias FR : |
| 238 |
\tkzGrphDefinirCourbe[clés]<nom fct>{expression xint} |
| 239 |
\end{tcblisting} |
| 240 |
|
| 241 |
Les \MontreCode{[clés]} disponibles sont : |
| 242 |
|
| 243 |
\begin{itemize} |
| 244 |
\item \MontreCode{Couleur} / \MontreCode{color} : couleur du tracé, \MontreCode{black} par défaut ; |
| 245 |
\item \MontreCode{Nom} / \MontreCode{name} : nom du \MontreCode{path} créé ; |
| 246 |
\item \MontreCode{Debut} / \MontreCode{start} : abscisse de départ (réelle), \MontreCode{Xmin} par défaut ; |
| 247 |
\item \MontreCode{Fin} / \MontreCode{end} : abscisse de fin (réelle), \MontreCode{Xmax} par défaut ; |
| 248 |
\item \MontreCode{Pas} / \MontreCode{step} : pas du tracé, calculé automatiquement par défaut ; |
| 249 |
\item \MontreCode{Trace} / \MontreCode{draw} : booléen, \MontreCode{true} par défaut. |
| 250 |
\end{itemize} |
| 251 |
|
| 252 |
\subsection{Interpolation lisse : \texttt{\textbackslash tkzGrphDefineInterpoCurve}} |
| 253 |
|
| 254 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 255 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 256 |
\tkzGrphDefineInterpoCurve[clés]{x/y § x/y § ...} |
| 257 |
% alias FR : |
| 258 |
\tkzGrphDefinirCourbeInterpo[clés]{x/y § x/y § ...} |
| 259 |
\end{tcblisting} |
| 260 |
|
| 261 |
Séparateur \MontreCode{§} entre les points, \MontreCode{/} entre les coordonnées. Clé spécifique : \MontreCode{tension} (défaut \MontreCode{0.5}). |
| 262 |
|
| 263 |
\subsection{Spline de Hermite : \texttt{\textbackslash tkzGrphDefineSpline}} |
| 264 |
|
| 265 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 266 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 267 |
\tkzGrphDefineSpline[clés]{x/y/f'(x) § x/y/f'(x) § ...} |
| 268 |
% alias FR : |
| 269 |
\tkzGrphDefinirCourbeSpline[clés]{x/y/f'(x) § x/y/f'(x) § ...} |
| 270 |
\end{tcblisting} |
| 271 |
|
| 272 |
Remarques : |
| 273 |
|
| 274 |
\begin{itemize} |
| 275 |
\item Pour chaque point : abscisse / ordonnée / dérivée (toutes en valeurs réelles). |
| 276 |
\item La dérivée est normalisée automatiquement. |
| 277 |
\item Clé spécifique (Hermite) : \MontreCode{Alt} (mode alternatif Bézier, conseillé pour les courbes oscillantes). |
| 278 |
\end{itemize} |
| 279 |
|
| 280 |
\subsection{Tracer des courbes existantes} |
| 281 |
|
| 282 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 283 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 284 |
% tracer UN path existant avec un style |
| 285 |
\tkzGrphDrawExistingCurve[options draw]{nom path} |
| 286 |
|
| 287 |
% tracer PLUSIEURS paths en une fois : nom/couleur,... |
| 288 |
\tkzGrphDrawExistingCurves[options draw]{nom/couleur, nom/couleur, ...} |
| 289 |
% alias FR : |
| 290 |
\tkzGrphTracerCourbe / \tkzGrphTracerCourbes |
| 291 |
\end{tcblisting} |
| 292 |
|
| 293 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 294 |
colframe=lightgray,colback=lightgray!5} |
| 295 |
\begin{tkzGrph}% |
| 296 |
<Xmin=2990,Xmax=3020,Ymin=0,Ymax=5000000, |
| 297 |
Largeur=10cm,hauteur=5cm,Xgrille=5,Xgrilles=1, |
| 298 |
Ygrille=1000000,Ygrilles=500000,Origx=2990,% |
| 299 |
TailleGrad=0pt/3pt> |
| 300 |
\tkzGrphTracerAxesGrille[Elargir=2.5mm]% |
| 301 |
{2990,2995,3000,3005,3010,3015,3020}% |
| 302 |
{0,1000000,2000000,3000000,4000000,5000000} |
| 303 |
\tkzGrphDefinirCourbe[Nom=cf]<f>{2000*(x-2990)^2+500000} |
| 304 |
\tkzGrphDefinirCourbeInterpo[Tension=1,Nom=interpo]% |
| 305 |
{2990/4500000 § 3005/500000 § 3014/4250000} |
| 306 |
\tkzGrphDefinirCourbeSpline[Alt,Nom=sp]% |
| 307 |
{2990/300000/0.5 § 3000/2000000/0 § 3010/250000/0 § 3020/4500000/0.8} |
| 308 |
% tracer avec des couleurs différentes |
| 309 |
\tkzGrphTracerCourbes{cf/red,interpo/blue,sp/orange} |
| 310 |
\end{tkzGrph} |
| 311 |
\end{tcblisting} |
| 312 |
|
| 313 |
\pagebreak |
| 314 |
|
| 315 |
\section{Compléments} |
| 316 |
|
| 317 |
%============================================================= |
| 318 |
\subsection{Récupération de coordonnées réelles} |
| 319 |
%============================================================= |
| 320 |
|
| 321 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 322 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 323 |
\tkzGrphGetX{(nœud)}[\mavaleur] % abscisse réelle |
| 324 |
\tkzGrphGetY{(nœud)}[\mavaleur] % ordonnée réelle |
| 325 |
\tkzGrphGetXY{(nœud)}[\monx][\mony] |
| 326 |
% alias FR : |
| 327 |
\tkzGrphRecupX / \tkzGrphRecupY / \tkzGrphRecupXY |
| 328 |
\end{tcblisting} |
| 329 |
|
| 330 |
Dénormalise les coordonnées d'un nœud TikZ existant vers les vraies valeurs. |
| 331 |
|
| 332 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 333 |
colframe=lightgray,colback=lightgray!5} |
| 334 |
\begin{tkzGrph}% |
| 335 |
<Xmin=2990,Xmax=3020,Xgrille=5,Xgrilles=1, |
| 336 |
Ymin=0,Ymax=5000000,Ygrille=1000000,Ygrilles=500000, |
| 337 |
Largeur=10cm,Hauteur=5cm,Origx=2990> |
| 338 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small]% |
| 339 |
{2990,2995,3000,3005,3010,3015,3020}% |
| 340 |
{0,1000000,2000000,3000000,4000000,5000000} |
| 341 |
\tkzGrphDefineCurve[name=cf]<f>{2000*(x-2990)^2+500000} |
| 342 |
\tkzGrphDefineSpline[alt,name=sp]% |
| 343 |
{2990/300000/0.5 § 3000/2000000/0 § 3010/250000/0 § 3020/4500000/0.8} |
| 344 |
\tkzGrphDrawExistingCurves{cf/red,sp/blue} |
| 345 |
\tkzGrphFindItsc[show,name=K]{cf}{sp} |
| 346 |
% récupérer et afficher les coordonnées réelles |
| 347 |
\tkzGrphGetXY{(K-1)}[\xun][\yun] |
| 348 |
\node[right,font=\small,rotate=90] at (K-1) |
| 349 |
{$(\ArrondirNum[1]{\xun}\,;\,\ArrondirNum[0]{\yun})$} ; |
| 350 |
\end{tkzGrph} |
| 351 |
\end{tcblisting} |
| 352 |
|
| 353 |
\pagebreak |
| 354 |
|
| 355 |
%============================================================= |
| 356 |
\subsection{Marquage de points : \texttt{\textbackslash tkzGrphMarkPts}} |
| 357 |
%============================================================= |
| 358 |
|
| 359 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 360 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 361 |
% version normale : avec label |
| 362 |
\tkzGrphMarkPts[clés]<police>{liste de nœuds TikZ} |
| 363 |
% version étoilée : sans label |
| 364 |
\tkzGrphMarkPts*[clés]{liste de nœuds TikZ} |
| 365 |
% alias FR : |
| 366 |
\tkzGrphMarquerPts |
| 367 |
\end{tcblisting} |
| 368 |
|
| 369 |
Les nœuds sont donnés en coordonnées normalisées ou via des nœuds TikZ existants. Clés : \MontreCode{Couleur}/\MontreCode{color}, \MontreCode{Style}/\MontreCode{style} (\MontreCode{o}, \MontreCode{x}, \MontreCode{+}, \MontreCode{ggb}\ldots). |
| 370 |
|
| 371 |
\pagebreak |
| 372 |
|
| 373 |
\section{Analyse(s) et exploitation(s)} |
| 374 |
|
| 375 |
%============================================================= |
| 376 |
\subsection{Intégrales : \texttt{\textbackslash tkzGrphDrawIntg}} |
| 377 |
%============================================================= |
| 378 |
|
| 379 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 380 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 381 |
% sous une courbe (axe Ox) |
| 382 |
\tkzGrphDrawIntg[clés]{nom path}{borne A}{borne B} |
| 383 |
% entre deux courbes |
| 384 |
\tkzGrphDrawIntg[clés]{nom path 1}[nom path 2]{borne A}{borne B} |
| 385 |
% alias FR : |
| 386 |
\tkzGrphIntegrale[clés]{...} |
| 387 |
\end{tcblisting} |
| 388 |
|
| 389 |
Les bornes sont des \textbf{valeurs réelles} ou des \textbf{nœuds TikZ} (\MontreCode{(ITSC-1)}). Le paramètre optionnel \MontreCode{[nom path 2]} active le mode \textit{entre deux courbes}. |
| 390 |
|
| 391 |
\smallskip |
| 392 |
|
| 393 |
{\footnotesize\faBomb}~Nécessite la librairie \TikZ\ \MontreCode{spath3} (\MontreCode{\textbackslash usetikzlibrary\{spath3\}}). |
| 394 |
|
| 395 |
\smallskip |
| 396 |
|
| 397 |
Les \MontreCode{[clés]} disponibles sont : |
| 398 |
|
| 399 |
\begin{itemize} |
| 400 |
\item \MontreCode{Couleurs} / \MontreCode{colors} : couleur(s) (\MontreCode{bord/fond} ou unique), \MontreCode{gray} par défaut ; |
| 401 |
\item \MontreCode{Style} / \MontreCode{style} : \MontreCode{fill} (défaut) ou \MontreCode{hachures} ; |
| 402 |
\item \MontreCode{Hachures} / \MontreCode{hatch} : pattern TikZ, \MontreCode{north west lines} par défaut ; |
| 403 |
\item \MontreCode{Opacite} / \MontreCode{opacity} : opacité du fond, \MontreCode{0.5} par défaut ; |
| 404 |
\item \MontreCode{Bord} / \MontreCode{border} : booléen, \MontreCode{true} par défaut, traits verticaux aux bornes ; |
| 405 |
\item \MontreCode{Bornes} / \MontreCode{bound} : \MontreCode{abs} (défaut) ou \MontreCode{noeuds}. |
| 406 |
\end{itemize} |
| 407 |
|
| 408 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 409 |
colframe=lightgray,colback=lightgray!5} |
| 410 |
\begin{tkzGrph}% |
| 411 |
<Xmin=2990,Xmax=3020,Xgrille=5,Xgrilles=1, |
| 412 |
Ymin=0,Ymax=5000000,Ygrille=1000000,Ygrilles=500000, |
| 413 |
Largeur=10cm,Hauteur=5cm,Origx=2990> |
| 414 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small]% |
| 415 |
{2990,2995,3000,3005,3010,3015,3020}% |
| 416 |
{0,1000000,2000000,3000000,4000000,5000000} |
| 417 |
\tkzGrphDefineCurve[draw=false,name=cf]<f>{2000*(x-2990)^2+500000} |
| 418 |
\tkzGrphDefineSpline[alt,draw=false,name=sp]% |
| 419 |
{2990/300000/0.5 § 3005/2500000/0 § 3020/4000000/0.8} |
| 420 |
% sous une courbe |
| 421 |
\tkzGrphDrawIntg[colors=cyan/cyan!30]{cf}{2995}{3010} |
| 422 |
% entre deux courbes |
| 423 |
\tkzGrphDrawIntg[colors=yellow,style=hachures]{sp}[cf]{3000}{3015} |
| 424 |
\tkzGrphDrawExistingCurves{cf/red,sp/blue} |
| 425 |
\end{tkzGrph} |
| 426 |
\end{tcblisting} |
| 427 |
|
| 428 |
\pagebreak |
| 429 |
|
| 430 |
%============================================================= |
| 431 |
\subsection{Intersections : \texttt{\textbackslash tkzGrphFindItsc}} |
| 432 |
%============================================================= |
| 433 |
|
| 434 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 435 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 436 |
\tkzGrphFindItsc[clés]{nom path 1}{nom path 2}<nb> |
| 437 |
% alias FR : |
| 438 |
\tkzGrphIntersections[clés]{nom path 1}{nom path 2}<nb> |
| 439 |
\end{tcblisting} |
| 440 |
|
| 441 |
Les nœuds sont nommés \MontreCode{S-1}, \MontreCode{S-2}\ldots (ou le préfixe choisi via \MontreCode{Nom}/\MontreCode{name}). |
| 442 |
|
| 443 |
\smallskip |
| 444 |
|
| 445 |
Les \MontreCode{[clés]} disponibles sont : |
| 446 |
|
| 447 |
\begin{itemize} |
| 448 |
\item \MontreCode{Nom} / \MontreCode{name} : préfixe des nœuds, \MontreCode{S} par défaut ; |
| 449 |
\item \MontreCode{Couleur} / \MontreCode{color} : couleur des points et traits ; |
| 450 |
\item \MontreCode{Aff} / \MontreCode{show} : booléen, \MontreCode{true} par défaut ; |
| 451 |
\item \MontreCode{Traits} / \MontreCode{lines} : booléen, traits vers les axes ; |
| 452 |
\item \MontreCode{ListeRes} / \MontreCode{reslist} : nom d'une macro pour la liste des abscisses réelles. |
| 453 |
\end{itemize} |
| 454 |
|
| 455 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 456 |
colframe=lightgray,colback=lightgray!5} |
| 457 |
\begin{tkzGrph}<Xmin=2990,Xmax=3020,Ymin=0,Ymax=5000000, |
| 458 |
Largeur=10cm,Hauteur=5cm,Origx=2990> |
| 459 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small]% |
| 460 |
{2990,2995,3000,3005,3010,3015,3020}% |
| 461 |
{0,1000000,2000000,3000000,4000000,5000000} |
| 462 |
\tkzGrphDefineCurve[name=cf]<f>{2000*(x-2990)^2+500000} |
| 463 |
\tkzGrphDefineSpline[alt,name=sp]% |
| 464 |
{2990/300000/0.5 § 3000/2000000/0 § 3010/250000/0 § 3020/4500000/0.8} |
| 465 |
\tkzGrphDrawExistingCurves{cf/red,sp/blue} |
| 466 |
\tkzGrphFindItsc[show,lines,reslist=LISTRES,color=olive]{cf}{sp} |
| 467 |
\end{tkzGrph} |
| 468 |
|
| 469 |
Solutions : \LISTRES |
| 470 |
\end{tcblisting} |
| 471 |
|
| 472 |
\pagebreak |
| 473 |
|
| 474 |
%============================================================= |
| 475 |
\subsection{Images et antécédents} |
| 476 |
%============================================================= |
| 477 |
|
| 478 |
\subsubsection{Image : \texttt{\textbackslash tkzGrphFindY}} |
| 479 |
|
| 480 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 481 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 482 |
\tkzGrphFindY[clés]{nom path}{x réel}<nom nœud> |
| 483 |
% alias FR : |
| 484 |
\tkzGrphTrouverY[clés]{nom path}{x réel}<nom nœud> |
| 485 |
\end{tcblisting} |
| 486 |
|
| 487 |
Intersection avec la droite verticale $x = x_{\text{réel}}$. Le nœud \MontreCode{<nom nœud>} est réutilisable ensuite. |
| 488 |
|
| 489 |
\subsubsection{Images : \texttt{\textbackslash tkzGrphFindListY}} |
| 490 |
|
| 491 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 492 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 493 |
\tkzGrphFindListY[clés]{nom path}{x1,x2,...} |
| 494 |
% alias FR : |
| 495 |
\tkzGrphTrouverListeY[clés]{nom path}{x1,x2,...} |
| 496 |
\end{tcblisting} |
| 497 |
|
| 498 |
\subsubsection{Antécédents : \texttt{\textbackslash tkzGrphFindX}} |
| 499 |
|
| 500 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 501 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 502 |
\tkzGrphFindX[clés]{nom path}{y réel}<nb> |
| 503 |
% alias FR : |
| 504 |
\tkzGrphTrouverX[clés]{nom path}{y réel}<nb> |
| 505 |
\end{tcblisting} |
| 506 |
|
| 507 |
\MontreCode{<nb>} reçoit le nombre de solutions. Clé \MontreCode{reslist}/\MontreCode{ListeRes} pour stocker la liste des abscisses. |
| 508 |
|
| 509 |
\smallskip |
| 510 |
|
| 511 |
Les \MontreCode{[clés]} communes à \MontreCode{\textbackslash tkzGrphFindY} et \MontreCode{\textbackslash tkzGrphFindX} : |
| 512 |
|
| 513 |
\begin{itemize} |
| 514 |
\item \MontreCode{Couleur} / \MontreCode{color} : couleur du point et des traits ; |
| 515 |
\item \MontreCode{Style} / \MontreCode{style} : style du point (\MontreCode{o}, \MontreCode{x}, \MontreCode{ggb}\ldots) ; |
| 516 |
\item \MontreCode{Aff} / \MontreCode{show} : booléen, \MontreCode{true} par défaut ; |
| 517 |
\item \MontreCode{Traits} / \MontreCode{lines} : booléen, traits vers les axes ; |
| 518 |
\item \MontreCode{AffDroite} / \MontreCode{showline} : booléen, affiche la droite horizontale/verticale. |
| 519 |
\end{itemize} |
| 520 |
|
| 521 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 522 |
colframe=lightgray,colback=lightgray!5} |
| 523 |
\begin{tkzGrph}% |
| 524 |
<Xmin=2990,Xmax=3020,Xgrille=5,Xgrilles=1, |
| 525 |
Ymin=0,Ymax=5000000,Ygrille=1000000,Ygrilles=500000, |
| 526 |
Largeur=10cm,Hauteur=5cm,Origx=2990> |
| 527 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small]% |
| 528 |
{2990,2995,3000,3005,3010,3015,3020}% |
| 529 |
{0,1000000,2000000,3000000,4000000,5000000} |
| 530 |
\tkzGrphDefineCurve[trace,name=cf,color=red]<f>{2000*(x-2990)^2+500000} |
| 531 |
% image en x=3000 |
| 532 |
\tkzGrphFindY[show,lines,color=teal]{cf}{3000} |
| 533 |
% images multiples |
| 534 |
\tkzGrphFindListY[show,color=orange]{cf}{2993,3005,3015} |
| 535 |
% antécédents de y=2000000 |
| 536 |
\tkzGrphFindX% |
| 537 |
[show,lines,showline,color=violet,reslist=ANTS]{cf}{2000000} |
| 538 |
\end{tkzGrph} |
| 539 |
|
| 540 |
Antécédents : \ANTS |
| 541 |
\end{tcblisting} |
| 542 |
|
| 543 |
%================================================================== |
| 544 |
\subsection{Extremums : \texttt{\textbackslash tkzGrphFindMin/Max}} |
| 545 |
%================================================================== |
| 546 |
|
| 547 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 548 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 549 |
\tkzGrphFindMin[clés]{nom path}[nœud] |
| 550 |
\tkzGrphFindMax[clés]{nom path}[nœud] |
| 551 |
\end{tcblisting} |
| 552 |
|
| 553 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 554 |
colframe=lightgray,colback=lightgray!5} |
| 555 |
\begin{tkzGrph}% |
| 556 |
<xmin=2990,Xmax=3020,Xgrille=5,Xgrilles=1,% |
| 557 |
Ymin=-2000000,Ymax=5000000,Ygrille=1000000,Ygrilles=100000,Origx=2990,% |
| 558 |
Largeur=10cm,Hauteur=70mm,Theme=seyes,TailleGrad=0pt/1mm> |
| 559 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small]% |
| 560 |
{2990,2995,3000,3005,3010,3015,3020}% |
| 561 |
{-2000000,-1000000,0,1000000,2000000,3000000,4000000,5000000} |
| 562 |
\tkzGrphDefineCurve[name=cf,trace,forbiddenvalues={3000}]% |
| 563 |
<f>{-1250000 + 100000000/(x-3000)^4} |
| 564 |
\tkzGrphDefineInterpoCurve[tension=1,name=interpo]% |
| 565 |
{2990/4500000 § 3005/500000 § 3018/4250000} |
| 566 |
\tkzGrphDefineSpline[alt,name=spline]% |
| 567 |
{ 2990/300000/0.5 § 3000/2000000/0 § 3010/250000/0 § 3020/4500000/0.8 } |
| 568 |
\tkzGrphDrawExistingCurves{interpo/blue,spline/orange,cf/violet} |
| 569 |
% \tkzGrphFindItsc[show,lines,reslist=LISTRES,Couleur=olive]{cf}{spline} |
| 570 |
%max/min |
| 571 |
\tkzGrphFindMin{interpo} |
| 572 |
\tkzGrphFindMax[start=2990,end=3010,color=teal,style=+]{spline} |
| 573 |
\tkzGrphGetXY{(grph-max)}[\mylocalxmax][\mylocalymax] |
| 574 |
\draw[teal] (grph-max) node[right,rotate=90,scale=0.75] {(\ArrondirNum[0]{\mylocalxmax};\ArrondirNum[0]<exponent-mode=fixed>{\mylocalymax})} ; |
| 575 |
\end{tkzGrph} |
| 576 |
\end{tcblisting} |
| 577 |
|
| 578 |
%============================================================= |
| 579 |
\section{Nuage et régression : statistiques} |
| 580 |
%============================================================= |
| 581 |
|
| 582 |
\subsection{Nuage de points : \texttt{\textbackslash tkzGrphScatterPlot}} |
| 583 |
|
| 584 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 585 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 586 |
\tkzGrphScatterPlot[clés]{liste X}{liste Y} |
| 587 |
% alias FR : |
| 588 |
\tkzGrphNuage[clés]{liste X}{liste Y} |
| 589 |
\end{tcblisting} |
| 590 |
|
| 591 |
\subsection{Droite de régression : \texttt{\textbackslash tkzGrphDrawRegLin}} |
| 592 |
|
| 593 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 594 |
colframe=lightgray,colback=lightgray!5,listing only} |
| 595 |
\tkzGrphDrawRegLin[clés tikz]{liste X}{liste Y} |
| 596 |
% alias FR : |
| 597 |
\tkzGrphRegLin[clés tikz]{liste X}{liste Y} |
| 598 |
\end{tcblisting} |
| 599 |
|
| 600 |
Calcule et trace la droite de régression par la méthode des moindres carrés. Les coefficients sont stockés dans \MontreCode{\textbackslash pflstrega} ($a$) et \MontreCode{\textbackslash pflstregb} ($b$). |
| 601 |
|
| 602 |
\begin{tcblisting}{listing engine=minted,minted language=latex, |
| 603 |
colframe=lightgray,colback=lightgray!5} |
| 604 |
\begin{tkzGrph} |
| 605 |
<Xmin=1990,Xmax=2020,Ymin=0,Ymax=3000000, |
| 606 |
Largeur=10cm,Hauteur=5cm,Xgrille=5,Xgrilles=1,% |
| 607 |
Ygrille=500000,Origx=1990> |
| 608 |
\tkzGrphDrawGridAxis[enlarge=2.5mm,font=\small]% |
| 609 |
{1990,1995,2000,2005,2010,2015,2020}% |
| 610 |
{0,500000,1000000,1500000,2000000,2500000,3000000} |
| 611 |
\tkzGrphScatterPlot[color=red]% |
| 612 |
{1992,1996,2001,2005,2009,2014,2018}% |
| 613 |
{800000,1100000,1400000,1700000,2000000,2400000,2700000} |
| 614 |
\tkzGrphDrawRegLin[blue,thick]% |
| 615 |
{1992,1996,2001,2005,2009,2014,2018}% |
| 616 |
{800000,1100000,1400000,1700000,2000000,2400000,2700000} |
| 617 |
%labels |
| 618 |
\tkzGrphPlaceTexte[Position=right]{(grph-axox-ee)}{Année} |
| 619 |
\tkzGrphPlaceTexte[Position=above]{(grph-axoy-nn)}{C.A.} |
| 620 |
\end{tkzGrph} |
| 621 |
|
| 622 |
Droite : $y = \ArrondirNum[1]{\pflstrega} x \ArrondirNum[0]<exponent-mode=fixed>{\pflstregb}$ |
| 623 |
\end{tcblisting} |
| 624 |
|
| 625 |
\end{document} |