texlive[71590] Master/texmf-dist: tkz-grapheur (22jun24)
commits+karl at tug.org
commits+karl at tug.org
Sat Jun 22 22:22:16 CEST 2024
Revision: 71590
https://tug.org/svn/texlive?view=revision&revision=71590
Author: karl
Date: 2024-06-22 22:22:15 +0200 (Sat, 22 Jun 2024)
Log Message:
-----------
tkz-grapheur (22jun24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-fr.pdf
trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-fr.tex
trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-exemples-integrales.pdf
trunk/Master/texmf-dist/tex/latex/tkz-grapheur/tkz-grapheur.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.pdf
trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.tex
trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.pdf
trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.tex
Added: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.pdf 2024-06-22 20:22:01 UTC (rev 71589)
+++ trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.pdf 2024-06-22 20:22:15 UTC (rev 71590)
Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.tex 2024-06-22 20:22:15 UTC (rev 71590)
@@ -0,0 +1,1712 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
+% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode} if found('log', '(undefined references|Please rerun|Rerun to get)')
+
+\documentclass[11pt,a4paper]{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage[english]{tkz-grapheur}
+\usepackage{amsmath}
+\usepackage{fancyvrb}
+\usepackage{fancyhdr}
+\usepackage{hyperref}
+\usepackage{nicefrac}
+\usepackage{fontawesome5}
+\usepackage{tcolorbox}
+\tcbuselibrary{skins,minted}
+\fancyhf{}
+\renewcommand{\headrulewidth}{0pt}
+\lfoot{\sffamily\small [tkz-grapheur]}
+\rfoot{\sffamily\small - \thepage{} -}
+\usepackage{hologo}
+\providecommand\tikzlogo{Ti\textit{k}Z}
+\providecommand\TeXLive{\TeX{}Live\xspace}
+\providecommand\PSTricks{\textsf{PSTricks}\xspace}
+\let\pstricks\PSTricks
+\let\TikZ\tikzlogo
+
+\urlstyle{same}
+\hypersetup{pdfborder=0 0 0}
+\usepackage[margin=2cm]{geometry}
+\setlength{\parindent}{0pt}
+\def\TPversion{0.1.5}
+\def\TPdate{22/06/2024}
+\usepackage{soul}
+\usepackage{codehigh}
+\usepackage{tabularray}
+\sethlcolor{lightgray!25}
+\NewDocumentCommand\MontreCode{ m }{%
+ \hl{\vphantom{\texttt{pf}}\texttt{#1}}%
+}
+\usepackage[english]{babel}
+
+\renewcommand{\footnoterule}{\vfill\kern -3pt \hrule width 0.4\columnwidth \kern 2.6pt}
+
+\begin{document}
+
+\pagestyle{fancy}
+
+\thispagestyle{empty}
+
+\begin{center}
+ \begin{minipage}{0.88\linewidth}
+ \begin{tcolorbox}[colframe=yellow,colback=yellow!15]
+ \begin{center}
+ \begin{tabular}{c}
+ {\Huge \texttt{tkz-grapheur [en]}}\\
+ \\
+ {\LARGE A grapher, based}\\
+ \\
+ {\LARGE on \textsf{\TikZ} and \textsf{xint}.}\\
+ \\
+ {\small \texttt{Version \TPversion{} -- \TPdate}}
+ \end{tabular}
+ \end{center}
+ \end{tcolorbox}
+\end{minipage}
+\end{center}
+
+\begin{center}
+ \begin{tabular}{c}
+ \texttt{Cédric Pierquet}\\
+ {\ttfamily c pierquet -- at -- outlook . fr}\\
+ \texttt{\url{https://forge.apps.education.fr/pierquetcedric/package-latex-tkz-grapheur}} \\
+\end{tabular}
+\end{center}
+
+\hrule
+
+\vfill
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\begin{GraphTikz}[x=0.85cm,y=0.35cm,Xmin=0,Xmax=10,Ymin=0,Ymax=16]
+ %préparation de la fenêtre
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,1,...,10}{0,2,...,16}
+ %déf des fonctions avec nom courbe + nom fonction + expression
+ \DefineCurve[Name=cf]<f>{3*x-6}
+ \DefineCurve[Name=cg]<g>{-(x-6)^2+12}
+ %antécédents et intersection
+ \FindIntersections[Disp=false,Name=K]{cf}{cg}
+ \FindCounterimage[DispLine,Color=orange,Name=I]{cg}{8}
+ \FindCounterimage[Disp=false,Name=J]{cg}{0}
+ %intégrale sous une courbe, avec intersection
+ \DrawIntegral%
+ [Colors=blue/purple,Bounds=nodes,Style=hatch,Hatch=bricks]%
+ {g(x)}%
+ {(I-2)}{(J-2)}
+ %intégrale entre les deux courbes
+ \DrawIntegral[Bounds=nodes,Type=fct/fct]{f(x)}[g(x)]{(K-1)}{(K-2)}
+ %tracé des courbes et des points
+ \DrawCurve[Color=red]{f(x)}
+ \DrawCurve[Color=teal]{g(x)}
+ \MarkPts<\small>{(K-1)/below right/L,(K-2)/above left/M}%
+ \MarkPts[violet]<\small>{(I-1)/above left/D,(I-2)/above right/E}%
+ %essai de tangente
+ \DrawTangent[Colors=pink!75!black/yellow,OffsetL=2,OffsetR=2,DispPt]{g}{5}
+ %essai d'image
+ \DrawRanges[Colors=cyan]{g}{7,7.25,7.5}
+ %surimpression des axes
+ \DrawAxisGrids[Grads=false,Grid=false,Enlarge=2.5mm]{0,1,...,10}{0,2,...,16}
+\end{GraphTikz}
+\end{tcolorbox}
+
+\vspace*{5mm}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5,halign=center]
+\begin{GraphTikz}%
+ [x=3.5cm,y=4cm,
+ Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
+ %préparation de la fenêtre
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm,Format=ntrig/nsqrt]%
+ {pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
+ {0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
+ %rajouter des valeurs
+ \AddXvalues{0.25,1.4,3.3}{\num{0.25},\num{1.4},\num{3.3}}
+ %fonction trigo (déf + tracé)
+ \DefineCurve[Name=ccos,Start=0,End=pi]<fcos>{cos(x)}
+ \DefineCurve[Name=csin,Start=0,End=pi]<fsin>{sin(x)}
+ %intégrale
+ \FindIntersections[Disp=false,Name=JKL]{ccos}{csin}
+ %\DefinirPts{FIN/pi/0}
+ \DrawIntegral%
+ [Bounds=node/abs,Type=fct/fct,Colors=cyan/cyan!50]%
+ {fsin(x)}[fcos(x)]%
+ {(JKL-1)}{pi}
+ %tracé des courbes
+ \DrawCurve[Color=red,Start=0,End=pi]{fcos(x)}
+ \DrawCurve[Color=olive,Start=0,End=pi]{fsin(x)}
+ %antécédent(s)
+ \DrawCounterimage[Color=blue/teal!50!black,Lines]{ccos}{-0.25}
+ \DrawCounterimage[Colors=red/magenta!50!black,Lines]{csin}{0.5}
+ \DrawCounterimage[Colors=orange/orange!50!black,Lines]{csin}{sqrt(2)/2}
+ \DrawCounterimage[Colors=green!50!black/green,Lines]{csin}{sqrt(3)/2}
+ %surimpression axes
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm,Format=ntrig/nsqrt]%
+ {pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
+ {0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
+\end{GraphTikz}
+\end{tcolorbox}
+
+\vfill
+
+\hfill{\footnotesize\textit{\ttfamily To my Dad.}}
+
+\vspace*{5mm}
+
+\pagebreak
+
+\phantomsection
+
+\hypertarget{matoc}{}
+
+\tableofcontents
+
+\vspace*{5mm}
+
+\hrule
+
+\vspace*{5mm}
+
+\pagebreak
+
+\section{Introduction}
+
+\subsection{Description and general ideas}
+
+With this modest package, far from the capabilities offered by the excellent packages \MontreCode{tkz-*}\footnote{for example tkz-base \url{https://ctan.org/pkg/tkz-base} and tkz- fct \url{https://ctan.org/pkg/tkz-fct}.} (by Alain Matthes) or \MontreCode{tzplot}\footnote{CTAN: \url{https://ctan.org/pkg/ tzplot}.} (by In-Sung Cho), it is possible to work on function graphs, in \TikZ\ language, in an \textit{intuitive} and \textit{explicit} way.
+
+\smallskip
+
+Concerning the overall operation:
+
+\smallskip
+
+\begin{itemize}
+ \item particular styles for the objects used have been defined, but they can be modified locally;
+ \item the name of the commands is in \textit{operational} form, so that the construction of the graphic elements has an almost \textit{algorithmic} form.
+\end{itemize}
+
+\subsection{Overall operation}
+
+To schematize, it \textit{is enough}:
+
+\smallskip
+
+\begin{itemize}
+ \item to declare the parameters of the graphics window (\textbf{units in cm !});
+ \item to display grid/axes/graduations;
+ \item to declare functions or interpolation curves;
+ \item to possibly declare particular points;
+ \item to place a point scatter.
+\end{itemize}
+
+\smallskip
+
+It will then be possible:
+
+\begin{itemize}
+ \item to draw curves;
+ \item to graphically determine images or backgrounds;
+ \item to add elements of derivation (tangents) or integration (domain);
+ \item to draw a linear fit line or the curve of another fit.
+\end{itemize}
+
+\subsection{Packages used, and package options}
+
+The package uses:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{tikz}, with the libraries \MontreCode{calc,intersections,patterns,patterns.meta,bbox};
+ \item \MontreCode{simplekv}, \MontreCode{xintexpr}, \MontreCode{xstring}, \MontreCode{listofitems};
+ \item \MontreCode{xint-regression}\footnote{CTAN: \url{https://ctan.org/pkg/xint-regression}.} (for regressions, switchable via \MontreCode{[noxintreg]}).
+\end{itemize}
+
+\smallskip
+
+The package also loads \MontreCode{siunitx} with the classic options, but it is possible not to load it using the \MontreCode{[nosiunitx]} option.
+
+\smallskip
+
+The package also loads the \TikZ\ \MontreCode{babel} library, but it is possible not to load it using the \MontreCode{[notikzbabel]} option.
+
+\smallskip
+
+The different options are obviously cumulative.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%loading by default, with french setup of siunitx
+\usepackage{tkz-grapheur}
+%loading by default, with normal setup of siunitx
+\usepackage[english]{tkz-grapheur}
+
+%loading without sinuitx, to be loaded manually
+\usepackage[nosiunitx]{tkz-grapheur}
+
+%loading without tikz.babel
+\usepackage[notikzbabel]{tkz-grapheur}
+\end{tcblisting}
+
+Also note that certain commands can use packages like \MontreCode{nicefrac}, which will therefore have to be loaded if necessary.
+
+\smallskip
+
+Concerning the \textit{calculations} and \textit{plots} part, the \MontreCode{xint} package takes care of it.
+
+\subsection{Warnings}
+
+It is possible, due to the (multiple) calculations carried out internally, that the compilation time may be a little \textit{long}.
+
+\smallskip
+
+The precision of the (determination) results seems to be around $10^{-4}$, which should normally guarantee \textit{satisfactory} plots and readings. It is still advisable to be cautious about the results obtained and those expected.
+
+\subsection{Introductory example}
+
+For example, we can start from the following example to \textit{illustrate} the flow of the commands for this package. The commands and syntax will be detailed in the following sections!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\begin{GraphTikz}%
+ [x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrid=0.1,Xgrids=0.02,
+ Ymin=0,Ymax=1.001,Ygrid=0.1,Ygrids=0.02]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]%
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ \DefineCurve[Name=cf,Start=0,End=1]<f>{x*exp(x-1)}
+ \DefineCurve[Name=delta,Start=0,End=1]<D>{x}
+ \DrawIntegral[Type=fct/fct]{f(x)}[D(x)]{0}{1}
+ \DrawCurve[Color=red]{f(x)}
+ \DrawCurve[Color=teal]{D(x)}
+ \DrawRanges[Colors=blue/cyan,Lines]{f}{0.8,0.9}
+ \DrawCounterimage[Colors=green!50!black/olive,Lines]{cf}{0.5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,text only}
+ \begin{GraphTikz}%
+ [x=7.5cm,y=7.5cm,Xmin=0,Xmax=1.001,Xgrid=0.1,Xgrids=0.02,
+ Ymin=0,Ymax=1.001,Ygrid=0.1,Ygrids=0.02]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]%
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ {0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1}
+ \DefineCurve[Name=cf,Start=0,End=1]<f>{x*exp(x-1)}
+ \DefineCurve[Name=delta,Start=0,End=1]<D>{x}
+ \DrawIntegral[Type=fct/fct]{f(x)}[D(x)]{0}{1}
+ \DrawCurve[Color=red]{f(x)}
+ \DrawCurve[Color=teal]{D(x)}
+ \DrawRanges[Colors=blue/cyan,Lines]{f}{0.8,0.9}
+ \DrawCounterimage[Colors=green!50!black/olive,Lines]{cf}{0.5}
+ \end{GraphTikz}
+\end{tcblisting}
+
+\newpage
+
+\section{Basic Styles and Environment Creation}
+
+\subsection{Basic Styles}
+
+The styles used for plots are given below.
+
+\smallskip
+
+For \textit{simplicity} purposes, only the color of the elements can be configured, but if the user wishes, he can redefine the proposed styles.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%parameters declared and stored (usable in the environment a posteriori)
+\tikzset{
+ Xmin/.store in=\pflxmin,Xmin/.default=-3,Xmin=-3,
+ Xmax/.store in=\pflxmax,Xmax/.default=3,Xmax=3,
+ Ymin/.store in=\pflymin,Ymin/.default=-3,Ymin=-3,
+ Ymax/.store in=\pflymax,Ymax/.default=3,Ymax=3,
+ Origx/.store in=\pflOx,Origx/.default=0,Origx=0,
+ Origy/.store in=\pflOy,Origy/.default=0,Origy=0,
+ Xgrid/.store in=\pflgrillex,Xgrid/.default=1,Xgrid=1,
+ Xgrids/.store in=\pflgrillexs,Xgrids/.default=0.5,Xgrids=0.5,
+ Ygrid/.store in=\pflgrilley,Ygrid/.default=1,Ygrid=1,
+ Ygrids/.store in=\pflgrilleys,Ygrids/.default=0.5,Ygrids=0.5
+}
+\end{tcblisting}
+
+We therefore find:
+
+\smallskip
+
+\begin{itemize}
+ \item the origin of the mark (\MontreCode{Origx}/\MontreCode{Origy});
+ \item the extreme values of the axes (\MontreCode{Xmin}/\MontreCode{Xmax}/\MontreCode{Ymin}/\MontreCode{Ymax});
+ \item the parameters of the main and secondary grids (\MontreCode{Xgrid}/\MontreCode{Xgrids}/\MontreCode{Ygrid}/\MontreCode{Ygrids}).
+\end{itemize}
+
+\smallskip
+
+Concerning the styles of \textit{objects}, they are given below.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\tikzset{tkzgrphnode/.style={}}
+\tikzset{tkzgrphpoint/.style={line width=0.95pt}}
+\tikzset{tkzgrphpointc/.style={radius=1.75pt}}
+\tikzset{tkzgrphscatter/.style={radius=1.75pt}}
+\tikzset{tkzgrphframe/.style={line width=0.8pt,gray}}
+\tikzset{tkzgrphcurve/.style={line width=1.05pt}}
+\tikzset{tkzgrphline/.style={line width=0.8pt}}
+\tikzset{tkzgrpharrowl/.style={<-,>=latex}}
+\tikzset{tkzgrpharrowr/.style={->,>=latex}}
+\tikzset{tkzgrpharrowlr/.style={<->,>=latex}}
+\tikzset{tkzgrphcounterimage/.style={line width=0.9pt,densely dashed}}
+\tikzset{tkzgrphrange/.style={line width=0.9pt,densely dashed,->,>=latex}}
+\tikzset{tkzgrphgridp/.style={thin,lightgray}}
+\tikzset{tkzgrphgrids/.style={very thin,lightgray}}
+\tikzset{tkzgrphaxes/.style={line width=0.8pt,->,>=latex}}
+\end{tcblisting}
+
+The idea is therefore to be able to redefine styles globally or locally, and possibly add elements, using \mintinline{latex}|mystyle/.append style={...}|.
+
+\subsection{Creating the environment}\label{creaenvt}
+
+The proposed environment is based on \TikZ, so that any \textit{classic} command linked to \TikZ\ can be used alongside the package commands!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\begin{GraphTikz}[tikz options]<keys>
+ %code(s)
+\end{GraphTikz}
+\end{tcblisting}
+
+The \MontreCode{[tikz options]} are the \textit{classic} options that can be passed to a \TikZ\ environment, as well as the \textsf{axes/grids/window} keys presented previously.
+
+\smallskip
+
+The specific (and optional) \MontreCode{<keys>} are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{ThickGrad}: size of the axis graduations (\MontreCode{3pt} for 3pt \textit{above} and 3pt \textit{below});
+ \item \MontreCode{Frame}: boolean (\MontreCode{false} by default) to display a frame which delimits the graphic window (excluding possible graduations).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ <Frame>
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ <Frame>
+\end{GraphTikz}
+\end{tcblisting}
+
+It will obviously be more meaningful with the added graphic elements!
+
+\pagebreak
+
+\subsection{Grids and axes}\label{creaaxesgr}
+
+The first command \textit{useful} will allow you to create the grids, axes and graduations.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawAxisGrids[keys]{gradX}{gradY}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Grid}: boolean (\MontreCode{true} by default) to display the grids (for a single grid, simply set the identical parameters for \MontreCode{Xgrid}/\MontreCode{Xgrids} or \MontreCode {Ygrid}/\MontreCode{Ygrids});
+ \item \MontreCode{Enlarge}: addition at the end of the axes (\MontreCode{0} by default);
+ \item \MontreCode{Grads}: boolean (\MontreCode{true} by default) for graduations;
+ \item \MontreCode{Font}: global font for graduations {\MontreCode{empty} by default};
+ \item \MontreCode{Format}: special formatting (see below) of the axis values.
+\end{itemize}
+
+\smallskip
+
+Concerning the \MontreCode{Format} key, it allows you to specify a specific setting for the axis values.
+
+\smallskip
+
+It can be given in the form \MontreCode{fmt} for combined formatting, or in the form \MontreCode{fmtX/fmtY} to differentiate the formatting.
+
+\smallskip
+
+The possible options are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{num}: format with \textsf{siunitx};
+ \item \MontreCode{year}: format in year;
+ \item \MontreCode{frac}: format as fraction \textsf{frac};
+ \item \MontreCode{dfrac}: format as fraction \textsf{dfrac};
+ \item \MontreCode{nfrac}: format as fraction \textsf{nicefrac};\hfill (to load!)
+ \item \MontreCode{trig}: format in trig with \textsf{frac};
+ \item \MontreCode{dtrig}: format in trig with \textsf{dfrac};
+ \item \MontreCode{ntrig}: format in trig with \textsf{nfrac};
+ \item \MontreCode{sqrt}: format in root with \textsf{frac};
+ \item \MontreCode{dsqrt}: format in root with \textsf{dfrac};
+ \item \MontreCode{nsqrt}: format in root with \textsf{nicefrac}.
+\end{itemize}
+
+\smallskip
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+\end{GraphTikz}
+\end{tcblisting}
+
+Note that there are the Boolean keys \MontreCode{[Behind]} (without the graduations) and \MontreCode{[Above]} (without the grid) to display the axes in \textit{under/over}-printing mode in the case of integrals for example.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=2.75cm,y=3cm,
+ Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
+ \DrawAxisGrids[Enlarge=2.5mm,Format=dtrig/nsqrt,Font=\footnotesize]%
+ {pi/6,pi/4,pi/3,pi/2,2*pi/3,3*pi/4,5*pi/6,pi}
+ {0,sqrt(2)/2,1/2,sqrt(3)/2,1,-1,-sqrt(3)/2,-1/2,-sqrt(2)/2}
+\end{GraphTikz}
+\end{tcblisting}
+
+In the case where the formatting does not give satisfactory result(s), it is possible to use a generic command for placing the graduations.
+
+\subsection{Adding values manually}\label{additionvals}
+
+It is also possible to use a specific command to place values on the axes, independently of an \textit{automated} formatting system.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+in the environment
+\AddXvalues[keys]{grads}{formatted values}
+\AddYvalues[keys]{grads}{formatted values}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Font}: global font for graduations {\MontreCode{empty} by default};
+ \item \MontreCode{Lines}: boolean to add the tick marks {\MontreCode{true} by default}.
+\end{itemize}
+
+\smallskip
+
+The mandatory arguments correspond to the x-coordinates (in \TikZ\ language) and to the labels (in \LaTeX\ language) of the graduations.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=2.75cm,y=3cm,
+ Xmin=0,Xmax=3.5,Xgrid=pi/12,Xgrids=pi/24,
+ Ymin=-1.05,Ymax=1.05,Ygrid=0.2,Ygrids=0.05]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
+ \AddXvalues
+ {0.15,0.6,pi/2,2.8284}
+ {\num{0.15},$\frac35$,$\displaystyle\frac{\pi}{2}$,$\sqrt{8}$}
+ \AddYvalues
+ {-1,0.175,0.3,sqrt(3)/2}
+ {\num{-1},\num{0.175},$\nicefrac{3}{10}$,$\frac{\sqrt{3}}{2}$}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\section{Specific definition commands}
+
+\subsection{Draw a line}\label{tracstraight}
+
+The idea is to propose a command to draw a line, from:
+
+\begin{itemize}
+ \item of two points (or nodes);
+ \item of a point (or node) and the slope.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawLine[keys]{point or node}{point or node or slope}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: possible name of the plot (for reuse);
+ \item \MontreCode{Slope}: boolean to specify that the slope is used (\MontreCode{false} by default);
+ \item \MontreCode{Start}: start of the plot (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: end of the plot (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DefinePts[Mark,Color=gray]{A/-4/3,B/2/0,C/0/-1}
+ \DrawLine[Color=red]{(-2,-1)}{(2,4)}
+ \DrawLine[Color=blue,Start=-5,End=3]{(A)}{(B)}
+ \DrawLine[Color=olive,Slope]{(C)}{0.25}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Define a function, draw the curve of a function}\label{deftracfct}
+
+The idea is to define a function, for later reuse. This command \textit{creates} the function, without tracing it, because in certain cases elements will have to be traced beforehand.
+
+\smallskip
+
+There is also a command to plot the curve of a previously defined function.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DefineCurve[keys]<fct name>{xint formula}
+\DrawCurve[keys]{xint formula}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Start}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Name}: name of the curve (important for the rest!);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Step}: plot step (it is determined \textit{automatically} at the start but can be modified);
+ \item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19]<f>{-2*x+3+24*log(2*x)}
+ \DrawCurve[Color=red,Start=5,End=19]{f(x)}
+ %or in a single command if "sufficient"
+ %\DefineCurve[Name=cf,Start=5,End=19,Trace]<f>{-2*x+3+24*log(2*x)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Define/draw an interpolation curve (simple)}\label{deftracinterpo}
+
+It is also possible to define a curve via support points, therefore a simple interpolation curve.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DefineInterpoCurve[keys]{list of support points}
+\DrawInterpoCurve[keys]{list of support points}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: name of the interpolation curve (important for the rest!);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Tension}: setting the \textit{tension} of the interpolation plot (\MontreCode{0.5} by default);
+ \item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
+\end{itemize}
+
+The mandatory argument allows you to specify the list of support points in the form \MontreCode{(x1,y1)(x2,y2)...}.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ %simple interpolation curves (with diff tension)
+ \DefineInterpoCurve[Name=interpotest,Color=blue,Trace]%
+ {(-6,4)(-2,-2)(3,3.5)}
+ \DefineInterpoCurve[Name=interpotest,Color=red,Trace,Tension=1]%
+ {(-6,4)(-2,-2)(3,3.5)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\newpage
+
+\subsection{Define/draw an interpolation curve (Hermite)}\label{deftracfctspline}
+
+It is also possible to define a curve via support points, therefore an interpolation curve with derivative control.
+
+\smallskip
+
+Some operations require different techniques depending on the type of function used, a \textsf{Boolean} key \MontreCode{Spline} will allow the code to adapt its calculations depending on the object used.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DefineSplineCurve[keys]{list of support points}[\macronomspline]
+\DrawSplineCurve[keys]{list of support points}[\macronomspline]
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: name of the interpolation curve (important for the rest!);
+ \item \MontreCode{Coeffs}: modify (see the \textsf{ProfLycee}\footnote{CTAN documentation: \url{https://ctan.org/pkg/proflycee}} the \textit{coefficients} of the spline;
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Trace}: boolean to also trace the curve (\MontreCode{false} by default).
+\end{itemize}
+
+The mandatory argument allows you to specify the list of support points in the form \MontreCode{x1/y1/f'1§x2/y2/f'2§...} with:
+
+\begin{itemize}
+ \item \MontreCode{xi/yi} the coordinates of the point;
+ \item \MontreCode{f'i} the derivative at the support point.
+\end{itemize}
+
+\smallskip
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ %definition of the list of spline support points
+ \def\LISTETEST{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}
+ %definition and plot of the cubic spline
+ \DefineSplineCurve[Name=splinetest,Trace,Color=olive]{\LISTETEST}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Define points as nodes}\label{defpts}
+
+The second idea is to work with \TikZ nodes, which could be useful for tangent plots, representations of integrals$\ldots$
+
+\smallskip
+
+It is also possible to define nodes for \textit{image} points.
+
+\smallskip
+
+Certain commands (explained later) allow you to determine particular points of curves in the form of nodes, so it seems interesting to be able to define them directly.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%by coordinates
+\DefinePts[keys]{Name1/x1/y1,Name2/x2/y2,...}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Mark}: boolean to mark points (\MontreCode{false} by default);
+ \item \MontreCode{Color}: color of the points, if \MontreCode{Mark=true} (\MontreCode{black} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%as image
+\DefineRange[keys]{object}{abscissa}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: node name (\MontreCode{empty} by default);
+ \item \MontreCode{Spline}: boolean to specify that a spline is used (\MontreCode{false} by default).
+\end{itemize}
+
+The first mandatory argument is the \textit{object} considered (name of the curve for the spline, function otherwise); the second is the abscissa of the point considered.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineFunction[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %manual nodes
+ \DefinePts[Mark,Color=brown]{A/7/42,B/16/49}
+ %imagenode
+ \DefineRange[Name=IMGf]{f}{14}
+ \MarkPts*[Style=x,Color=blue]{(IMGf)} %see next section ;-)
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Mark Points}\label{markpts}
+
+The idea is to offer something to score points with a particular style.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\MarkPts(*)[keys]<font>{list}
+\end{tcblisting}
+
+The \textit{starred} version scores the points without the \textit{names}, while the \textit{unstarred} version displays them:
+
+\begin{itemize}
+ \item in the case of the \textit{starred} version, the list should be given in the form \MontreCode{(ptA),(ptB),...};
+ \item otherwise, the list should be given in the form \MontreCode{(ptA)/poslabelA/labelA,...}.
+\end{itemize}
+
+\smallskip
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Color}: color (\MontreCode{black} by default);
+ \item \MontreCode{Style}: style of marks (\MontreCode{o} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1.5cm,y=1.5cm,Ymin=-2]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DefinePts{A/1.75,-1.25}\MarkPts[Color=pink]{(A)/below/A} %round (default)
+ \MarkPts[Color=teal]{(1,1)/below/M}
+ \MarkPts[Color=red,Style=x]{(1.25,1)/below/$A$} %cross
+ \MarkPts[Color=orange,Style=+]<\small\sffamily>{(1.5,1)/below/K} %plus
+ \MarkPts[Color=blue,Style=c]{(1.75,1)/below/P} %square
+ \MarkPts[Color=gray,Style=d]{(2,1)/below/P} %diamond
+ \MarkPts*[Color=orange/yellow]{(2,2),(2.5,2.25)} %two-tone round
+ \MarkPts*[Style=+,Color=red]{(1,2)}
+ \MarkPts*[Style=x,Color=blue]{(2.25,1)}
+ \MarkPts*[Style=c,Color=magenta]{(-2,-1)}
+ \MarkPts[Color=red,Style=x]{(-1,1)/below/$A$,(-2,2)/below left/$B$}
+\end{GraphTikz}
+\end{tcblisting}
+
+Note that it is also possible to modify the size of the \MontreCode{o/x/+/c} marks via the \MontreCode{[keys]}:
+
+\begin{itemize}
+ \item \MontreCode{Sizex=...} (\MontreCode{2pt} by default) for points \textit{cross};
+ \item \MontreCode{Sizeo=...} (\MontreCode{1.75pt} by default) for the points \textit{circle};
+ \item \MontreCode{Sizec=...} (\MontreCode{2pt} by default) for the \textit{square} points.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1cm,y=1cm,Xmin=0,Ymin=0]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \MarkPts[Color=red,Style=x,Size=3.5pt]{(1.25,1.25)/below/$A$}
+ \MarkPts[Color=teal,Size=2.5pt]{(2,2)/right/$A$}
+ \MarkPts*[Color=orange,Style=c,Size=4pt]{(0.5,2.5)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\subsection{Retrieve node coordinates}\label{recupcoordo}
+
+It is also possible, with a view to reusing coordinates, to recover the coordinates of a node (defined or determined).
+
+\smallskip
+
+The calculations are carried out by floating according to the (re)calculated units, the values are therefore approximated !
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\GetXcoord{node}[\macrox]
+\GetYcoord{node}[\macroy]
+\GetXYcoord{node}[\macrox][\macroy]
+\end{tcblisting}
+
+\subsection{Place text}\label{placetxt}
+
+Note that a text placement command is available.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawTxt[keys]{(node or coordinates)}{text}
+\end{tcblisting}
+
+The available \MontreCode{[keys]} are:
+
+\begin{itemize}
+ \item \MontreCode{Font=...} (\MontreCode{\textbackslash normalsize\textbackslash normalfont} by default) for the font;
+ \item \MontreCode{Color=...} (\MontreCode{black} by default) for the color;
+ \item \MontreCode{Position=...} (\MontreCode{empty} by default) for the position of the text relative to the coordinates.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1cm,y=1cm,Xmin=0,Xmax=5,Ymin=0,Ymax=1]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DrawTxt[Color=red,Font=\LARGE,Position=right]{(1.5,0.5)}{curve $C_1$}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Specific commands for using curves}
+
+\subsection{Image placement}\label{images}
+
+It is possible to place points (images) on a curve, with possible construction lines.
+
+The function/curve used must have been declared previously for this command to work.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawRanges[keys]{function or curve}{list of abscissa}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Lines}: boolean to display construction traits (\MontreCode{false} by default);
+ \item \MontreCode{Colors}: color of the points/lines, in the form \MontreCode{Couleurs} or \MontreCode{ColPoint/ColLines};
+ \item \MontreCode{Spline}: boolean to specify that the curve used is defined as a \textsf{spline} (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify:
+
+\smallskip
+
+\begin{itemize}
+ \item the name of the curve in the case \MontreCode{Spline=true};
+ \item the name of the function otherwise.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %images
+ \DrawRanges[Lines,Colors=teal/blue]{f}{6,7,8,9,10}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Antecedent determination}\label{defanteced}
+
+It is possible to graphically determine the antecedents of a given reality.
+
+The function/curve used must have been declared previously for this command to work.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\FindCounterimage[keys]{curve}{k}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: base of the name of the \textbf{nodes} intersection (\MontreCode{S} by default, which will give \textsf{S-1}, \textsf{S-2}, etc);
+ \item \MontreCode{Disp}: boolean to display the points (\MontreCode{true} by default);
+ \item \MontreCode{Color}: color of the points (\MontreCode{black} by default);
+ \item \MontreCode{DispLine}: boolean to display the horizontal line (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the curve.
+
+\smallskip
+
+The second mandatory argument allows you to specify the value to reach.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %history
+ \FindCounterimage[Color=teal,DispLine,Disp]{cf}{53}
+ %the two antecedents are at nodes (S-1) and (S-2)
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Antecedent construction}\label{tracanteced}
+
+It is possible to graphically construct the antecedents.
+
+The function/curve used must have been declared previously for this command to work.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawCounterimage[keys]{curve}{k}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Colors}: color of the points/lines, in the form \MontreCode{Color} or \MontreCode{ColPoint/ColLines};
+ \item \MontreCode{Name}: name \textit{possible} for the intersection points linked to the antecedents (\MontreCode{empty} by default);
+ \item \MontreCode{Lines}: boolean to display construction traits (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the curve.
+
+\smallskip
+
+The second mandatory argument allows you to specify the value to reach.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ %definition of the function + drawing of the curve
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ %history
+ \DrawCounterimage[Colors=teal/cyan,Lines,Name=PO]{cf}{53}
+ \GetXcoord{(PO-1)}[\premsol]
+ \GetXcoord{(PO-2)}[\deuxsol]
+\end{GraphTikz}
+
+Graphically, the antecedents of 53 are (approximately):
+
+\begin{itemize}
+ \item \num{\premsol}
+ \item \num{\deuxsol}
+\end{itemize}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Intersections of two curves}\label{intersect}
+
+It is also possible to determine (in the form of nodes) the possible points of intersection of two previously defined curves.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\FindIntersections[keys]{curve1}{curve2}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Name}: base of the name of the \textbf{nodes} intersection (\MontreCode{S} by default, which will give \textsf{S-1}, \textsf{S-2}, etc);
+ \item \MontreCode{Disp}: boolean to display the points (\MontreCode{true} by default);
+ \item \MontreCode{Color}: color of the points (\MontreCode{black} by default).
+\end{itemize}
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the first curve.
+
+\smallskip
+
+The first mandatory argument allows you to specify the \textbf{name} of the second curve.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ \DefineCurve[Name=cf,Start=5,End=19,Trace,Color=red]<f>{-2*x+3+24*log(2*x)}
+ \DefineCurve[Name=cg,Start=5,End=19,Trace,Color=blue]<g>{0.25*(x-12)^2+46}
+ %intersections, named (TT-1) and (TT-2)
+ \FindIntersections[Name=TT,Color=darkgray,Display,Lines]{cf}{cg}
+ %recovery of intersection points
+ \GetXYcoord{(TT-1)}[\alphaA][\betaA]
+ \GetXYcoord{(TT-2)}[\alphaB][\betaB]
+\end{GraphTikz}\\
+The solutions of $f(x)=g(x)$ are $\alpha \approx \num{\alphaA}$ and
+$\beta \approx \num{\alphaB}$.\\
+The points of intersection of the curves of $f$ and $g$ are therefore
+$(\RoundNb[2]{\alphaA};\RoundNb[2]{\betaA})$ and
+$(\RoundNb[2]{\alphaB};\RoundNb[2]{\betaB})$.
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Extrema}\label{maximum}\label{minimum}
+
+The idea (still \textit{experimental}) is to offer commands to extract the extrema of a curve defined by the package.
+
+The command creates the corresponding node, and it is therefore possible to retrieve its coordinates for later use.
+
+\smallskip
+
+It is possible, by specifying it, to work on the different curves managed by the package (function, interpolation, spline).
+
+For singular curves, it is possible that the results are not quite those expected\ldots
+
+\smallskip
+
+{\small\faBomb} For the moment, the \textit{limitations} are:
+
+\begin{itemize}
+ \item no management of multiple extrema (only the first will be processed)\ldots
+ \item no management of extrema at the boundaries of the route\ldots
+ \item no automatic recovery of curve definition parameters\ldots
+ \item compilation time may be longer\ldots
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\FindMax[keys]{object}[node created]
+\FindMin[keys]{object}[node created]
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} available are:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Method}: method, among \MontreCode{function/interpo/spline} for calculations (\MontreCode{function} by default);
+ \item \MontreCode{Start}: start of the plot (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: end of the plot (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Step}: not in the plot if \MontreCode{function} (it is determined \textit{automatically} at the start but can be modified);
+ \item \MontreCode{Coeffs}: modify the \textit{coefficients} of the spline if \MontreCode{spline};
+ \item \MontreCode{Tension}: setting the \textit{tension} of the interpolation plot if \MontreCode{interpo}(\MontreCode{0.5} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=1cm,y=1cm,Xmin=-1,Xmax=5,Ymin=-1,Ymax=3]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \DefineCurve[Name=cf,Start=0.35,End=4.2,Trace]%
+ <f>{0.6*cos(4.5*(x-4)+2.1)-1.2*sin(x-4)+0.1*x+0.2}
+ \FindMax[Start=0.35,End=4.2]{f}[cf-max]
+ \FindMax[Start=3,End=4]{f}[cf-maxlocal]
+ \FindMin[Start=1,End=2]{f}[cf-minlocal]
+ \MarkPts*[Color=red,Lines]{(cf-max)}
+ \MarkPts*[Color=blue,Lines]{(cf-maxlocal)}
+ \MarkPts*[Color=olive,Lines]{(cf-minlocal)}
+ \GetXYcoord{(cf-max)}[\MyMaxX][\MyMaxY]
+\end{GraphTikz}\\
+The maximum is $M\approx\RoundNb{\MyMaxY}$, reached in $x\approx\RoundNb{\MyMaxX}$
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}[x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineInterpoCurve[Name=interpotest,Color=red,Trace,Tension=1]%
+ {(-6,4)(-2,-2)(3,3.5)}
+ \FindMin[Method=interpo,Tension=1]{(-6,4)(-2,-2)(3,3.5)}[interpo-min]
+ \MarkPts*[Color=blue]{(interpo-min)}
+ \GetXYcoord{(interpo-min)}[\MinInterpoX][\MinInterpoY]
+\end{GraphTikz}\\
+The minimum is $M\approx\RoundNb[3]{\MinInterpoY}$, reached at $x\approx\RoundNb[3]{\MinInterpoX}$
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=1.2cm,y=1.6cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=3,Ygrid=0.5,Ygrids=0.25]
+ \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+ \def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
+ \DefineSplineCurve[Name=splinetest,Trace]{\LISTETEST}
+ \FindMin[Method=spline]{\LISTETEST}[spline-min]
+ \MarkPts*[Color=red]{(spline-min)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Integrals (improved version)}\label{integr}
+
+We can also work with integrals.
+
+In this case it is preferable to highlight the domain \textbf{before} the plots, to avoid overprinting in relation to the curves/points.
+
+\smallskip
+
+It is possible to :
+
+\begin{itemize}
+ \item represent an integral \textbf{under} a defined curve;
+ \item represent an integral \textbf{between} two curves;
+ \item the integration limits can be x-coordinates and/or nodes.
+\end{itemize}
+
+\smallskip
+
+{\small\faBomb} Given the differences in processing between formula curves, simple interpolation curves or cubic interpolation curves, the arguments and keys may differ depending on the configuration!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawIntegral[keys]<specific options>{object1}[object2]{A}{B}
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\begin{itemize}
+ \item \MontreCode{Colors} =: colors of the filling, in the form \MontreCode{Col} or \MontreCode{ColBorder/ColBg} (\MontreCode{gray} by default);
+ \item \MontreCode{Style}: type of filling, among \MontreCode{fill}/\MontreCode{hatch} (\MontreCode{fill} by default);
+ \item \MontreCode{Opacity}: opacity (\MontreCode{0.5} by default) of the filling;
+ \item \MontreCode{Hatch}: style (\MontreCode{north west lines} by default) of the hatch filling;
+ \item \MontreCode{Type}: type of integral among
+ \begin{itemize}
+ \item \MontreCode{fct} (default) for an integral under a curve defined by a formula;
+ \item \MontreCode{spl} for an integral under a curve defined by a cubic spline;
+ \item \MontreCode{itp} for an integral under a curve defined by interpolation ;
+ \item \MontreCode{fct/fct} for an integral between two curves defined by a formula;
+ \item \MontreCode{fct/spl} for an integral between a curve (above) defined by a formula and a curve (below) defined by a spline cubic;
+ \item etc.
+ \end{itemize}
+ \item \MontreCode{Step}: steps (calculated by default otherwise) for the plot;
+ \item \MontreCode{Junction}: junction of segments (\MontreCode{bevel} by default);
+ \item \MontreCode{Bounds}: type of terminals among:
+ \begin{itemize}
+ \item \MontreCode{abs} for the limits given by the abscissa;
+ \item \MontreCode{nodes} for the limits given by the nodes;
+ \item \MontreCode{abs/node} for the limits given by abscissa and node;
+ \item \MontreCode{node/abs} for the limits given by node and abscissa;
+ \end{itemize}
+ \item \MontreCode{Border}: boolean (\MontreCode{true} by default) to display the side lines,%
+ \item \MontreCode{SplineName}: macro (important!) of the spline generated previously for a higher version spline;
+ \item \MontreCode{SplineNameB}: macro (important!) of the spline generated previously for a lower version spline;
+ \item \MontreCode{InterpoName}: name (important!) of the interpolation curve generated previously, in higher version;
+ \item \MontreCode{InterpoBName}: name (important!) of the interpolation curve generated previously, in lower version;
+ \item \MontreCode{Tension}: Tension for the interpolation curve generated previously, in higher version;
+ \item \MontreCode{TensionB}: Tension of the interpolation curve generated previously, in lower version.
+\end{itemize}
+
+\smallskip
+
+The first required argument is the spline function or curve or list of interpolation points.
+
+\smallskip
+
+The next optional argument is the spline function or curve or list of interpolation points.
+
+\smallskip
+
+The last two mandatory arguments are the limits of the integral, given in a form consistent with the key \MontreCode{Bounds}.
+
+\pagebreak
+
+In the case of curves defined by \textit{points}, it is necessary to work on intervals on which the first curve is \textbf{above} the second.
+
+It will undoubtedly be interesting to work with \textit{intersections} in this case.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.6cm,y=0.06cm,
+ Xmin=0,Xmax=21,Xgrid=1,Xgrids=0.5,
+ Ymin=0,Ymax=155,Ygrid=10,Ygrids=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
+ \DefineCurve[Name=cf,Start=1,End=20,Color=red]<f>{80*x*exp(-0.2*x)}
+ \DrawIntegral
+ [Bounds=abs,Colors=blue/cyan!50]%
+ {f(x)}{3}{12}
+ \DrawCurve[Color=red,Start=1,End=20]{f(x)}
+ \DrawAxisGrids%
+ [Grid=false,Enlarge=2.5mm,Font=\small]{0,1,...,20}{0,10,...,150}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=1.2cm,y=1.6cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=3,Ygrid=0.5,Ygrids=0.25]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{}{}
+ \def\LISTETEST{-6/2/0§-1/-2/0§2/1/0§3.5/0/-1}
+ \DefineSplineCurve[Name=splinetest]{\LISTETEST}
+ \DrawIntegral[Type=spl,Style=hatch,Colors=purple]{splinetest}{-5.75}{-4.75}
+ \DrawIntegral[Type=spl,Colors=blue]{splinetest}{-2}{-1}
+ \DrawIntegral[Type=spl,Colors=orange]{splinetest}{1}{3}
+ \DrawSplineCurve[Color=olive]{\LISTETEST}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]
+ {-7,-6,...,4}%
+ {-3,-2.5,...,3}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+\subsection{Tangents}\label{tgte}
+
+The idea of this command is to draw the tangent to a previously defined curve, specifying:
+
+\begin{itemize}
+ \item the point (abscissa or node) at which we wish to work;
+ \item possibly the direction (in the case of a discontinuity or a terminal);
+ \item possibly the step ($h$) of the calculation;
+ \item the \textit{lateral spacings} to draw the tangent.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawTangent[keys]{function or curve}{point}<line options>
+\end{tcblisting}
+
+The optional \MontreCode{[keys]} for definition or tracing are:
+
+\begin{itemize}
+ \item \MontreCode{Colors} =: colors of the plots, in the form \MontreCode{Col} or \MontreCode{ColLine/ColPoint} (\MontreCode{black} by default);
+ \item \MontreCode{OffsetL} =: left horizontal spacing to start the trace (\MontreCode{1} by default);
+ \item \MontreCode{OffsetR} =: left horizontal spacing to start the trace (\MontreCode{1} by default);
+ \item \MontreCode{DispPt}: boolean to display the support point (\MontreCode{false} by default);
+ \item \MontreCode{Spline}: boolean to specify that a spline is used (\MontreCode{false} by default);
+ \item \MontreCode{h}: delta $h$ used for calculations (\MontreCode{0.01} by default);
+ \item \MontreCode{Direction}: allows you to specify the \textit{direction} of the tangent, among \MontreCode{lr}/\MontreCode{l}/\MontreCode{r} (\MontreCode{lr} by default);
+ \item \MontreCode{Node}: boolean to specify that a node is used (\MontreCode{false} by default).
+\end{itemize}
+
+\smallskip
+
+The first required argument is the spline function or curve (if applicable).
+
+\smallskip
+
+The last mandatory argument is the work point (abscissa version or node following the key \MontreCode{Node}).
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
+ Ymin=40,Ymax=56,Ygrid=2,Ygrids=1,Origy=40]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{4,5,...,20}{40,42,...,56}
+ \DefineCurve[Name=cf,Start=5,End=19,Color=red,Trace]<f>{-2*x+3+24*log(2*x)}
+ \FindCounterimage[Color=teal,Name=JKL,Disp=false]{cf}{53}
+ %tangent
+ \DrawTangent%
+ [Colors=cyan/gray,OffsetL=2.5,OffsetR=2.5,Node,DispPt]{f}{(JKL-1)}
+\end{GraphTikz}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \def\LISTETEST{-6/4/-0.5§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}
+ \DefineSplineCurve[Name=splinetest,Trace,Color=olive]{\LISTETEST}
+ \DrawTangent[Colors=red,Spline,DispPt]{splinetest}{1}
+ \DrawTangent%
+ [Colors=blue,Spline,OffsetL=1.5,OffsetR=1.5,DispPt]{splinetest}{-3}%
+ <tkzgrpharrowlr>
+ \DrawTangent[Direction=l,Colors=orange,Spline,OffsetL=1.5,DispPt]{splinetest}{3}
+ \DrawTangent[Direction=r,Colors=purple,Spline,OffsetR=1.5,DispPt]{splinetest}{-6}
+\end{GraphTikz}
+\end{tcblisting}
+
+\pagebreak
+
+%\section{Specific commands for density functions}
+%
+%\subsection{Normal distribution}\label{normal distribution}
+%
+%The idea is to provide something to work with standard deviation.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+% %in the GraphiqueTikz environment
+% \DefineNormalDistribution[keys]<fct name>{mu}{sigma}
+% \TraceNormalDistribution[keys]{fct(x)}
+%\end{tcblisting}
+%
+%The optional \MontreCode{[keys]} available are:
+%
+%\smallskip
+%
+%\begin{itemize}
+% \item \MontreCode{Name}: name of the plot (\MontreCode{Gaussian} by default);
+% \item \MontreCode{Trace}: boolean to trace the curve (\MontreCode{false} by default);
+% \item \MontreCode{Couleur}: color of the trace, if requested (\MontreCode{black} by default);
+% \item \MontreCode{Debut}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+% \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+% \item \MontreCode{Pas}: plot step (it is determined \textit{automatically} at the start but can be modified).
+%\end{itemize}
+%
+%Note that the vertical axis must be adapted according to the parameters of the normal law.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+% \begin{GraphTikz}%
+% [x=1.25cm,y=15cm,Origx=5,Xmin=5,Xmax=15,Ymin=0,Ymax=0.3,
+% Ygrid=0.1,Ygrids=0.05]
+% \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+% \DefineNormalDistribution[Name=Gaussian]<phi>{10}{1.5}
+% \TracerIntegral
+% [Terminals=abs, Colors=blue/cyan!50]%
+% {phi(x)}{7}{13}
+% \TraceNormalLaw[Color=purple,Start=5,End=15]{phi(x)}
+% \end{GraphTikz}
+%\end{tcblisting}
+%
+%\pagebreak
+%
+%\subsection{Chi-square law}\label{loikhideux}
+%
+%The idea is to provide something to work with normal laws.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+% %in the GraphiqueTikz environment
+% \DefineKhiTwoLaw[keys]<fct name>{k}
+% \TraceLawKhiTwo[keys]{fct(x)}
+%\end{tcblisting}
+%
+%The optional \MontreCode{[keys]} available are:
+%
+%\smallskip
+%
+%\begin{itemize}
+% \item \MontreCode{Name}: name of the plot (\MontreCode{Gaussian} by default);
+% \item \MontreCode{Trace}: boolean to trace the curve (\MontreCode{false} by default);
+% \item \MontreCode{Couleur}: color of the trace, if requested (\MontreCode{black} by default);
+% \item \MontreCode{Debut}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+% \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+% \item \MontreCode{Pas}: plot step (it is determined \textit{automatically} at the start but can be modified).
+%\end{itemize}
+%
+%Note that the vertical axis must be adapted according to the parameter of the chi-square law.
+%
+%\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+% \begin{GraphTikz}[
+% x=1.5cm,y=7.5cm,
+% Xmin=0,Xmax=8,Xgrid=1,Xgrids=0.5,
+% Ymin=0,Ymax=0.5,Ygrid=0.1,Ygrids=0.05
+% ]
+% \DrawAxisGrids[Enlarge=2.5mm]{auto}{auto}
+% \DefineKhiTwoLaw[Color=red,Start=0.25,Trace]<phiA>{1}
+% \DefineKhiTwoLaw[Color=blue,Trace]<phiB>{2}
+% \DefineLawKhiDeux[Color=orange,Trace]<phiC>{3}
+% \DefineKhiTwoLaw[Color=purple,Trace]<phiD>{4}
+% \DefineKhiTwoLaw[Color=yellow,Trace]<phiE>{5}
+% \DefineKhiTwoLaw[Color=teal,Trace]<phiF>{6}
+% \end{GraphTikz}
+%\end{tcblisting}
+
+\pagebreak
+
+\section{Commands specific to two-variable statistics}
+
+\subsection{The point cloud}\label{scatter}
+
+In addition to commands linked to functions, it is also possible to represent double statistical series.
+
+\smallskip
+
+The following paragraph shows that adding a key allows you to add the linear adjustment line.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%in the GraphiqueTikz environment
+\DrawScatter[keys]{ListX}{ListY}
+\end{tcblisting}
+
+The optional \MontreCode{[key]} is:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{ColorScatter}: color of the cloud points (\MontreCode{black} by default).
+\end{itemize}
+
+\smallskip
+
+The mandatory arguments allow you to specify:
+
+\smallskip
+
+\begin{itemize}
+ \item the list of x;
+ \item the list of y.
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ %window preparation
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
+ %A cloud of dots
+ \DrawScatter[Style=x,ColorScatter=red]{0,50,100,140}{275,290,315,350}
+\end{GraphTikz}
+\end{tcblisting}
+
+\subsection{The regression line}\label{reglin}
+
+The linear regression line (obtained by the least squares method) can easily be added, using the key \MontreCode{DrawLine}.
+
+\smallskip
+
+In this case, new keys are available:
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{ColorLine}: color of the line (\MontreCode{black} by default);
+ \item \MontreCode{Rounds}: precision of coefficients (\MontreCode{empty} by default);
+ \item \MontreCode{Start}: initial abscissa of the plot (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: terminal abscissa of the plot (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Name}: name of the line, for later use (\MontreCode{reglin} by default).
+\end{itemize}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.075cm,y=0.03cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\small]{0,10,...,160}{250,275,...,400}
+ %cloud and right
+ \DrawScatter%
+ [ColorScatter=red,ColorLine=brown,DrawLine]%
+ {0,50,100,140}{275,290,315,350}
+ %picture
+ \DrawRanges[Colors=cyan/magenta,Lines]{d}{120}
+ %history
+ \DrawCounterimage[Style=x,Colors=blue/green!50!black,Lines]{reglin}{300}
+\end{GraphTikz}
+\end{tcblisting}
+
+\subsection{Other regressions}\label{regressions}
+
+In partnership with the \MontreCode{xint-regression} package, loaded by the package (but \textit{can be deactivated} via the \MontreCode{[noxintreg]} option), it is possible to work on other types of regression:
+
+\begin{itemize}
+ \item linear \fbox{$ax+b$};
+ \item quadratic \fbox{$ax^2+bx+c$};
+ \item cubic \fbox{$ax^3+bx^2+cx+d$};
+ \item power \fbox{$ax^b$};
+ \item exponential \fbox{$ab^x$} or \fbox{$e^{ax+b}$} or \fbox{$b e^{ax}$} or \fbox{$C + be^{ax} $};
+ \item logarithmic \fbox{$a+b\ln(x)$};
+ \item hyperbolic \fbox{$a+\displaystyle\frac{b}{x}$}.
+\end{itemize}
+
+The command, similar to that of defining a curve, is:
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\DrawRegression[keys]<no fct>{type}<rounded>{listex}{listey}
+\end{tcblisting}
+
+The \MontreCode{[keys]} available are, classically:
+
+\begin{itemize}
+ \item \MontreCode{Start}: lower bound of the definition set (\MontreCode{\textbackslash pflxmin} by default);
+ \item \MontreCode{End}: lower bound of the definition set (\MontreCode{\textbackslash pflxmax} by default);
+ \item \MontreCode{Name}: name of the curve (important for the rest!);
+ \item \MontreCode{Color}: color of the trace (\MontreCode{black} by default);
+ \item \MontreCode{Step}: plot step (it is determined \textit{automatically} at the start but can be modified).
+\end{itemize}
+
+\pagebreak
+
+The second argument, optional and between \MontreCode{<...>}, allows you to name the regression function.
+
+The third argument, mandatory and between \MontreCode{\{...\}} allows you to choose the type of regression, among:
+
+\begin{itemize}
+ \item \MontreCode{lin}: linear \fbox{$ax+b$};
+ \item \MontreCode{quad}: quadratic \fbox{$ax^2+bx+c$};
+ \item \MontreCode{cub}: cubic \fbox{$ax^3+bx^2+cx+d$};
+ \item \MontreCode{pow}: power \fbox{$ax^b$};
+ \item \MontreCode{expab}: exponential \fbox{$ab^x$}
+ \item \MontreCode{hyp}: hyperbolic \fbox{$a+\displaystyle\frac{b}{x}$};
+ \item \MontreCode{log}: logarithmic \fbox{$a+b\ln(x)$};
+ \item \MontreCode{exp}: exponential \fbox{$e^{ax+b}$};
+ \item \MontreCode{expalt}: exponential \fbox{$be^{ax}$};
+ \item \MontreCode{expoff=C}: exponential \fbox{$C + be^{ax}$}.
+\end{itemize}
+
+The fourth argument, optional and between \MontreCode{<...>}, allows you to specify the rounding(s) for the coefficients of the regression function.
+
+The last two arguments are the lists of values of X and Y.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\def\LISTEXX{0,50,100,140}\def\LISTEYY{275,290,315,350}%
+ListX := \LISTEXX\\
+ListY := \LISTEYY
+
+\begin{GraphTikz}
+ [x=0.05cm,y=0.04cm,Xmin=0,Xmax=160,Xgrid=20,Xgrids=10,
+ Origy=250,Ymin=250,Ymax=400,Ygrid=25,Ygrids=5]
+ %window preparation
+ \DrawAxisGrids[Enlarge=2.5mm,Font=\footnotesize]{auto}{auto}
+ %A cloud of dots
+ \DrawScatter[Style=o,ColorScatter=red]{\LISTEXX}{\LISTEYY}
+ %adjustment expoffset
+ \DrawRegression[Color=blue,Name=adjust]<adjust>{expoff=250}{\LISTEXX}{\LISTEYY}
+ %holdings
+ \DrawRanges[Colors=cyan/magenta,Lines]{adjust}{80}
+ \DrawCounterimage[Style=x,Colors=blue/green!50!black,Lines]{adjust}{325}
+\end{GraphTikz}
+
+\xintexpoffreg[offset=250,round=3/1]{\LISTEXX}{\LISTEYY}%
+We obtain $y=250+\num{\expregoffb}\text{e}^{\num{\expregoffa}x}$
+\end{tcblisting}
+
+\newpage
+
+\section{Auxiliary commands}
+
+\subsection{Intro}
+
+In addition to purely \textit{graphic} commands, some auxiliary commands are available:
+
+\begin{itemize}
+ \item a to format a number with a given precision;
+ \item one for working on random numbers, with constraints.
+\end{itemize}
+
+\subsection{Formatted rounding}\label{round number}
+
+The \MontreCode{\textbackslash RoundNb} command allows you to format, using the \MontreCode{siunitx} package, a number (or a calculation), with a given precision. This can be \textit{useful} for formatting results obtained using coordinate retrieval commands, for example.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\RoundNb[precision]{xint calculation}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\RoundNb{1/3}\\
+\RoundNb{16.1}\\
+\RoundNb[3]{log(10)}\\
+\end{tcblisting}
+
+\subsection{Random number under constraints}\label{nbalea}
+
+The idea of this second command is to be able to determine a random number:
+
+\begin{itemize}
+ \item integer or decimal;
+ \item under constraints (between two fixed values).
+\end{itemize}
+
+This can allow, for example, to work on curves with \textit{random} points, but respecting certain constraints.
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+\PickRandomNb(*)[precision (def 0)]{lower limit}{upper limit}[\macro]
+\end{tcblisting}
+
+The star version takes the constraints in strict form ($\text{lower bound} < \text{macro} < \text{upper bound}$) while the normal version takes the constraints in broad form ($\text{lower bound) } \leq \text{macro} \leq \text{upper bound}$).
+
+\smallskip
+
+Note that the \textit{terminals} can be existing \textit{macros}!
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%a number (2 digits after the decimal point) between 0.75 and 0.95
+%a number (2 digits after the decimal point) between 0.05 and 0.25
+%a number (2 decimal places) between 0.55 and \YrandMax
+%a number (2 decimal places) between \YrandMin and 0.45
+\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
+\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
+\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
+\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
+%verification
+\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%a number (2 digits after the decimal point) between 0.75 and 0.95
+%a number (2 digits after the decimal point) between 0.05 and 0.25
+%a number (2 decimal places) between 0.55 and \YrandMax
+%a number (2 decimal places) between \YrandMin and 0.45
+\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
+\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
+\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
+\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
+%verification
+\num{\YrandMax} \& \num{\YrandMin} \& \num{\YrandA} \& \num{\YrandB}
+\end{tcblisting}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+%the curve is designed so that there are 3 antecedents
+\PickRandomNb[2]{0.75}{0.95}[\YrandMax]%
+\PickRandomNb[2]{0.05}{0.25}[\YrandMin]%
+\PickRandomNb*[2]{0.55}{\YrandMax}[\YrandA]%
+\PickRandomNb*[2]{\YrandMin}{0.45}[\YrandB]%
+
+\begin{GraphTikz}
+ [x=0.075cm,y=7.5cm,Xmin=0,Xmax=150,Xgrid=10,Xgrids=5,
+ Ymin=0,Ymax=1,Ygrid=0.1,Ygrids=0.05]
+ \DrawAxisGrids[Last,Enlarge=2.5mm]{auto}{auto}
+ \DefineInterpoCurve[Color=red,Trace,Name=functiontest,Tension=0.75]
+ {(0,\YrandA)(40,\YrandMin)(90,\YrandMax)(140,\YrandB)}
+ \FindCounterimage[Disp=false,Name=ANTECED]{functiontest}{0.5}
+ \DrawCounterimage[Colors=blue/teal,Lines]{functiontest}{0.5}
+ \GetXcoord{(ANTECED-1)}[\Aalpha]
+ \GetXcoord{(ANTECED-2)}[\Bbeta]
+ \GetXcoord
+ {(ANTECED-3)}[\Cgamma]
+\end{GraphTikz}
+
+The solutions of $f(x)=\num{0.5}$ are, by graphic reading:
+$\begin{cases}
+ \alpha \approx \RoundNb[0]{\Aalpha} \\
+ \beta \approx \RoundNb[0]{\Bbeta} \\
+ \gamma \approx \RoundNb[0]{\Cgamma}
+\end{cases}$.
+\end{tcblisting}
+%
+%\newpage
+%
+%\section{Liste des commandes}
+%
+%Les commandes disponibles sont :
+%
+%\NewDocumentCommand\lstcmd{ m m m }{%
+% \item[\texttt{#1}] : \mintinline{latex}|#2|\hfill{}page \pageref{#3}
+%}
+%
+%\begin{description}
+% \lstcmd{environnement~~}{\begin{GraphiqueTikz}...\end{GraphiqueTikz}}{creaenvt}
+% \lstcmd{axes et grilles}{\TracerAxesGrille}{creaaxesgr}
+% \lstcmd{aj val axes X~~}{\RajouterValeursAxeX}{ajoutvals}
+% \lstcmd{aj val axes Y~~}{\RajouterValeursAxeY}{ajoutvals}
+% \lstcmd{def fonction~~~}{\DefineCurve}{deftracfct}
+% \lstcmd{tracé courbe~~~}{\DrawCurve}{deftracfct}
+% \lstcmd{def interpo~~~~}{\DefineCurveInterpo}{deftracinterpo}
+% \lstcmd{tracé interpo~~}{\DrawCurveInterpo}{deftracinterpo}
+% \lstcmd{def spline~~~~~}{\DefineSplineCurve}{deftracfctspline}
+% \lstcmd{tracé spline~~~}{\DrawSplineCurve}{deftracfctspline}
+% \lstcmd{tracé droite~~~}{\TracerDroite}{tracdroite}
+% \lstcmd{def points~~~~~}{\DefinirPts}{defpts}
+% \lstcmd{def image~~~~~~}{\DefinirImage}{defpts}
+% \lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts}
+% \lstcmd{placer txt~~~~~}{\PlacerTexte}{placetxt}
+% \lstcmd{récup absc~~~~~}{\RecupererAbscisse}{recupcoordo}
+% \lstcmd{récup ordo~~~~~}{\RecupererOrdonnee}{recupcoordo}
+% \lstcmd{récup coordos~~}{\RecupererCoordonnees}{recupcoordo}
+% \lstcmd{images~~~~~~~~~}{\PlacerImages}{images}
+% \lstcmd{antécédents~~~~}{\TrouverAntecedents}{defanteced}
+% \lstcmd{antécédents~~~~}{\PlacerAntecedents}{tracanteced}
+% \lstcmd{intersection~~~}{\TrouverIntersections}{intersect}
+% \lstcmd{maximum~~~~~~~~}{\TrouverMaximum}{maximum}
+% \lstcmd{minimum~~~~~~~~}{\TrouverMinimum}{minimum}
+% \lstcmd{intégrale~~~~~~}{\DrawIntegral}{integr}
+% \lstcmd{tangente~~~~~~~}{\DrawTangente}{tgte}
+% \lstcmd{loi normale~~~~}{\DefinirLoiNormale}{loinormale}
+% \lstcmd{loi normale~~~~}{\TracerLoiNormale}{loinormale}
+% \lstcmd{loi khideux~~~~}{\DefinirLoiKhiDeux}{loikhideux}
+% \lstcmd{loi khideux~~~~}{\TracerLoiKhiDeux}{loikhideux}
+% \lstcmd{stats 2 var~~~~}{\TracerNuage}{nuage}
+% \lstcmd{regressions~~~~}{\TracerAjustement}{regressions}
+% \lstcmd{arrondi~~~~~~~~}{\RoundNb}{numarrond}
+% \lstcmd{nb aléat~~~~~~~}{\ChoisirNbAlea}{nbalea}
+%\end{description}
+
+\pagebreak
+
+\section{History}
+
+\begin{quote}
+\begin{verbatim}
+0.1.5 : Initial version [en]
+\end{verbatim}
+\end{quote}
+
+\end{document}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-en.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-fr.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-fr.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-fr.tex 2024-06-22 20:22:01 UTC (rev 71589)
+++ trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-doc-fr.tex 2024-06-22 20:22:15 UTC (rev 71590)
@@ -29,8 +29,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.4}
-\def\TPdate{15/06/2024}
+\def\TPversion{0.1.5}
+\def\TPdate{22/06/2024}
\usepackage{soul}
\usepackage{codehigh}
\usepackage{tabularray}
@@ -403,7 +403,7 @@
\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
%dans l'environnement GraphiqueTikz
-\TracerAxesGrille[clés]{gradX}{gradY}
+\TracerAxesGrilles[clés]{gradX}{gradY}
\end{tcblisting}
Les \MontreCode{[clés]}, optionnelles, disponibles sont :
@@ -607,10 +607,11 @@
Ymin=40,Ymax=56,Ygrille=2,Ygrilles=1,Origy=40]
\TracerAxesGrilles[Elargir=2.5mm,Police=\small]{4,5,...,20}{40,42,...,56}
%définition de la fonction + tracé de la courbe
- \DefinirCourbe[Nom=cf,Debut=5,Fin=19]<f>{-2*x+3+24*log(2*x)}
+ %la fonction ln a été créée pour xint !
+ \DefinirCourbe[Nom=cf,Debut=5,Fin=19]<f>{-2*x+3+24*ln(2*x)}
\TracerCourbe[Couleur=red,Debut=5,Fin=19]{f(x)}
%ou en une seule commande si "suffisant"
- %\DefinirCourbe[Nom=cf,Debut=5,Fin=19,Trace]<f>{-2*x+3+24*log(2*x)}
+ %\DefinirCourbe[Nom=cf,Debut=5,Fin=19,Trace]<f>{-2*x+3+24*ln(2*x)}
\end{GraphiqueTikz}
\end{tcblisting}
@@ -706,10 +707,14 @@
\smallskip
+Il est également possible de définir des nœuds pour des points \textit{image}.
+
+\smallskip
+
Certaines commandes (explicités ultérieurement) permettent de déterminer des points particuliers des courbes sous forme de nœuds, donc il semble intéressant de pouvoir en définir directement.
\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
-%dans l'environnement GraphiqueTikz
+%par les coordonnées
\DefinirPts[clés]{Nom1/x1/y1,Nom2/x2/y2,...}
\end{tcblisting}
@@ -722,6 +727,22 @@
\item \MontreCode{Couleur} : couleur des points, si \MontreCode{Aff=true} (\MontreCode{black} par défaut).
\end{itemize}
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5,listing only}
+%sous forme d'image
+\DefinirImage[clés]{objet}{abscisse}
+\end{tcblisting}
+
+Les \MontreCode{[clés]}, optionnelles, disponibles sont :
+
+\smallskip
+
+\begin{itemize}
+ \item \MontreCode{Nom} : nom du nœud (\MontreCode{vide} par défaut) ;
+ \item \MontreCode{Spline} : booléen pour spécifier qu'un spline est utilisé (\MontreCode{false} par défaut).
+\end{itemize}
+
+Le premier argument obligatoire est l'\textit{objet} considéré (nom de la courbe pour le spline, fonction sinon) ; le second est l'abscisse du point considéré.
+
\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
\begin{GraphiqueTikz}%
[x=0.9cm,y=0.425cm,Xmin=4,Xmax=20,Origx=4,
@@ -731,6 +752,9 @@
\DefinirFonction[Nom=cf,Debut=5,Fin=19,Trace,Couleur=red]<f>{-2*x+3+24*log(2*x)}
%nœuds manuels
\DefinirPts[Aff,Couleur=brown]{A/7/42,B/16/49}
+ %nœud image
+ \DefinirImage[Nom=IMGf]{f}{14}
+ \MarquerPts*[Style=x,Couleur=blue]{(IMGf)}
\end{GraphiqueTikz}
\end{tcblisting}
@@ -1744,6 +1768,7 @@
\lstcmd{tracé spline~~~}{\TracerCourbeSpline}{deftracfctspline}
\lstcmd{tracé droite~~~}{\TracerDroite}{tracdroite}
\lstcmd{def points~~~~~}{\DefinirPts}{defpts}
+ \lstcmd{def image~~~~~~}{\DefinirImage}{defpts}
\lstcmd{marq pts~~~~~~~}{\MarquerPts}{markpts}
\lstcmd{placer txt~~~~~}{\PlacerTexte}{placetxt}
\lstcmd{récup absc~~~~~}{\RecupererAbscisse}{recupcoordo}
@@ -1773,6 +1798,7 @@
\begin{quote}
\begin{verbatim}
+0.1.5 : Correction d'un bug sur les rajouts de valeurs + Nœud pour une image + [en] version !
0.1.4 : Placement de texte
0.1.3 : Ajout de régressions avec le package xint-regression
0.1.2 : Droites + Extremums
Added: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.pdf 2024-06-22 20:22:01 UTC (rev 71589)
+++ trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.pdf 2024-06-22 20:22:15 UTC (rev 71590)
Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.tex 2024-06-22 20:22:15 UTC (rev 71590)
@@ -0,0 +1,251 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: yes, synctex: no, interaction: batchmode}
+
+\documentclass[a4paper,english,11pt]{article}
+\usepackage[margin=1cm,includefoot]{geometry}
+\usepackage[english]{tkz-grapheur}
+\usepackage{tcolorbox}
+\tcbuselibrary{skins,minted}
+\usepackage{babel}
+
+\begin{document}
+
+\part*{Integrals examples}
+
+\section{Below cruve, by default}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Behind,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{0.25*(x+2)^2+1}
+ \DrawIntegral%
+ [Colors=blue/cyan,Style=fill]%
+ {h(x)} %formula
+ {-5.25}{1.5}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawAxisGrids[Above,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Behind interpolation curve}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstInterpol{(-6,4)(-2,-2)(3,3.5)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest,Tension=1.05]{\interpoA}
+ \DrawIntegral%
+ [NameInterpo=interpotest,Colors=blue/cyan,Style=fill,Type=itp,Tension=1.05]%
+ {\interpoA} %pointsinterpo
+ {-5.25}{1.5}
+ \DrawInterpoCurve[Color=red,Tension=1.05]{\interpoA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Behind cubic spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefineSplineCurve[Name=splinetest]{\lstsplineA}<\SplineTeal>
+ \DrawIntegral%
+ [NameSpline=\SplineTeal,Type=spl,Colors=blue/purple,Style=hatch]%
+ {splinetest} %namesplinecurve
+ {-5}{2}
+ \DrawSplineCurve[Color=teal]{\lstsplineA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between curves}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{0.25*(x+2)^2-1}
+ \DefineCurve[Name=ck]<k>{-0.25*x+1}
+ \FindIntersections[Name=ITSC,Disp=false]{ch}{ck}
+ \DrawIntegral%
+ [Colors=olive/pink,Style=fill,Type=fct/fct,Bounds=node/abs]%
+ {h(x)}[k(x)] %formules
+ {(ITSC-1)}{1.5}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawCurve[Color=blue]{k(x)}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between splines}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefineLstSpline{-6/-2/3§-2/4/0§3/-1/0}[\lstsplineB]
+ \DefineSplineCurve[Name=splinetestolive]{\lstsplineA}<\SplineOlive>
+ \DefineSplineCurve[Name=splinetestteal]{\lstsplineB}<\SplineTeal>
+ \FindIntersections[Name=ITT,Disp=false]{splinetestteal}{splinetestolive}
+ \DrawIntegral%
+ [NameSpline=\SplineTeal,NameSplineB=\SplineOlive,Type=spl/spl,Colors=blue/purple,Bounds=nodes]%
+ {splinetestolive} %Namecourbespline
+ [splinetestteal] %Namecourbespline
+ {(ITT-1)}{(ITT-2)}
+ \DrawSplineCurve[Color=teal]{\lstsplineA}
+ \DrawSplineCurve[Color=olive]{\lstsplineB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between interpolations}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstInterpol{(-6,4)(-2,-2)(3,3.5)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest]{\interpoA}
+ \DefineLstInterpol{(-6,-2)(-1,4)(3,0)}[\interpoB]
+ \DefineInterpoCurve[Name=interpotesta]{\interpoB}
+ \DrawIntegral%
+ [NameInterpo=interpotesta,NameInterpoB=interpotest,Type=itp/itp,Colors=olive/pink]%
+ {\interpoB} %pointsinterpo
+ [\interpoA] %pointsinterpo
+ {-2}{1}
+ \DrawInterpoCurve[Color=red]{\interpoA}
+ \DrawInterpoCurve[Color=blue]{\interpoB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Betweend function and spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{-0.25*(x+2)^2+3.5}
+ \DefineLstSpline{-6/4/-2§-5/2/-2§-4/0/-2§-2/-2/0§1/2/2§3/3.5/0.5}[\lstsplineA]
+ \DefineSplineCurve[Name=splineblue]{\lstsplineA}<\Splineblue>
+ \DrawIntegral%
+ [NameSplineB=\Splineblue,Type=fct/spl,Colors=olive/pink]%
+ {h(x)} %formule
+ [splineblue] %Namecourbespline
+ {-3}{0}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawSplineCurve[Color=blue]{\lstsplineA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between spline and function}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=ch]<h>{0.25*(x+2)^2-2}
+ \DefineLstSpline{-6/4/2§-5/-2/-2§-4/0/2§-2/2/0§1/-2/-2§3/3.5/-0.5}[\lstsplineA]
+ \DefineSplineCurve[Name=splineblue]{\lstsplineA}<\Splineblue>
+ \DrawIntegral%
+ [NameSpline=\Splineblue,Type=spl/fct,Colors=olive/pink]%
+ {splineblue} %Namecourbespline
+ [h(x)] %formule
+ {-3}{-1}
+ \DrawCurve[Color=red]{h(x)}
+ \DrawSplineCurve[Color=blue]{\lstsplineA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between function and interpo}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=cm]<m>{-0.25*(x+2)^2+4}
+ \DefineLstInterpol{(-6,4)(-5,-2)(-2,1)(1,-2)(3,3)}[\interpoB]
+ \DefineInterpoCurve[Name=interpotestb]{\interpoB}
+ \DrawIntegral%
+ [NameInterpoB=interpotestb,Type=fct/itp,Colors=olive/pink]%
+ {m(x)} %formule
+ [\interpoB] %pointsinterpo
+ {-4}{1}
+ \DrawCurve[Color=red]{m(x)}
+ \DrawInterpoCurve[Color=blue]{\interpoB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between interpo and function}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineCurve[Name=courbeQ]<q>{0.25*(x+2)^2-2.5}
+ \DefineLstInterpol{(-6,-2)(-5,4)(-2,-1)(1,2)(3,-2)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest]{\interpoA}
+ \FindIntersections[Name=FGH,Disp]{interpotest}{courbeQ}
+ \DrawIntegral%
+ [NameInterpo=interpotest,Type=itp/fct,Colors=olive/pink,Bounds=nodes]%
+ {\interpoA} %pointsinterpo
+ [q(x)] %formule
+ {(FGH-1)}{(FGH-2)}
+ \DrawCurve[Color=red]{q(x)}
+ \DrawInterpoCurve[Color=blue]{\interpoA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between spline and interpo}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/-2/2§-3/4/0§3/-2/0}[\lstsplineA]
+ \DefineSplineCurve[Name=splinered]{\lstsplineA}<\Splinered>
+ \DefineLstInterpol{(-6,4)(-5,-2)(-2,1)(1,-2)(3,3)}[\interpoB]
+ \DefineInterpoCurve[Name=interpotestb]{\interpoB}
+ \DrawIntegral%
+ [NameInterpoB=interpotestb,NameSpline=\Splinered,Type=spl/itp,Colors=olive/pink]%
+ {splinered} %Namecourbespline
+ [\interpoB] %pointsinterpo
+ {-4}{-2}
+ \DrawSplineCurve[Color=red]{\lstsplineA}
+ \DrawInterpoCurve[Color=blue]{\interpoB}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\section{Between interpo and spline}
+
+\begin{tcblisting}{listing engine=minted,minted language=latex,colframe=lightgray,colback=lightgray!5}
+\begin{GraphTikz}%
+ [x=0.8cm,y=1cm,Xmin=-7,Xmax=4,Ymin=-3,Ymax=5]
+ \DrawAxisGrids[Grads=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+ \DefineLstSpline{-6/4/-2§-3/-2.25/0§3/3/0}[\lstsplineB]
+ \DefineSplineCurve[Name=splineblue]{\lstsplineB}<\Splineblue>
+ \DefineLstInterpol{(-6,-2)(-5,4)(-2,-1)(1,2)(3,-2.5)}[\interpoA]
+ \DefineInterpoCurve[Name=interpotest]{\interpoA}
+ \FindIntersections[Name=UIO,Disp]{interpotest}{splineblue}
+ \DrawIntegral%
+ [NameInterpo=interpotest,NameSplineB=\Splineblue,Type=itp/spl,Colors=olive/pink,Bounds=nodes]%
+ {\interpoA} %pointsinterpo
+ [splineblue] %Namecourbespline
+ {(UIO-1)}{(UIO-2)}
+ \DrawSplineCurve[Color=blue]{\lstsplineB}
+ \DrawInterpoCurve[Color=red]{\interpoA}
+ \DrawAxisGrids[Grid=false,Enlarge=2.5mm]{-7,-6,...,4}{-3,-2,...,5}
+\end{GraphTikz}
+\end{tcblisting}
+
+\end{document}
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-examples-integrals.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/tkz-grapheur/tkz-grapheur-exemples-integrales.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/tex/latex/tkz-grapheur/tkz-grapheur.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tkz-grapheur/tkz-grapheur.sty 2024-06-22 20:22:01 UTC (rev 71589)
+++ trunk/Master/texmf-dist/tex/latex/tkz-grapheur/tkz-grapheur.sty 2024-06-22 20:22:15 UTC (rev 71590)
@@ -2,9 +2,10 @@
% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tkz-grapheur}[2024/06/15 0.1.4.Des outils en TikZ pour travailler comme avec un grapheur]
+\ProvidesPackage{tkz-grapheur}[2024/06/22 0.1.5.Des outils en TikZ pour travailler comme avec un grapheur]
%====HISTORIQUE
+% v 0.1.5 Correction d'un bug avec les valeurs manuelles + Nœud pour une image + [en] version !
% v 0.1.4 Ajout des placements de textes
% v 0.1.3 Régressions, avec xintreg (désactivable)
% v 0.1.2 Max/Min + Droites
@@ -11,13 +12,22 @@
% v 0.1.1 Densité loi normale + khi deux + Améliorations diverses
% v 0.1.0 Version initiale [fr]
-%====OPTION
+%====OPTIONS
\newif\if at loadsiunitx \@loadsiunitxtrue
\DeclareOption{nonsiunitx}{\@loadsiunitxfalse}%
+\DeclareOption{nosiunitx}{\@loadsiunitxfalse}%
+
\newif\if at loadtikzbabel \@loadtikzbabeltrue
\DeclareOption{nontikzbabel}{\@loadtikzbabelfalse}%
+\DeclareOption{notikzbabel}{\@loadtikzbabelfalse}%
+
\newif\if at loadxintreg \@loadxintregtrue
\DeclareOption{nonxintreg}{\@loadxintregfalse}%
+\DeclareOption{noxintreg}{\@loadxintregfalse}%
+
+\newif\if at lngenglish \@lngenglishfalse
+\DeclareOption{english}{\@lngenglishtrue}%
+
\DeclareOption*{}
\ProcessOptions\relax
@@ -33,10 +43,14 @@
\RequirePackage{xint-regression}
\fi
-%====SIUNITX
+%====SIUNITX + [en]
\if at loadsiunitx
\RequirePackage{siunitx}
- \sisetup{locale=FR,output-decimal-marker={,},mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true}
+ \if at lngenglish
+ \sisetup{mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true}
+ \else
+ \sisetup{locale=FR,output-decimal-marker={,},mode=match,propagate-math-font=true,reset-math-version=false,reset-text-family=false,reset-text-series=false,reset-text-shape=false,text-family-to-math=true,text-series-to-math=true}
+ \fi
\fi
%====TIKZ.BABEL
@@ -44,6 +58,10 @@
\usetikzlibrary{babel}
\fi
+%++++++++++++++++++++++++++
+%+++++++++FRANÇAIS+++++++++
+%++++++++++++++++++++++++++
+
%====COMMANDE POUR NB DECIMAL ALEA ENTRE BORNES
\NewDocumentCommand\ChoisirNbAlea{ s O{0} m m O{\monbnalea} }{%
\def\tmpborneinf{\xinteval{floor(#3)}}%inf=\tmpborneinf\par%
@@ -134,6 +152,9 @@
%====CONSTANTE PI pour xint, à voir si incompatibilité...
\xintdefvar pi:=3.141592653589793238462643;
+%====focntion ln, en langage xint
+\xintdeffloatfunc ln(x) := log(x);
+
%===COMMANDE INTERNE POUR FORMATER EN FRACTIONS
\NewDocumentCommand\FormatterFraction{ s O{} m }{%
%*=moins sur le numérateur
@@ -680,7 +701,7 @@
\ifboolKV[GraphiqueTikzAxes]{Traits}{\foreach \y in {#2}{\draw[pfltrait] ([xshift=\pflthickgrad]{\pflOx},{\y})--++({-2*\pflthickgrad},0) ;}}{}%
\readlist*\LstValY{#2}%
\readlist*\LstValFmtY{#3}%
- \foreach \i in {1,...,\LstValXlen}{%
+ \foreach \i in {1,...,\LstValYlen}{%
\itemtomacro\LstValY[\i]\mavaly%
\itemtomacro\LstValFmtY[\i]\mavalfmty%
\draw ([xshift=-\pflthickgrad]{\pflOx},{\mavaly}) node[pflnoeud,left,font={\useKV[GraphiqueTikzAxes]{Police}}] {\mavalfmty} ;
@@ -1517,18 +1538,32 @@
%===IMAGES & ANTÉCÉDENTS
\defKV[GraphiqueTikzImg]{
Couleurs=\def\pflimgcolors{#1},%
- Nom=\def\pflantecednoms{#1}%,%
- %Style=\xdef\pflantecedstyle{#1}
+ Nom=\def\pflantecednoms{#1}%
}
\setKVdefault[GraphiqueTikzImg]{
- Couleurs=black,
- Traits=false,
+ Couleurs=black,%
+ Traits=false,%
Spline=false,%
Nom={},%
Style=o
}
+\NewDocumentCommand\DefinirImage{ O{} m m }{%
+ \useKVdefault[GraphiqueTikzImg]%
+ \setKV[GraphiqueTikzImg]{#1}%
+ \ifboolKV[GraphiqueTikzImg]{Spline}%
+ {%
+ \path[draw=none,pflcourbe,name path=tmpimage] ({#3},{\pflymin})--({#3},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=ZZZZ}] ;
+ \coordinate (\pflantecednoms) at (ZZZZ-1) ;
+ }%
+ {%
+ \xdef\tmpresimg{\xintfloateval{#2(#3)}}%
+ \coordinate (\pflantecednoms) at ({#3},{\tmpresimg}) ;
+ }%
+}
+
\NewDocumentCommand\PlacerImages{ O{} m m }{%
\useKVdefault[GraphiqueTikzImg]%
\setKV[GraphiqueTikzImg]{#1}%
@@ -1564,7 +1599,7 @@
\MarquerPts*[Style={\useKV[GraphiqueTikzImg]{Style}},Couleur=\pflimgcolorpt]{({\i},{\tmpresimg})}
%\filldraw[\pflimgcolorpt] ({\i},{\tmpresimg}) circle[radius=2pt] ;
}%
- }
+ }%
}
\NewDocumentCommand\PlacerAntecedents{ O{} m m }{%avec le nom de la courbe...
@@ -2033,4 +2068,1997 @@
\draw #2 node[pflnoeud,font=\pflnodefonte,text=\pflnodecol,\pfnodepos] {#3} ;
}
+%++++++++++++++++++++++++++
+%++++++++++ENGLISH+++++++++
+%++++++++++++++++++++++++++
+
+%====COMMANDE POUR NB DECIMAL ALEA ENTRE BORNES
+\NewDocumentCommand\PickRandomNb{ s O{0} m m O{\mmyrandomnb} }{%
+ \def\tmpborneinf{\xinteval{floor(#3)}}%inf=\tmpborneinf\par%
+ \def\tmpbornesup{\xinteval{ceil(#4)}}%sup=\tmpbornesup\par%
+ \xintifboolexpr{#2 == 0}%
+ {%
+ \xdef#5{\fpeval{randint(\tmpborneinf,\tmpbornesup)}}%
+ }%
+ {%
+ \def\tmptest{0}%
+ \whiledo{\tmptest=0}{%
+ \xintifboolexpr{(\tmpbornesup-\tmpborneinf) == 1}%
+ {%
+ \xdef\tmpresalea{\fpeval{\tmpborneinf+round(rand(),#2)}}%
+ }%
+ {%
+ \xdef\tmpresalea{\fpeval{round(randint(\tmpborneinf,\tmpbornesup)+rand(),#2)}}%
+ }%
+ %essai=\tmpresalea\par
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\tmpresalea < #4 'and' \tmpresalea > #3 }{\def\tmptest{1}}{\def\tmptest{0}}%
+ }%
+ {%
+ \xintifboolexpr{\tmpresalea <= #4 'and' \tmpresalea >= #3 }{\def\tmptest{1}}{\def\tmptest{0}}%
+ }%
+ }%
+ \xdef#5{\tmpresalea}%
+ %res=%
+ }%
+}
+
+%====PATCH NUM
+\@ifundefined{RoundNb}%
+ {%
+ \NewDocumentCommand\RoundNb{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}%
+ }%
+ {%
+ \RenewDocumentCommand\RoundNb{ O{2} m}{\num{\xintfloateval{round(#2,#1)}}\relax}%
+ }%
+
+%====STYLES DE BASE
+\tikzset{tkzgrphnode/.style={}}
+\tikzset{tkzgrphpoint/.style={line width=0.95pt}}
+\tikzset{tkzgrphpointc/.style={radius=1.75pt}}
+\tikzset{tkzgrphscatter/.style={radius=1.75pt}}
+\tikzset{tkzgrphframe/.style={line width=0.8pt,gray}}
+\tikzset{tkzgrphcurve/.style={line width=1.05pt}}
+\tikzset{tkzgrphline/.style={line width=0.8pt}}
+\tikzset{tkzgrpharrowl/.style={<-,>=latex}}
+\tikzset{tkzgrpharrowr/.style={->,>=latex}}
+\tikzset{tkzgrpharrowlr/.style={<->,>=latex}}
+\tikzset{tkzgrphcounterimage/.style={line width=0.9pt,densely dashed}}
+\tikzset{tkzgrphrange/.style={line width=0.9pt,densely dashed,->,>=latex}}
+\tikzset{tkzgrphgridp/.style={thin,lightgray}}
+\tikzset{tkzgrphgrids/.style={very thin,lightgray}}
+\tikzset{tkzgrphaxes/.style={line width=0.8pt,->,>=latex}}
+\tikzset{
+ Xgrid/.store in=\pflgrillex,Xgrid/.default=1,Xgrid=1,
+ Xgrids/.store in=\pflgrillexs,Xgrids/.default=0.5,Xgrids=0.5,
+ Ygrid/.store in=\pflgrilley,Ygrid/.default=1,Ygrid=1,
+ Ygrids/.store in=\pflgrilleys,Ygrids/.default=0.5,Ygrids=0.5
+}
+\tikzset{%
+ pics/tkzgraphcross/.style args={#1/#2}{
+ code={
+ \draw[tkzgrphpoint,rotate=#2] (-#1,0) -- (#1,0);
+ \draw[tkzgrphpoint,rotate=#2] (0,-#1) -- (0, #1);
+ }
+ },
+ pics/tkzgraphcross/.default={2pt/45}
+}
+\tikzset{%
+ pics/tkzgraphsquare/.style args={#1/#2}{
+ code={
+ \filldraw[draw=none,tkzgrphpoint,rotate=#2] (-#1,-#1) rectangle (#1,#1) ;
+ }
+ },
+ pics/tkzgraphsquare/.default={2pt/0}
+}
+
+%===COMMANDE INTERNE POUR FORMATER EN FRACTIONS
+\NewDocumentCommand\FormatFraction{ s O{} m }{%
+ %*=moins sur le numérateur
+ %2=argument.optionnel[d/t/dec=...]
+ %3=argument mandataire {calcul ou fraction}
+ \def\calculargument{\xintPRaw{\xintIrr{\xinteval{#3}}}}%on calcule et on transforme en A/B
+ \IfSubStr{\calculargument}{/}%on teste si le symbole / apparaît
+ {%si oui := fraction
+ \StrBefore{\calculargument}{/}[\numerateur]%on extrait le numérateur
+ \StrBehind{\calculargument}{/}[\denominateur]%on extrait le dénominateur
+ \ifblank{#2}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{d}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\displaystyle\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\displaystyle\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\displaystyle\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{t}%
+ {%
+ \IfBooleanTF{#1}%
+ {\ensuremath{\tfrac{\num{\numerateur}}{\num{\denominateur}}}}%
+ {%
+ \ifthenelse{\numerateur < 0}%
+ {\ensuremath{-\frac{\num{\fpeval{abs(\numerateur)}}}{\num{\denominateur}}}}%
+ {\ensuremath{\frac{\num{\numerateur}}{\num{\denominateur}}}}%
+ }%
+ }%
+ {}%si l'argument optionnel est vide
+ \IfStrEq{#2}{n}%
+ {%
+ \ensuremath{\nicefrac{\num{\numerateur}}{\num{\denominateur}}}%
+ }%
+ {}%si l'argument optionnel est vide
+ }{%si non := entier
+ \num{\calculargument}%on affiche l'entier, avec le package siunitx
+ }%
+}
+
+%affichage d'un label en radians
+\NewDocumentCommand\FormatTrig{ O{t} m }{%étoilée en dfrac
+ \IfStrEq{#2}{0}%cas où l'argument vaut 0
+ {\def\restmp{0}}%
+ {%
+ \StrDel{#2}{*}[\restmpsansmoins]%
+ \StrSubstitute{\restmpsansmoins}{pi}{\pi}[\restmppi]%
+ \IfSubStr{#2}{/}%
+ {%
+ \StrCut{\restmppi}{/}\tmpnum\tmpdenom%
+ \IfSubStr{\tmpnum}{-}%
+ {%
+ \StrDel{\tmpnum}{-}[\restmppinum]%
+ \IfStrEqCase{#1}{%
+ {t}{\def\restmp{-\frac{\restmppinum}{\tmpdenom}}}%
+ {d}{\def\restmp{-\displaystyle\frac{\restmppinum}{\tmpdenom}}}%
+ {n}{\def\restmp{\nicefrac{-\restmppinum}{\tmpdenom}}}%
+ }%
+ }%
+ {%
+ \IfStrEqCase{#1}{%
+ {t}{\def\restmp{\frac{\tmpnum}{\tmpdenom}}}%
+ {d}{\def\restmp{\displaystyle\frac{\tmpnum}{\tmpdenom}}}%
+ {n}{\def\restmp{\nicefrac{\tmpnum}{\tmpdenom}}}%
+ }%
+ }%
+ }%
+ {%
+ \def\restmp{\restmppi}%
+ }%
+ }%
+ \ensuremath{\restmp}%
+}
+
+%====FORMATAGE DES RACINES SIMPLES
+\NewDocumentCommand\FormatSqrt{ O{t} m }{%
+ \IfStrEq{#2}{0}%cas où l'argument vaut 0
+ {\ensuremath{0}}%
+ {%
+ \IfSubStr{#2}{sqrt}%
+ {%
+ \StrDel{#2}{*}[\tmpargbrut]%
+ \StrBetween[1,1]{\tmpargbrut}{sqrt(}{)}[\tmpargnumrac]%
+ \StrBefore{\tmpargbrut}{sqrt}[\tmparavantrac]%
+ \IfStrEqCase{\tmparavantrac}{
+ {}{\xdef\tmparavantrac{}}%
+ {-}{\xdef\tmparavantrac{-}}%
+ }[\xdef\tmparavantrac{\num{\tmparavantrac}}]%
+ \IfSubStr{\tmpargbrut}{/}%
+ {%
+ \StrBehind{\tmpargbrut}{/}[\tmpargdenomrac]%
+ \IfStrEqCase{#1}{%
+ {d}{%
+ \ensuremath{\displaystyle\frac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}%
+ }%
+ {t}{%
+ \ensuremath{\frac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}%
+ }%
+ {n}{%
+ \ensuremath{\nicefrac{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}{\num{\tmpargdenomrac}}}%
+ }%
+ }%
+ }%
+ {%
+ \ensuremath{\tmparavantrac\sqrt{\num{\tmpargnumrac}}}%
+ }%
+ }%
+ {%
+ \FormatFraction[#1]{#2}%
+ }%
+ }%
+}
+
+%====COMMANDE INTERNE DE CONVERSION
+\ExplSyntaxOn
+ \NewDocumentCommand\ConvertPtToCm{ m } { \dim_to_decimal_in_unit:nn { #1 } { 1 cm } }
+\ExplSyntaxOff
+
+%====RECUPERER COORDONNEES NOEUD
+\NewDocumentCommand\GetXcoord{ m O{\myxcoord} }{%
+ \path #1;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef#2{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+}
+\NewDocumentCommand\GetYcoord{ m O{\myycoord} }{%
+ \path #1;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef#2{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+}
+
+\NewDocumentCommand\GetXYcoord{ m O{\myxcoord} O{\myycoord} }{%
+ \GetXcoord{#1}[#2]%
+ \GetYcoord{#1}[#3]%
+}
+
+%===UNITÉS
+\newcommand\DistBetweenNodes[3][\MyTmpDist]{%
+ \pgfpointdiff{\pgfpointanchor{#2}{center}}
+ {\pgfpointanchor{#3}{center}}
+ % no need to use a new dimen
+ \pgf at xa=\pgf at x
+ \pgf at ya=\pgf at y
+ % to convert from pt to cm
+ \pgfmathparse{veclen(\pgf at xa,\pgf at ya)/28.45274}
+ \global\let#1\pgfmathresult %macro globale
+}
+
+\newcommand\TikZUnits{
+ \coordinate (@0) at (0,0) ;
+ \coordinate (@X) at (1,0) ;
+ \coordinate (@Y) at (0,1) ;
+ \DistBetweenNodes[\pflxunit]{@0}{@X}
+ \DistBetweenNodes[\pflyunit]{@0}{@Y}
+}
+
+%====ENVIRONNEMENT
+\defKV[GraphicTikz]{%
+ GradThick=\def\pflthickgrad{#1}
+}
+\setKVdefault[GraphicTikz]{%
+ Frame=false,%
+ GradThick=3pt
+}
+
+\NewDocumentEnvironment{GraphTikz}{ O{} D<>{} }%
+%1 = options tikz, classiques
+%2 = clés spécifiques
+{%
+ \restoreKV[GraphicTikz]%
+ \setKV[GraphicTikz]{#2}%
+ %l'environnement
+ \begin{tikzpicture}[#1]%
+ %unités x/y pour des calculs de coordonnées
+ \TikZUnits
+ %noeuds
+ \coordinate (bbxTop) at (current bounding box.north) ;
+ \coordinate (bbxBottom) at (current bounding box.south) ;
+ \ifboolKV[GraphicTikz]{Frame}{\draw[tkzgrphframe] ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;}{}%
+ %back to normal
+}%
+{%
+ \end{tikzpicture}%
+}
+
+%====AXES
+\defKV[GraphicTikzAxis]{
+ Format=\def\pflformataxes{#1}
+}
+\setKVdefault[GraphicTikzAxis]{%
+ Grid=true,%
+ Enlarge=0,%
+ Grads=true,%
+ Origin=false,%
+ Font={},%
+ Format=num,%
+ Lines=true,%
+ Last=false,%
+ Behind=false,%
+ Above=false
+}
+
+\NewDocumentCommand\FormatXaxisValues{ m m }{%
+ \IfStrEqCase{#1}{%
+ {num}{\num{#2}}%
+ {year}{#2}%
+ {frac}{\FormatFrac{#2}}%
+ {dfrac}{\FormatFrac[d]{#2}}%
+ {nfrac}{\FormatFrac[n]{#2}}%
+ {trig}{\FormatTrig{#2}}%
+ {dtrig}{\FormatTrig[d]{#2}}%
+ {ntrig}{\FormatTrig[n]{#2}}%
+ {sqrt}{\FormatSqrt{#2}}%
+ {dsqrt}{\FormatSqrt[d]{#2}}%
+ {nsqrt}{\FormatSqrt[n]{#2}}%
+ }[#2]%
+}
+
+\NewDocumentCommand\FormatYaxisValues{ m m }{%
+ \IfStrEqCase{#1}{%
+ {num}{\num{#2}}%
+ {year}{#2}%
+ {frac}{\FormatSqrt{#2}}%
+ {dfrac}{\FormatFrac[d]{#2}}%
+ {nfrac}{\FormatFrac[n]{#2}}%
+ {trig}{\FormatTrig{#2}}%
+ {dtrig}{\FormatTrig[d]{#2}}%
+ {ntrig}{\FormatTrig[n]{#2}}%
+ {sqrt}{\FormatSqrt{#2}}%
+ {dsqrt}{\FormatSqrt[d]{#2}}%
+ {nsqrt}{\FormatSqrt[n]{#2}}%
+ }[#2]%
+}
+
+\NewDocumentCommand\DrawAxisGrids{ s O{} m D<>{#3} m D<>{#5} }{%
+ \restoreKV[GraphicTikzAxis]%
+ \setKV[GraphicTikzAxis]{#2}%
+ %cas particuliers sous/sur impression
+ \ifboolKV[GraphicTikzAxis]{Behind}%
+ {%
+ \setKV[GraphicTikzAxis]{Grads=false}
+ }%
+ {}%
+ \ifboolKV[GraphicTikzAxis]{Above}%
+ {%
+ \setKV[GraphicTikzAxis]{Grid=false}
+ }%
+ {}%
+ %suite
+ \IfSubStr{\pflformataxes}{/}%
+ {%
+ \StrCut{\pflformataxes}{/}{\pflformataxex}{\pflformataxey}%
+ }%
+ {%
+ \xdef\pflformataxex{\pflformataxes}\xdef\pflformataxey{\pflformataxes}%
+ }%
+ \ifboolKV[GraphicTikzAxis]{Grid}%
+ {%
+ \draw[tkzgrphgrids,xstep=\pflgrillexs,ystep=\pflgrilleys] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax});
+ \draw[tkzgrphgridp,xstep=\pflgrillex,ystep=\pflgrilley] ({\pflxmin},{\pflymin}) grid ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzAxis]{Last}%
+ {%
+ \draw[tkzgrphgridp] ({\pflxmin},{\pflymax})--({\pflxmax},{\pflymax}) ;
+ \draw[tkzgrphgridp] ({\pflxmax},{\pflymin})--({\pflxmax},{\pflymax}) ;
+ }%
+ {}%
+ }%
+ {}%
+ \draw[tkzgrphaxes] ({\pflxmin},{\pflOy}) -- ([xshift={\useKV[GraphicTikzAxis]{Enlarge}}]{\pflxmax},{\pflOy}) ;
+ \draw[tkzgrphaxes] ({\pflOx},{\pflymin}) -- ([yshift={\useKV[GraphicTikzAxis]{Enlarge}}]{\pflOx},{\pflymax}) ;
+ \IfEq{#3}{auto}%
+ {%
+ \xdef\tmprangexvalues{\xintfloateval{seq(i,i=\pflxmin..[\pflgrillex]..\pflxmax)}}\StrDel{\tmprangexvalues}{ }[\tmprangexvalues]%
+ \xdef\pflformataxex{num}%
+ }%
+ {%
+ \xdef\tmprangexvalues{#3}%
+ }%
+ \IfEq{#5}{auto}%
+ {%
+ \xdef\tmprangeyvalues{\xintfloateval{seq(i,i=\pflymin..[\pflgrilley]..\pflymax)}}\StrDel{\tmprangeyvalues}{ }[\tmprangeyvalues]%
+ \xdef\pflformataxey{num}%
+ }%
+ {%
+ \xdef\tmprangeyvalues{#5}%
+ }%
+ \foreach \x in \tmprangexvalues {\draw[tkzgrphline] ([yshift=\pflthickgrad]{\x},{\pflOy})--++(0,{-2*\pflthickgrad}) ;}
+ \foreach \y in \tmprangeyvalues {\draw[tkzgrphline] ([xshift=\pflthickgrad]{\pflOx},{\y})--++({-2*\pflthickgrad},0) ;}
+ \ifboolKV[GraphicTikzAxis]{Grads}%
+ {%
+ %origine
+ \ifboolKV[GraphicTikzAxis]{Origin}%
+ {%
+ \draw ({\pflOx},{\pflOy}) node[tkzgrphnode,below left,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatXaxisValues{\pflformataxex}{\pflOx}} ;
+ %\draw (\pflOx,\pflOy) node[below left,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\pflOx}}{\pflOx}} ;
+ }%
+ {}%
+ %graduations x, sauf si auto...
+ \foreach \x in \tmprangexvalues {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\x == \pflOx}{}{\draw ([yshift=-\pflthickgrad]{\x},{\pflOy}) node[tkzgrphnode,below,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatXaxisValues{\pflformataxex}{\x}} ;}
+ %\xintifboolexpr{\x == \pflOx}{}{\draw ([yshift=-\pflthickgrad]\x,\pflOy) node[below,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\x}}{\x}} ;}
+ }%
+ {%
+ \draw ([yshift=-\pflthickgrad]{\x},{\pflOy}) node[tkzgrphnode,below,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatXaxisValues{\pflformataxex}{\x}} ;
+ %\draw ([yshift=-\pflthickgrad]\x,\pflOy) node[below,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\x}}{\x}} ;
+ }%
+ }%
+ \foreach \y in \tmprangeyvalues {%
+ \IfBooleanTF{#1}%
+ {%
+ \xintifboolexpr{\y == \pflOy}{}{\draw ([xshift=-\pflthickgrad]{\pflOx},{\y}) node[tkzgrphnode,left,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatYaxisValues{\pflformataxey}{\y}} ;}
+ %\xintifboolexpr{\y == \pflOy}{}{\draw ([xshift=-\pflthickgrad]\pflOx,\y) node[left,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\y}}{\y}} ;}
+ }%
+ {%
+ \draw ([xshift=-\pflthickgrad]{\pflOx},{\y}) node[tkzgrphnode,left,font={\useKV[GraphicTikzAxis]{Font}}] {\FormatYaxisValues{\pflformataxey}{\y}} ;
+ %\draw ([xshift=-\pflthickgrad]\pflOx,\y) node[left,font={\useKV[GraphicTikzAxis]{Font}}] {\ifboolKV[GraphicTikzAxis]{Num}{\num{\y}}{\y}} ;
+ }%
+ }%
+ }%
+ {}%
+}
+
+%===DEFINIR POINTS
+\setKVdefault[GraphicTikzDefPoints]{Color=black,Mark=false,Style=o}
+
+\NewDocumentCommand\DefinePts{ O{} m }{%
+ \restoreKV[GraphicTikzDefPoints]%
+ \setKV[GraphicTikzDefPoints]{#1}%
+ \foreach \tmpnamept/\tmpxpt/\tmpypt in {#2}{%
+ \coordinate (\tmpnamept) at ({\tmpxpt},{\tmpypt}) ;
+ \ifboolKV[GraphicTikzDefPoints]{Mark}%
+ {%
+ \MarkPts*[Style={\useKV[GraphicTikzDefPoints]{Style}},Color={\useKV[GraphicTikzDefPoints]{Color}}]{(\tmpnamept)}
+ %\filldraw[{\useKV[GraphicTikzDefPoints]{Color}}] (\tmpnamept) circle[tkzgrphpointc] ;
+ }%
+ {}%
+ }
+}
+
+\defKV[GraphicTikzMarkPoints]{%
+ Color=\def\pflcouleurpoints{#1},%
+ Style=\def\pflstylepoints{#1}
+}
+\setKVdefault[GraphicTikzMarkPoints]{%
+ Color=black,%
+ Sizec=2pt,%
+ Sizex=2pt,%
+ Sizeo=1.75pt,%
+ Style=o,%
+ Lines=false
+}
+\NewDocumentCommand\MarkPts{ s O{} D<>{\normalfont\normalsize} m }{%
+ %étoilée = sans label
+ %2=clés
+ %3=points
+ \restoreKV[GraphicTikzMarkPoints]%
+ \setKV[GraphicTikzMarkPoints]{#2}%
+ \IfBooleanTF{#1}%
+ {%
+ \IfStrEq{\pflstylepoints}{x}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/45} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/90} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{c}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizec}}/0} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{d}%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizeo}}/45} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{o}%
+ {%
+ \IfSubStr{\pflcouleurpoints}{/}%
+ {%
+ \StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[tkzgrphline,fill=\pflcouleurpointsB,draw=\pflcouleurpointsA] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] ;
+ }%
+ }%
+ {%
+ \foreach \Point in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] ;
+ }%
+ }%
+ }%
+ {}%
+ }%
+ {%avec label
+ \IfStrEq{\pflstylepoints}{x}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/45} node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{+}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphcross={\useKV[GraphicTikzMarkPoints]{Sizex}}/90} node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{c}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizec}}/0} node[tkzgrphnode,\Pos,{\useKV[GraphicTikzMarkPoints]{Color}},font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{d}%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[draw=none,fill={\useKV[GraphicTikzMarkPoints]{Color}}] \Point pic{tkzgraphsquare={\useKV[GraphicTikzMarkPoints]{Sizeo}}/45} node[tkzgrphnode,\Pos,{\useKV[GraphicTikzMarkPoints]{Color}},font=#3] {\Label} ;
+ }%
+ }%
+ {}%
+ \IfStrEq{\pflstylepoints}{o}%
+ {%
+ \IfSubStr{\pflcouleurpoints}{/}%
+ {%
+ \StrCut{\pflcouleurpoints}{/}{\pflcouleurpointsA}{\pflcouleurpointsB}%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \draw[tkzgrphline,\pflcouleurpointsA,fill=\pflcouleurpointsB] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ {%
+ \foreach \Point/\Pos/\Label in {#4} {%
+ \ifboolKV[GraphicTikzMarkPoints]{Lines}%
+ {%
+ \draw[{\useKV[GraphicTikzMarkPoints]{Color}},tkzgrphcounterimage] let \p1 = \Point in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \filldraw[\pflcouleurpoints] \Point circle[radius={\useKV[GraphicTikzMarkPoints]{Sizeo}}] node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }%
+ }%
+ }%
+ {}%
+ }%
+}
+
+%===AJOUTER DES VALEURS MANUELLEMENT
+\NewDocumentCommand\AddXvalues{ O{} m m }{%
+ \restoreKV[GraphicTikzAxis]%
+ \setKV[GraphicTikzAxis]{#1}%
+ \ifboolKV[GraphicTikzAxis]{Lines}{\foreach \x in {#2}{\draw[tkzgrphline] ([yshift=\pflthickgrad]{\x},{\pflOy})--++(0,{-2*\pflthickgrad}) ;}}{}%
+ \readlist*\LstValX{#2}%
+ \readlist*\LstValFmtX{#3}%
+ \foreach \i in {1,...,\LstValXlen}{%
+ \itemtomacro\LstValX[\i]\mavalx%
+ \itemtomacro\LstValFmtX[\i]\mavalfmtx%
+ \draw ([yshift=-\pflthickgrad]{\mavalx},{\pflOy}) node[tkzgrphnode,below,font={\useKV[GraphicTikzAxis]{Font}}] {\mavalfmtx} ;
+ }%
+}
+
+\NewDocumentCommand\AddYvalues{ O{} m m }{%
+ \restoreKV[GraphicTikzAxis]%
+ \setKV[GraphicTikzAxis]{#1}%
+ \ifboolKV[GraphicTikzAxis]{Lines}{\foreach \y in {#2}{\draw[tkzgrphline] ([xshift=\pflthickgrad]{\pflOx},{\y})--++({-2*\pflthickgrad},0) ;}}{}%
+ \readlist*\LstValY{#2}%
+ \readlist*\LstValFmtY{#3}%
+ \foreach \i in {1,...,\LstValYlen}{%
+ \itemtomacro\LstValY[\i]\mavaly%
+ \itemtomacro\LstValFmtY[\i]\mavalfmty%
+ \draw ([xshift=-\pflthickgrad]{\pflOx},{\mavaly}) node[tkzgrphnode,left,font={\useKV[GraphicTikzAxis]{Font}}] {\mavalfmty} ;
+ }%
+}
+
+%====FONCTIONS ET COURBES 'classique + interpo + spline'
+\defKV[GraphicTikzCourbe]{%
+ Step=\def\pflstepcurve{#1},%
+ Name=\def\pflnamecurve{#1}
+}
+\setKVdefault[GraphicTikzCourbe]{%
+ Color=black,%
+ Start={\pflxmin},%
+ End={\pflxmax},%
+ Step={},%
+ Clip=true,%
+ Name={},%
+ Trace=false,%
+ Tension=0.5
+}
+
+\NewDocumentCommand\DefineFunction{ O{} D<>{f} m }{%old version
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \xintdeffloatfunc #2(x) := #3 ;
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphicTikzCourbe]{End})-(\useKV[GraphicTikzCourbe]{Start}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzCourbe]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DefineCurve{ O{} D<>{f} m }{%
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \xintdeffloatfunc #2(x) := #3 ;
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphicTikzCourbe]{End})-(\useKV[GraphicTikzCourbe]{Start}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzCourbe]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DrawCurve{ O{} D<>{} m }{%
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\useKV[GraphicTikzCourbe]{End})-(\useKV[GraphicTikzCourbe]{Start}))/100}}%
+ }%
+ {}%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\begin{scope}\clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});}{}
+ \IfEq{\pflnamecurve}{}%
+ {%
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#3),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#3),x={\useKV[GraphicTikzCourbe]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzCourbe]{End}},{\useKV[GraphicTikzCourbe]{End}})
+ \relax
+ };
+ }%
+ \ifboolKV[GraphicTikzCourbe]{Clip}{\end{scope}}{}
+}
+
+\NewDocumentCommand\DefineLstInterpol{ m O{\myinterpolist} }{%
+ \def#2{#1}%
+}
+
+\NewDocumentCommand\DefineInterpoCurve{ O{} m }{%
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \begin{scope}
+ \ifboolKV[GraphicTikzCourbe]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphicTikzCourbe]{Tension}}] coordinates {#2};
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}},name path global=\pflnamecurve] plot[smooth,tension={\useKV[GraphicTikzCourbe]{Tension}}] coordinates {#2};
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawInterpoCurve{ O{} m }{%
+ %2=liste
+ \restoreKV[GraphicTikzCourbe]%
+ \setKV[GraphicTikzCourbe]{#1}%
+ \begin{scope}
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzCourbe]{Color}}] plot [smooth,tension={\useKV[GraphicTikzCourbe]{Tension}}] coordinates {#2} ;
+ \end{scope}
+}
+
+\NewDocumentCommand\DefineLstSpline{ m O{\mysplinelst} }{%
+ \def#2{#1}%
+}
+
+\newcommand\tkzextractcoeff[2]{%1=liste,2=numero
+ \setsepchar{§}%
+ \readlist*\lcoeffs{#1}
+ \ifnum \lcoeffslen=1
+ \def\COEFFA{#1}
+ \def\COEFFB{#1}
+ \else
+ \itemtomacro\lcoeffs[#2]\COEFF
+ \IfSubStr{\COEFF}{/}%
+ {\StrCut{\COEFF}{/}{\COEFFA}{\COEFFB}}%
+ {\def\COEFFA{\COEFF}\def\COEFFB{\COEFF}}
+ \fi
+}
+
+\defKV[GraphicTikzSpline]{%
+ Name=\def\pflsplinename{#1},%
+ Coeffs=\def\pflsplinecoeffs{#1}
+}
+
+\setKVdefault[GraphicTikzSpline]{%
+ Name=spline,%
+ Color=black,%
+ Coeffs=3,%
+ Trace=false
+}
+
+\NewDocumentCommand\GenerateSpline{ m m O{\myspline} }{%
+ %1=liste
+ \setsepchar[.]{§./}%
+ \readlist*\SPLlistepoints{#1}%
+ %les données
+ \def\tmpsplinenumdeb{1}
+ \def\tmpsplinenumfin{\SPLlistepointslen}%
+ \tkzextractcoeff{#2}{\tmpsplinenumdeb}%
+ %nb de calculs
+ \def\SPLnbsplines{\inteval{\tmpsplinenumfin-1}}%
+ %extraction des coordonnées
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xa%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\ya%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimea%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,1]\xb%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,2]\yb%
+ \itemtomacro\SPLlistepoints[\tmpsplinenumdeb,3]\fprimeb%
+ \xdef#3{(\xa,\ya) ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFA}).. (\xb,\yb)}%
+ \foreach \i in {\tmpsplinenumdeb,...,\SPLnbsplines}{%
+ %extraction des coeffs de compensation
+ \tkzextractcoeff{#2}{\i}%
+ \def\j{\inteval{\i+1}}%
+ \itemtomacro\SPLlistepoints[\i,1]\xa%
+ \itemtomacro\SPLlistepoints[\i,2]\ya%
+ \itemtomacro\SPLlistepoints[\i,3]\fprimea%
+ \itemtomacro\SPLlistepoints[\j,1]\xb%
+ \itemtomacro\SPLlistepoints[\j,2]\yb%
+ \itemtomacro\SPLlistepoints[\j,3]\fprimeb%
+ \xdef#3{#3 ..controls +({atan \fprimea}:{(\xb-\xa)/\COEFFA}) and +({-180 + atan \fprimeb}:{(\xb-\xa)/\COEFFB}).. (\xb,\yb)}%
+ }%
+}
+
+\NewDocumentCommand\DefineSplineCurve{ O{} m D<>{\myspline} }{%
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \ifboolKV[GraphicTikzSpline]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}},name path global=\pflsplinename] #3 ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflsplinename] #3 ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DefineSpline{ O{} m D<>{\myspline} }{%old version
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \ifboolKV[GraphicTikzSpline]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}},name path global=\pflsplinename] #3 ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflsplinename] #3 ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawSplineCurve{ O{} m D<>{\myspline} }{%
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}}] #3 ;
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawSpline{ O{} m D<>{\myspline} }{%old version
+ %1=liste
+ \restoreKV[GraphicTikzSpline]%
+ \setKV[GraphicTikzSpline]{#1}%
+ \GenerateSpline{#2}{\pflsplinecoeffs}[#3]%
+ \begin{scope}
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzSpline]{Color}}] #3 ;
+ \end{scope}
+}
+
+%===INTERSECTION & ANTÉCÉDENTS
+\defKV[GraphicTikzIntersect]{%
+ Name=\def\pflintercurves{#1}
+}
+\setKVdefault[GraphicTikzIntersect]{%
+ Name=S,
+ Disp=true,
+ Color=black,
+ DispLine=false,%
+ Lines=false,%
+ Style=o
+}
+
+\NewDocumentCommand\FindIntersections{ O{} m m D<>{\myt} }{%
+ \restoreKV[GraphicTikzIntersect]%
+ \setKV[GraphicTikzIntersect]{#1}%
+ \path[name intersections={of=#2 and #3,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}};
+ \ifboolKV[GraphicTikzIntersect]{Disp}%
+ {%
+ \xintifboolexpr{#4 == 0}{}%
+ {%
+ \foreach \i in {1,...,#4}{%
+ \ifboolKV[GraphicTikzIntersect]{Lines}%
+ {%
+ \draw[tkzgrphrange,{\useKV[GraphicTikzIntersect]{Color}}]let \p1 = (\pflintercurves-\i) in (\pflintercurves-\i) -- ({\x1},{\pflOy}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzIntersect]{Style}},Color={\useKV[GraphicTikzIntersect]{Color}}]{(\pflintercurves-\i)}
+ %\filldraw[{\useKV[GraphicTikzIntersect]{Color}}] (\pflintercurves-\i) circle[tkzgrphpointc] ;
+ }
+ }%
+ }%
+ {}%
+}
+
+\NewDocumentCommand\FindCounterimage{ O{} m m D<>{\myantec} }{%
+ \restoreKV[GraphicTikzIntersect]%
+ \setKV[GraphicTikzIntersect]{#1}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzIntersect]{DispLine}%
+ {%
+ \path[draw,{\useKV[GraphicTikzIntersect]{Color}},tkzgrphcurve,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ \path[name intersections={of=#2 and tmpanteced,name=\pflintercurves,total=\t}] \pgfextra{\xdef#4{\t}};
+ \ifboolKV[GraphicTikzIntersect]{Disp}%
+ {%
+ \xintifboolexpr{#4 == 0}{}%
+ {%
+ \foreach \i in {1,...,#4}{%
+ \MarkPts*[Style={\useKV[GraphicTikzIntersect]{Style}},Color={\useKV[GraphicTikzIntersect]{Color}}]{(\pflintercurves-\i)}
+ %\filldraw[{\useKV[GraphicTikzIntersect]{Color}}] (\pflintercurves-\i) circle[tkzgrphpointc] ;
+ }
+ }%
+ }%
+ {}%
+ \end{scope}
+}
+
+%====INTÉGRALES
+%v2 avec modification de la clé [Type=...] ?
+\defKV[GraphicTikzIntegr]{%
+ Colors=\def\pfldomtikzcolors{#1},%
+ Style=\def\pfldomtikzstyle{#1},%
+ Opacity=\def\pfldomtikzopac{#1},%
+ Hatch=\def\pfldomtikzhatch{#1},%
+ Type=\def\pfldomtikztype{#1},%
+ Step=\def\pflstepcurve{#1},%
+ Bounds=\def\pflintbornes{#1},%
+ Junction=\def\pfldomtikzjoin{#1},%
+ NameInterpo=\def\pfldomtikznameinterpo{#1},%
+ NameInterpoB=\def\pfldomtikznameinterpob{#1},%
+ NameSpline=\def\pfldomtikznamespline{#1},%
+ NameSplineB=\def\pfldomtikznamesplineb{#1}
+}
+\setKVdefault[GraphicTikzIntegr]{%
+ Colors=gray,%
+ Style=fill,%
+ Opacity=0.5,%
+ Hatch={north west lines},%
+ Type=fct,%
+ Step={},%
+ Junction=bevel,%
+ Bounds=abs,%
+ Border=true,%
+ Spline=false,%
+ SplineB=false,%
+ NameInterpo={\myinterpo},%
+ NameInterpoB={\myinterpoB},%
+ NameSpline={\myspline},%
+ NameSplineB={\myplineB},%
+ Tension=0.5,%
+ TensionB=0.5
+}
+
+\NewDocumentCommand\DrawIntegral{ O{} D<>{} m O{0} m m }{%
+ %1 = clés
+ %2 = options particulières tikz
+ %3 = fonction, en tikz
+ %4 = fonction n°2 éventuelle
+ %de #5 à #6
+ \restoreKV[GraphicTikzIntegr]% revenir au valeurs par défaut
+ \setKV[GraphicTikzIntegr]{#1}% lit les arguments optionnels
+ %les couleurs
+ \IfSubStr{\pfldomtikzcolors}{/}%
+ {%
+ \StrCut{\pfldomtikzcolors}{/}{\pfldomtikzcolorbord}{\pfldomtikzcolorfond}
+ }%
+ {%
+ \xdef\pfldomtikzcolorbord{\pfldomtikzcolors}\xdef\pfldomtikzcolorfond{\pfldomtikzcolors}
+ }%
+ \ifboolKV[GraphicTikzIntegr]{Border}%
+ {%
+ \tikzset{integralebordtikzstyle/.style={draw=\pfldomtikzcolorbord}}
+ }%
+ {%
+ \tikzset{integralebordtikzstyle/.style={draw=none}}
+ }%
+ \IfStrEq{\pfldomtikzstyle}{hatch}%
+ {%
+ \tikzset{integraletikzstyle/.style={tkzgrphline,pattern=\pfldomtikzhatch,pattern color=\pfldomtikzcolorfond,line join=\pfldomtikzjoin}}
+ }%
+ {}%
+ \IfStrEq{\pfldomtikzstyle}{fill}%
+ {%
+ \tikzset{integraletikzstyle/.style={tkzgrphline,fill=\pfldomtikzcolorfond,fill opacity=\pfldomtikzopac,line join=\pfldomtikzjoin}}
+ }%
+ {}%
+ %extraction des infos x/y
+ \IfStrEqCase{\pflintbornes}{%
+ {abs}%
+ {%
+ \xdef\absnoeudA{#5}%
+ \xdef\absnoeudB{#6}%
+ }%
+ {nodes}%
+ {%
+ \path #5;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudA{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \path #6;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudB{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {abs/node}%
+ {%
+ \xdef\absnoeudA{#5}%
+ \path #6;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudB{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {node/abs}%
+ {%
+ \path #5;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\absnoeudA{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\absnoeudB{#6}%
+ }%
+ }%
+ %suite avec les nbs points
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflstepcurve{\xintfloateval{((\absnoeudB)-(\absnoeudA))/100}}%
+ }%
+ {}%
+ %TRACÉSen fonction des types de courbes
+ \IfStrEq{\pfldomtikztype}{fct}%
+ {%OK
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflOy}) -- cycle ;
+ \end{scope}
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl}%avec 3=courbe spline + clé [Spline] à utiliser !
+ {%OK
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflOy}) -- cycle ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintbornea,name=YYY}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\pflOy})-- (YYY-1) ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintborneb,name=ZZZ}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudB},{\pflOy})-- (ZZZ-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp}%avec 3=courbe interpo
+ {%OK
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflOy}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflOy}) -- cycle ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYY}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\pflOy})-- (YYY-1) ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=ZZZ}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudB},{\pflOy})-- (ZZZ-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{fct/fct}%avec #3=formule et #4=formule
+ {%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \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 ;
+ \end{scope}
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl/spl}%avec #3=cbe spline + #4=cbe splineB
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintbornea,name=YYYA}] ;
+ \path[name intersections={of=#4 and tmpintbornea,name=ZZZA}] ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=#3 and tmpintborneb,name=YYYB}] ;
+ \path[name intersections={of=#4 and tmpintborneb,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYA-1)-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYB-1)-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp/itp}%avec #3=cbe interpo + #4=cbe interpoB
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYYA}] ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=ZZZA}] ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=YYYB}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYA-1)-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYB-1)-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{fct/spl}%avec #3=formule + #4=spline
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and #4,name=ZZZA}] ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and #4,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudB},{\xintfloateval{subs(#3,x=\absnoeudB)}})-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl/fct}%avec #3=spline + #4=fct
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and #3,name=ZZZA}] ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintborneb and #3,name=ZZZB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudB},{\xintfloateval{subs(#4,x=\absnoeudB)}})-- (ZZZB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{fct/itp}%avec #3=formule + #4=liste interpo
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#3),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=ZZZAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=ZZZAB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#3,x=\absnoeudA)}})-- (ZZZAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudB},{\xintfloateval{subs(#3,x=\absnoeudB)}})-- (ZZZAB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp/fct}%
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot[smooth] coordinates {\xintthecoords\xintfloatexpr seq((x,#4),x=\absnoeudA..[\pflstepcurve]..\absnoeudB,\absnoeudB)\relax} -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=ZZZAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=ZZZAB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudA},{\xintfloateval{subs(#4,x=\absnoeudA)}})-- (ZZZAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] ({\absnoeudB},{\xintfloateval{subs(#4,x=\absnoeudB)}})-- (ZZZAB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{itp/spl}%
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{Tension}}] coordinates {#3} -- ({\absnoeudB},{\pflymin}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- \pfldomtikznamesplineb -- ({\absnoeudB},{\pflymax}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;%borne sup
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpo,name=YYYKAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpo,name=YYYKBB}] ;
+ \path[name intersections={of=tmpintbornea and #4,name=ZZZKAA}] ;
+ \path[name intersections={of=tmpintborneb and #4,name=ZZZKBB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYKAA-1)-- (ZZZKAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYKBB-1)-- (ZZZKBB-1) ;
+ }%
+ {}%
+ \IfStrEq{\pfldomtikztype}{spl/itp}%
+ {%
+ \begin{scope}
+ \clip ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymax}) -- plot [smooth,tension={\useKV[GraphicTikzIntegr]{TensionB}}] coordinates {#4} -- ({\absnoeudB},{\pflymax}) ;
+ \clip ({\absnoeudA},{\pflymin}) -- \pfldomtikznamespline -- ({\absnoeudB},{\pflymin}) -- cycle ;
+ \filldraw[integraletikzstyle,integralebordtikzstyle,#2] ({\absnoeudA},{\pflymin}) rectangle ({\absnoeudB},{\pflymax}) ;
+ \end{scope}
+ \path[draw=none,tkzgrphcurve,name path=tmpintbornea] ({\absnoeudA},{\pflymin})--({\absnoeudA},{\pflymax}) ;%borne inf
+ \path[draw=none,tkzgrphcurve,name path=tmpintborneb] ({\absnoeudB},{\pflymin})--({\absnoeudB},{\pflymax}) ;%borne sup
+ \path[name intersections={of=tmpintbornea and \pfldomtikznameinterpob,name=YYYKAA}] ;
+ \path[name intersections={of=tmpintborneb and \pfldomtikznameinterpob,name=YYYKBB}] ;
+ \path[name intersections={of=tmpintbornea and #3,name=ZZZKAA}] ;
+ \path[name intersections={of=tmpintborneb and #3,name=ZZZKBB}] ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYKAA-1)-- (ZZZKAA-1) ;
+ \draw[\pfldomtikzcolorbord,tkzgrphline] (YYYKBB-1)-- (ZZZKBB-1) ;
+ }%
+ {}%
+}
+
+\NewDocumentCommand\DrawPts{ s O{black} D<>{\normalfont\normalsize} m }{%
+ \IfBooleanTF{#1}%
+ {%
+ \foreach \Point in {#4}{%
+ \filldraw[#2] \Point circle[tkzgrphpointc] ;
+ }
+ }%
+ {%
+ \foreach \Point/\Pos/\Label in {#4}{%
+ \filldraw[#2] \Point circle[tkzgrphpointc] node[tkzgrphnode,\Pos,font=#3] {\Label} ;
+ }
+ }%
+}
+
+% %====STATS À 2 VARIABLES
+\defKV[GraphicTikzRegLin]{%
+ Rounds=\def\pflarrondisreglin{#1},
+ Name=\def\pflnamereglin{#1},
+ NameParab=\def\pflnameregquad{#1},
+ Start=\def\pflreglinmin{#1},
+ End=\def\pflreglinmax{#1}
+}
+\setKVdefault[GraphicTikzRegLin]{
+ ColorScatter=black,
+ ColorLine=black,
+ ColorParab=black,
+ Rounds={},
+ Start={\pflxmin},
+ End={\pflxmax},
+ Name=reglin,%
+ NameParab=quadreg,%
+ DrawLine=false,%
+ DrawParab=false,%
+ Style=o
+}
+
+\NewDocumentCommand\DrawScatter{ O{} D<>{d} m m }{%
+ \useKVdefault[GraphicTikzRegLin]%
+ \setKV[GraphicTikzRegLin]{#1}% on paramètres les nouvelles clés et on les simplifie
+ %listes des données
+ \def\xliste{#3}
+ \def\yliste{#4}
+ \readlist*\LX{\xliste}
+ \readlist*\LY{\yliste}
+ %taille des listes
+ \def\LNB{\inteval{\LXlen}}
+ %nuage
+ \foreach \i in {1,...,\LXlen}{%
+ \itemtomacro\LX[\i]\tmpmavalx%
+ \itemtomacro\LY[\i]\tmpmavaly%
+ \MarkPts*[Style={\useKV[GraphicTikzRegLin]{Style}},Color={\useKV[GraphicTikzRegLin]{ColorScatter}}]{(\tmpmavalx,\tmpmavaly)}%
+ }
+ %droite de régression
+ \ifboolKV[GraphicTikzRegLin]{DrawLine}%
+ {%
+ %somme des LX et des LY OK
+ \xdef\LXSomme{0}
+ \xdef\LYSomme{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LXSomme{\xintfloateval{\LXSomme+\LX[\i]}}
+ }
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LYSomme{\xintfloateval{\LYSomme+\LY[\i]}}
+ }
+ %moyenne des LX et des LY OK
+ \xdef\LXmoy{\xintfloateval{\LXSomme/\LNB}}
+ \xdef\LYmoy{\xintfloateval{\LYSomme/\LNB}}
+ %variance des LX et des LY OK
+ \xdef\LXvar{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LXvar{\xintfloateval{\LXvar+(\LX[\i]-\LXmoy)*(\LX[\i]-\LXmoy)}}
+ }
+ \xdef\LXvar{\xintfloateval{\LXvar/\LNB}}
+ \xdef\LYvar{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LYvar{\xintfloateval{\LYvar+(\LY[\i]-\LYmoy)*(\LY[\i]-\LYmoy)}}
+ }
+ \xdef\LYvar{\xintfloateval{\LYvar/\LNB}}
+ %covariance des XY OK
+ \xdef\LXYvar{0}
+ \foreach \i in {1,2,...,\LNB}{
+ \xdef\LXYvar{\xintfloateval{\LXYvar+(\LX[\i]-\LXmoy)*(\LY[\i]-\LYmoy)}}
+ }
+ \xdef\LXYvar{\xintfloateval{\LXYvar/\LNB}}
+ %COEFFS OK
+ \IfStrEq{\pflarrondisreglin}{}%
+ {%
+ \xdef\tmpcoeffreglina{\xintfloateval{\LXYvar/\LXvar}}
+ \xdef\tmpcoeffreglinb{\xintfloateval{\LYmoy-\tmpcoeffreglina*\LXmoy}}
+ }%
+ {%
+ \IfSubStr{\pflarrondisreglin}{/}%
+ {%
+ \StrCut{\pflarrondisreglin}{/}{\pflarrondisreglina}{\pflarrondisreglinb}
+ }%
+ {%
+ \xdef\pflarrondisreglina{\pflarrondisreglin}\xdef\pflarrondisreglinb{\pflarrondisreglin}
+ }%
+ \xdef\tmpcoeffreglina{\xintfloateval{round(\LXYvar/\LXvar,\pflarrondisreglina)}}
+ \xdef\tmpcoeffreglinb{\xintfloateval{round(\LYmoy-\tmpcoeffreglina*\LXmoy,\pflarrondisreglinb)}}
+ }%
+ \xintdeffloatfunc #2(x) := (\tmpcoeffreglina)*x+(\tmpcoeffreglinb) ;
+ %tracé
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzRegLin]{ColorLine}},name path global=\pflnamereglin,samples=2,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffreglina*\x+\tmpcoeffreglinb}) ;
+ \end{scope}
+ }%
+ {}%
+ \ifboolKV[GraphicTikzRegLin]{DrawParab}%
+ {%
+ %somme importantes
+ \xdef\LXSomme{0}%
+ \xdef\LXCSomme{0}%
+ \xdef\LYSomme{0}%
+ \xdef\LXXSomme{0}%
+ \xdef\LXYSomme{0}%
+ \xdef\LXXCSomme{0}%
+ \xdef\LXCXCSomme{0}%
+ \xdef\LXCYSomme{0}%
+ %calculs
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LXSomme{\xintfloateval{\LXSomme+\LX[\i]}}%
+ \xdef\LXCSomme{\xintfloateval{\LXCSomme+(\LX[\i])^2}}%
+ }%
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LYSomme{\xintfloateval{\LYSomme+\LY[\i]}}%
+ }%
+ \xdef\LXmoy{\xintfloateval{\LXSomme/\LNB}}%
+ \xdef\LYmoy{\xintfloateval{\LYSomme/\LNB}}%
+ \xdef\LXCmoy{\xintfloateval{\LXCSomme/\LNB}}%
+ %calculs suites
+ \foreach \i in {1,2,...,\LNB}{%
+ \xdef\LXXSomme{\xintfloateval{\LXXSomme+(\LX[\i]-\LXmoy)^2}}%
+ \xdef\LXYSomme{\xintfloateval{\LXYSomme+(\LX[\i]-\LXmoy)*(\LY[\i]-\LYmoy)}}%
+ \xdef\LXXCSomme{\xintfloateval{\LXXCSomme+(\LX[\i]-\LXmoy)*((\LX[\i])*(\LX[\i])-\LXCmoy)}}%
+ \xdef\LXCXCSomme{\xintfloateval{\LXCXCSomme+((\LX[\i])^2-\LXCmoy)^2}}%
+ \xdef\LXCYSomme{\xintfloateval{\LXCYSomme+((\LX[\i])^2-\LXCmoy)*(\LY[\i]-\LYmoy)}}%
+ }%
+ %COEFFS OK
+ \IfStrEq{\pflarrondisreglin}{}%
+ {%
+ \xdef\tmpcoeffregquadb{\xintfloateval{(\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}}
+ \xdef\tmpcoeffregquada{\xintfloateval{(\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2)}}
+ \xdef\tmpcoeffregquadc{\xintfloateval{\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy}}
+ }%
+ {%
+ \xdef\tmpcoeffregquadb{\xintfloateval{round((\LXYSomme*\LXCXCSomme-\LXCYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}}
+ \xdef\tmpcoeffregquada{\xintfloateval{round((\LXCYSomme*\LXXSomme-\LXYSomme*\LXXCSomme)/(\LXXSomme*\LXCXCSomme-(\LXXCSomme)^2),\pflarrondisreglin)}}
+ \xdef\tmpcoeffregquadc{\xintfloateval{round(\LYmoy-\tmpcoeffregquadb*\LXmoy-\tmpcoeffregquada*\LXCmoy,\pflarrondisreglin)}}
+ }%
+ \xintdeffloatfunc #2(x) := (\tmpcoeffregquada)*x^2+(\tmpcoeffregquadb)*x+\tmpcoeffregquadc ;
+ %tracé
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzRegLin]{ColorParab}},name path global=\pflnameregquad,samples=250,domain=\pflreglinmin:\pflreglinmax] plot (\x,{\tmpcoeffregquada*(\x)^2+\tmpcoeffregquadb*\x+\tmpcoeffregquadc}) ;
+ \end{scope}
+ }%
+ {}%
+}
+
+\if at loadxintreg
+%régressions alternatives
+\NewDocumentCommand\DrawRegression{ O{} D<>{curvajust} m D<>{} m m }{%
+ %1=options de tracés
+ %2=nom courbe
+ %3=type
+ %4=arrondis
+ %5=liste X
+ %6=liste Y
+ \IfStrEq{#3}{lin}%
+ {%
+ \xintlinreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\linrega*x+\linregb}%
+ }%
+ {}%
+ \IfStrEq{#3}{quad}%
+ {%
+ \xintquadreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\quadrega*x^2+\quadregb*x+\quadregc}%
+ }%
+ {}%
+ \IfStrEq{#3}{pow}%
+ {%
+ \xintpowreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\powrega*x^(\powregb)}%
+ }%
+ {}%
+ \IfStrEq{#3}{expab}%
+ {%
+ \xintexpabreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\expabrega*(\expabregb)^x}%
+ }%
+ {}%
+ \IfStrEq{#3}{hyp}%
+ {%
+ \xinthypreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\hyprega+(\hypregb)/x}%
+ }%
+ {}%
+ \IfStrEq{#3}{log}%
+ {%
+ \xintlogreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\logrega+(\logregb)*log(x)}%
+ }%
+ {}%
+ \IfStrEq{#3}{exp}%
+ {%
+ \xintexpreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{exp(\exprega*x+\expregb)}%
+ }%
+ {}%
+ \IfStrEq{#3}{expalt}%
+ {%
+ \xintexpreg[Alt,round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\expregb*exp(\exprega*x)}%
+ }%
+ {}%
+ \IfStrEq{#3}{cub}%
+ {%
+ \xintcubreg[round={#4}]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\cubrega*x^3+\cubregb*x^2+\cubregc*x+\cubregd}%
+ }%
+ {}%
+ \IfSubStr{#3}{expoff}%
+ {%
+ \StrBehind{#3}{=}[\expoffset]%
+ \xintexpoffreg[round={#4},offset=\expoffset]{#5}{#6}%
+ \DefineFunction[#1,Trace]<#2>{\expoffset+\expregoffb*exp(\expregoffa*x)}%
+ }%
+ {}%
+}
+\fi
+
+%===IMAGES & ANTÉCÉDENTS
+\defKV[GraphicTikzImg]{
+ Colors=\def\pflimgcolors{#1},%
+ Name=\def\pflantecednoms{#1}%
+}
+
+\setKVdefault[GraphicTikzImg]{
+ Colors=black,%
+ Lines=false,%
+ Spline=false,%
+ Name={},%
+ Style=o
+}
+
+\NewDocumentCommand\DefineRange{ O{} m m }{%
+ \useKVdefault[GraphicTikzImg]%
+ \setKV[GraphicTikzImg]{#1}%
+ \ifboolKV[GraphicTikzImg]{Spline}%
+ {%
+ \path[draw=none,tkzgrphcurve,name path=tmpimage] ({#3},{\pflymin})--({#3},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=ZZZZ}] ;
+ \coordinate (\pflantecednoms) at (ZZZZ-1) ;
+ }%
+ {%
+ \xdef\tmpresimg{\xintfloateval{#2(#3)}}%
+ \coordinate (\pflantecednoms) at ({#3},{\tmpresimg}) ;
+ }%
+}
+
+\NewDocumentCommand\DrawRanges{ O{} m m }{%
+ \useKVdefault[GraphicTikzImg]%
+ \setKV[GraphicTikzImg]{#1}%
+ \IfSubStr{\pflimgcolors}{/}%
+ {%
+ \StrCut{\pflimgcolors}{/}{\pflimgcolorpt}{\pflimgcolorline}
+ }%
+ {%
+ \xdef\pflimgcolorpt{\pflimgcolors}\xdef\pflimgcolorline{\pflimgcolors}
+ }%
+ \ifboolKV[GraphicTikzImg]{Spline}%
+ {%
+ \foreach \i in {#3}{%
+ \path[draw=none,tkzgrphcurve,name path=tmpimage] ({\i},{\pflymin})--({\i},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=ZZ}] ;
+ \ifboolKV[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphrange] let \p1 = (ZZ-1) in ({\x1},{\pflOy}) |- ({\pflOx},{\y1}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzImg]{Style}},Color=\pflimgcolorpt]{(ZZ-1)}
+ %\filldraw[\pflimgcolorpt] (ZZ-1) circle[radius=2pt] ;
+ }
+ }%
+ {%
+ \foreach \i in {#3}{%
+ \xdef\tmpresimg{\xintfloateval{#2(\i)}}%
+ \ifboolKV[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphrange] ({\i},{\pflOy}) |- ({\pflOx},{\tmpresimg}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzImg]{Style}},Color=\pflimgcolorpt]{({\i},{\tmpresimg})}
+ %\filldraw[\pflimgcolorpt] ({\i},{\tmpresimg}) circle[radius=2pt] ;
+ }%
+ }%
+}
+
+\NewDocumentCommand\DrawCounterimage{ O{} m m }{%avec le nom de la courbe...
+ \useKVdefault[GraphicTikzImg]%
+ \setKV[GraphicTikzImg]{#1}%
+ \xdef\pflstepcurve{\xintfloateval{0.1*\pflgrillexs}}
+ \IfSubStr{\pflimgcolors}{/}%
+ {%
+ \StrCut{\pflimgcolors}{/}{\pflimgcolorpt}{\pflimgcolorline}%
+ }%
+ {%
+ \xdef\pflimgcolorpt{\pflimgcolors}\xdef\pflimgcolorline{\pflimgcolors}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \path[draw=none,tkzgrphcurve,name path=tmpanteced] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ \path[name intersections={of=#2 and tmpanteced,name=ZZ,total=\t}] \pgfextra{\xdef\tmptotanteced{\t}};
+ \xintifboolexpr{\tmptotanteced == 0}{}%
+ {%
+ \ifboolKV[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphcounterimage] ({\pflxmin},{#3})--({\pflxmax},{#3}) ;
+ }%
+ {}%
+ \foreach \i in {1,...,\tmptotanteced}{%
+ \IfStrEq{\pflantecednoms}{}%
+ {}%
+ {%
+ \coordinate (\pflantecednoms-\i) at (ZZ-\i) ;
+ }%
+ \ifboolKV[GraphicTikzImg]{Lines}%
+ {%
+ \draw[\pflimgcolorline,tkzgrphrange] let \p1 = (ZZ-\i) in (ZZ-\i) -- ({\x1},{\pflOy}) ;
+ }%
+ {}%
+ \MarkPts*[Style={\useKV[GraphicTikzImg]{Style}},Color=\pflimgcolorpt]{(ZZ-\i)}
+ %\filldraw[\pflimgcolorpt] (ZZ-\i) circle[radius=2pt] ;
+ }%
+ }%
+ \end{scope}
+}
+
+%===NOMBRE DÉRIVÉ ET TANGENTE (EXPÉRIEMENTAL)
+\NewDocumentCommand\CalcDerivate{ s m m m }{%*=gauche+nomfct+abspt+h
+ \IfBooleanTF{#1}%
+ {%
+ \xdef\TmpResNbDeriv{\xintfloateval{(#2(#3)-#2(#3-#4))/(#4)}}%
+ }%
+ {%
+ \xdef\TmpResNbDeriv{\xintfloateval{(#2(#3+#4)-#2(#3))/(#4)}}%
+ }%
+}
+
+\defKV[GraphicTikzTgte]{%
+ Colors=\def\pfltgttikzcolors{#1},%
+ OffsetL=\def\pfltgttikzkl{#1},%
+ OffsetR=\def\pfltgttikzkr{#1},%
+ h=\def\pfltgttikzh{#1},%
+ Direction=\def\pfltgttikzsens{#1},%
+ Delta=\def\tmptgtedelta{#1}
+}
+\setKVdefault[GraphicTikzTgte]{%
+ Colors=black,%
+ OffsetL=1,%
+ OffsetR=1,%
+ DispPt=false,%
+ Spline=false,%
+ h=0.1,%
+ Direction=lr,%
+ Node=false,%
+ Delta=0.01,%
+ Style=o
+}
+
+\NewDocumentCommand\DrawTangent{ O{} m m D<>{} }{%
+ \restoreKV[GraphicTikzTgte]%
+ \setKV[GraphicTikzTgte]{#1}%
+ %en fonction de la gestion de l'abscisse
+ \ifboolKV[GraphicTikzTgte]{Node}%
+ {%
+ \path #3;
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfltgttikzx{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ }%
+ {%
+ \xdef\pfltgttikzx{#3}%
+ }%
+ %parties communes
+ \IfSubStr{\pfltgttikzcolors}{/}%
+ {%
+ \StrCut{\pfltgttikzcolors}{/}{\pfltgttikzline}{\pfltgttikzpoint}
+ }%
+ {%
+ \xdef\pfltgttikzline{\pfltgttikzcolors}\xdef\pfltgttikzpoint{\pfltgttikzcolors}
+ }%
+ \xdef\tmptgtdeb{\xintfloateval{\pfltgttikzx-(\pfltgttikzkl)}}%
+ \xdef\tmptgtfin{\xintfloateval{\pfltgttikzx+(\pfltgttikzkr)}}%
+ %suivant le type de courbe
+ \ifboolKV[GraphicTikzTgte]{Spline}%
+ {%
+ \path[name path=tmpimage] ({\pfltgttikzx},{\pflymin})--({\pfltgttikzx},{\pflymax}) ;
+ \path[name intersections={of=#2 and tmpimage,name=TANp}] ;
+ \IfStrEq{\pfltgttikzsens}{lr}%
+ {%
+ \path[name path=L-vline] ({\pfltgttikzx-\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx-\tmptgtedelta},{\pflymax}) ;
+ \path[name path=R-vline] ({\pfltgttikzx+\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx+\tmptgtedelta},{\pflymax}) ;
+ %\coordinate (LXcoor) at ($(TANp-1)+({-\tmptgtedelta},0)$) ;
+ %\coordinate (RXcoor) at ($(TANp-1)+({\tmptgtedelta},0)$) ;
+ }%
+ {}%
+ \IfStrEq{\pfltgttikzsens}{l}%
+ {%
+ \path[name path=L-vline] ({\pfltgttikzx-\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx-\tmptgtedelta},{\pflymax}) ;
+ \path[name path=R-vline] ({\pfltgttikzx},{\pflymin}) -- ({\pfltgttikzx},{\pflymax}) ;
+ %\coordinate (LXcoor) at ($(TANp-1)+({-\tmptgtedelta},0)$) ;
+ %\coordinate (RXcoor) at (TANp-1) ;
+ \def\tmptgtfin{\pfltgttikzx}%
+ }%
+ {}%
+ \IfStrEq{\pfltgttikzsens}{r}%
+ {%
+ \path[name path=L-vline] ({\pfltgttikzx},{\pflymin}) -- ({\pfltgttikzx},{\pflymax}) ;
+ \path[name path=R-vline] ({\pfltgttikzx+\tmptgtedelta},{\pflymin}) -- ({\pfltgttikzx+\tmptgtedelta},{\pflymax}) ;
+ \def\tmptgtdeb{\pfltgttikzx}%
+ }%
+ {}%
+ \path[name intersections={of=#2 and L-vline,name=LXcut}] ;
+ \path[name intersections={of=#2 and R-vline,name=RXcut}] ;
+ \coordinate (tzXproj) at ($(LXcut-1)!(TANp-1)!(RXcut-1)$) ; % projection
+ \coordinate (LLpoint) at ($(LXcut-1)+(TANp-1)-(tzXproj)$) ; % move
+ \coordinate (RRpoint) at ($(RXcut-1)+(TANp-1)-(tzXproj)$) ; % move
+ \path (LLpoint);
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\tzTANLLX{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\tzTANLLY{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ \path (RRpoint);
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\tzTANRRX{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\tzTANRRY{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ \def\tztangentLFn{(\tzTANRRY-\tzTANLLY)/(\tzTANRRX-\tzTANLLX)*(\x-\tzTANLLX)+\tzTANLLY}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \draw[tkzgrphline,\pfltgttikzline,domain=\tmptgtdeb:\tmptgtfin,samples=2,#4] plot (\x,{\tztangentLFn}) ;
+ \end{scope}
+ }%
+ {%
+ \IfStrEq{\pfltgttikzsens}{l}%
+ {%
+ \CalcDerivate*{#2}{\pfltgttikzx}{\pfltgttikzh}%
+ }%
+ {%
+ \CalcDerivate{#2}{\pfltgttikzx}{\pfltgttikzh}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \draw[tkzgrphline,\pfltgttikzline,#4] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,\TmpResNbDeriv*(x-(\pfltgttikzx))+#2(\pfltgttikzx)),x=\tmptgtdeb,\tmptgtfin)
+ \relax
+ };
+ \end{scope}
+ }%
+ \ifboolKV[GraphicTikzTgte]{DispPt}%
+ {%
+ \ifboolKV[GraphicTikzTgte]{Spline}%
+ {%
+ \MarkPts*[Style={\useKV[GraphicTikzTgte]{Style}},Color=\pfltgttikzpoint]{(TANp-1)}
+ %\filldraw[] (TANp-1) circle[tkzgrphpointc] ;
+ }%
+ {%
+ \xdef\tmpimgtgt{\xintfloateval{#2(\pfltgttikzx)}}%
+ \MarkPts*[Style={\useKV[GraphicTikzTgte]{Style}},Color=\pfltgttikzpoint]{({\pfltgttikzx},\tmpimgtgt)}
+ %\filldraw[\pfltgttikzpoint] ({\pfltgttikzx},\tmpimgtgt) circle[tkzgrphpointc] ;
+ }%
+ }%
+ {}%
+}
+
+%====loi normale
+\defKV[GraphicTikzGaussienne]{%
+ Step=\def\pflgaussstep{#1},%
+ Name=\def\pflgaussname{#1}
+}
+
+\setKVdefault[GraphicTikzGaussienne]{%
+ Name=gaussian,%
+ Color=black,%
+ Trace=false,%
+ Step={},%
+ Start={\pflxmin},%
+ End={\pflxmax}
+}
+
+\NewDocumentCommand\DefineStandartDeviation{ O{} D<>{phi} m m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#1}%
+ \xintdeffloatfunc #2(x) := 1/((#4)*sqrt(2*pi))*exp(-0.5*((x-(#3))/(#4))^2) ;%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzGaussienne]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}},name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawStandartDeviation{ O{} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#1}%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ \end{scope}
+}
+
+\NewDocumentCommand\DefineKhiSquared{ O{} D<>{khi} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#1}%
+ \xintdeffloatfunc #2(x) := (x<0)?{0}{(1/(2^((#3)/2)*pflgamma((#3)/2)))*x^((#3)/2-1)*exp(-x/2)};
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \ifboolKV[GraphicTikzGaussienne]{Trace}%
+ {%
+ \path[draw,tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}},name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ {%
+ \path[draw=none,tkzgrphcurve,name path global=\pflgaussname] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ }%
+ \end{scope}
+}
+
+\NewDocumentCommand\DrawKhiSquared{ O{} m }{%
+ %1=options
+ %2=mu
+ %3=sigma
+ \restoreKV[GraphicTikzGaussienne]%
+ \setKV[GraphicTikzGaussienne]{#1}%
+ \IfStrEq{\pflgaussstep}{}%
+ {%
+ \xdef\pflgaussstep{\xintfloateval{((\useKV[GraphicTikzGaussienne]{End})-(\useKV[GraphicTikzGaussienne]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax});
+ \draw[tkzgrphcurve,{\useKV[GraphicTikzGaussienne]{Color}}] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2),x={\useKV[GraphicTikzGaussienne]{Start}}..[\pflgaussstep]..{\useKV[GraphicTikzGaussienne]{End}},{\useKV[GraphicTikzGaussienne]{End}})
+ \relax
+ } ;
+ \end{scope}
+}
+
+%====droite
+\defKV[GraphiquetikzDroite]{%
+ Name=\def\pfldroitename{#1}
+}
+
+\setKVdefault[GraphiquetikzDroite]{%
+ Slope=false,%
+ Color=black,%
+ Start={\pflxmin},%
+ End={\pflxmax},%
+ Name={}
+}
+
+\NewDocumentCommand\DrawLine{ O{} m m D<>{} }{%
+ \restoreKV[GraphiquetikzDroite]%
+ \setKV[GraphiquetikzDroite]{#1}%
+ %1er point
+ \path #2;%
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfldtetikzxA{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\pfldtetikzyA{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ %2ème point si besoin
+ \ifboolKV[GraphiquetikzDroite]{Slope}%
+ {%
+ \xdef\pfldtepente{\xintfloateval{#3}}%
+ }%
+ {%
+ \path #3;%
+ \pgfgetlastxy{\macrox}{\macroy}%
+ \xdef\pfldtetikzxB{\xintfloateval{(\ConvertPtToCm{\macrox})/(\pflxunit)}}%
+ \xdef\pfldtetikzyB{\xintfloateval{(\ConvertPtToCm{\macroy})/(\pflyunit)}}%
+ \xdef\pfldtepente{\xintfloateval{(\pfldtetikzyB-\pfldtetikzyA)/(\pfldtetikzxB-\pfldtetikzxA)}}%
+ }%
+ \begin{scope}
+ \clip ({\pflxmin},{\pflymin}) rectangle ({\pflxmax},{\pflymax}) ;
+ \xintifboolexpr{\pfldtetikzxA == \pfldtetikzxB}%
+ {%
+ \IfEq{\pfldroitename}{}%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},#4] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ;
+ }%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},#4,name path global=\pfldroitename] (\pfldtetikzxA,\pflymin) -- (\pfldtetikzxA,\pflymax) ;
+ }%
+ }%
+ {%
+ \IfEq{\pfldroitename}{}%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},domain={\useKV[GraphiquetikzDroite]{Start}}:{\useKV[GraphiquetikzDroite]{End}},samples=2,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ;
+ }%
+ {%
+ \draw[tkzgrphline,{\useKV[GraphiquetikzDroite]{Color}},domain={\useKV[GraphiquetikzDroite]{Start}}:{\useKV[GraphiquetikzDroite]{End}},samples=2,name path global=\pfldroitename,#4] plot (\x,{\pfldtepente*(\x-\pfldtetikzxA)+\pfldtetikzyA}) ;
+ }%
+ }%
+ \end{scope}
+}
+
+\defKV[GraphicTikzMinMax]{%
+ Pas=\def\pflminmaxstep{#1},%
+ Method=\def\pflminmaxmethode{#1},%
+ Coeffs=\def\pflminmaxcoeffs{#1}
+}
+\setKVdefault[GraphicTikzMinMax]{%
+ Start={\pflxmin},%
+ End={\pflxmax},%
+ Pas={},%
+ Tension=0.5,%
+ Method=function,%
+ Coeffs=3
+}
+
+\NewDocumentCommand\FindMax{ O{} m O{c-max} }{%
+ %1=clés
+ %2=paramètres en fonction de [Methode]
+ \restoreKV[GraphicTikzMinMax]%
+ \setKV[GraphicTikzMinMax]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphicTikzMinMax]{End})-(\useKV[GraphicTikzMinMax]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}[bezier bounding box,local bounding box=bbtmpmax]
+ \IfStrEq{\pflminmaxmethode}{function}%
+ {%
+ \path[draw=none,name path=curvetmpmax] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzMinMax]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzMinMax]{End}},{\useKV[GraphicTikzMinMax]{End}})
+ \relax
+ };
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{interpo}%
+ {%
+ \path[draw=none,name path=curvetmpmax] plot[smooth,tension={\useKV[GraphicTikzMinMax]{Tension}}] coordinates {#2};
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{spline}%
+ {%
+ \GenerateSpline{#2}{\pflminmaxcoeffs}[\tmpsplineminmax]%
+ \path[draw=none,name path=curvetmpmax] \tmpsplineminmax ;
+ }%
+ {}%
+ %retour
+ \path[name path=tmpmax] ([yshift=-0.25\pgflinewidth]bbtmpmax.north east) -- ([yshift=-0.25\pgflinewidth]bbtmpmax.north west) ;
+ \path[name intersections={of=curvetmpmax and tmpmax,name=#3}] ;
+ \coordinate (#3) at ($0.5*(#3-1)+0.5*(#3-2)+(0,0.25\pgflinewidth)$) ;
+ \end{scope}
+}
+
+\NewDocumentCommand\FindMin{ O{} m O{c-min} }{%
+ %1=clés
+ %2=paramètres en fonction de [Methode]
+ \restoreKV[GraphicTikzMinMax]%
+ \setKV[GraphicTikzMinMax]{#1}%
+ \IfStrEq{\pflstepcurve}{}%
+ {%
+ \xdef\pflminmaxstep{\xintfloateval{((\useKV[GraphicTikzMinMax]{End})-(\useKV[GraphicTikzMinMax]{Start}))/100}}%
+ }%
+ {}%
+ \begin{scope}[bezier bounding box,local bounding box=bbtmpmin]
+ \IfStrEq{\pflminmaxmethode}{function}%
+ {%
+ \path[draw=none,name path=curvetmpmin] plot[smooth] coordinates {%
+ \xintthecoords\xintfloatexpr
+ seq((x,#2(x)),x={\useKV[GraphicTikzMinMax]{Start}}..[\pflstepcurve]..{\useKV[GraphicTikzMinMax]{End}},{\useKV[GraphicTikzMinMax]{End}})
+ \relax
+ };
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{interpo}%
+ {%
+ \path[draw=none,name path=curvetmpmin] plot[smooth,tension={\useKV[GraphicTikzMinMax]{Tension}}] coordinates {#2};
+ }%
+ {}%
+ \IfStrEq{\pflminmaxmethode}{spline}%
+ {%
+ \GenerateSpline{#2}{\pflminmaxcoeffs}[\tmpsplineminmax]%
+ \path[draw=none,name path=curvetmpmin] \tmpsplineminmax ;
+ }%
+ {}%
+ %retour
+ \path[name path=tmpmin] ([yshift=0.25\pgflinewidth]bbtmpmin.south east) -- ([yshift=0.25\pgflinewidth]bbtmpmin.south west) ;
+ \path[name intersections={of=curvetmpmin and tmpmin,name=#3}] ;
+ \coordinate (#3) at ($0.5*(#3-1)+0.5*(#3-2)+(0,-0.25\pgflinewidth)$) ;
+ \end{scope}
+}
+
+%====TEXTES
+\defKV[GraphicTikzNode]{%
+ Color=\def\pflnodecol{#1},%
+ Font=\def\pflnodefonte{#1},%
+ Position=\def\pfnodepos{#1}
+}
+\setKVdefault[GraphicTikzNode]{%
+ Color=black,%
+ Start={\normalfont\normalsize},%
+ Position={}
+}
+\NewDocumentCommand\DrawTxt{ O{} m m }{%
+ \restoreKV[GraphicTikzNode]%
+ \setKV[GraphicTikzNode]{#1}%
+ \draw #2 node[tkzgrphnode,font=\pflnodefonte,text=\pflnodecol,\pfnodepos] {#3} ;
+}
+
\endinput
\ No newline at end of file
More information about the tex-live-commits
mailing list.