% tkz-tools-lua-base.tex    
% Copyright 2011-2026  Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
% This work has the LPPL maintenance status “maintained”. 
% The Current Maintainer of this work is Alain Matthes.

\def\fileversion{5.11c}
\def\filedate{2026/01/22} 
\typeout{2026/01/22 5.12c tkz-tools-lua-base.tex}   
\makeatletter
%<--------------------------------------------------------------------------–>
\global\let\tkz@tmp@xa\tkz@init@xmin% modif  2016
\global\let\tkz@tmp@xb\tkz@init@xmax% modif  2016
\global\let\tkz@tmp@ya\tkz@init@ymin% modif  2016
\global\let\tkz@tmp@yb\tkz@init@ymax% modif  2016 
%<--------------------------------------------------------------------------–>
\pgfkeys{
         /tkzInit/.cd,
         xmin/.store in     = \tkz@init@xmin,
         xmax/.store in     = \tkz@init@xmax,
         xstep/.store in    = \tkz@init@xstep,
         ymin/.store in     = \tkz@init@ymin,
         ymax/.store in     = \tkz@init@ymax,
         ystep/.store in    = \tkz@init@ystep, 
         NO/.is if          = tkz@init@NO,
         NO/.default        = true, 
         xmin               = 0,
         xmax               = 10,
         xstep              = 1,
         ymin               = 0,
         ymax               = 10,
         ystep              = 1,
         NO                 = false 
         } 
  
\def\tkzInit{\pgfutil@ifnextchar[{\tkz@Init}{\tkz@Init[]}} 
\def\tkz@Init[#1]{%
    \pgfqkeys{/tkzInit}{#1}
  \ifx\tkzfctloaded\undefined
    \else   
      \tkz@tkzf@fct=0 %  only if tkz-fct loaded
   \fi   
  \xdef\tkz@init@xorigine{0}
  \xdef\tkz@init@yorigine{0}
  \edef\@xsgmin{\fpeval{sign(\tkz@init@xmin)}}
  \edef\@xsgmax{\fpeval{sign(\tkz@init@xmax)}}
  \edef\@ysgmin{\fpeval{sign(\tkz@init@ymin)}}
  \edef\@ysgmax{\fpeval{sign(\tkz@init@ymax)}}
  \let\tkz@tmp@xa\tkz@init@xmin %modif 2016
  \let\tkz@tmp@xb\tkz@init@xmax %modif 2016
  \let\tkz@tmp@ya\tkz@init@ymin %modif 2016
  \let\tkz@tmp@yb\tkz@init@ymax %modif 2016
  \tkz@init@NOfalse                   
  \ifx\@xsgmin\@xsgmax \tkz@init@NOtrue \fi
  \ifx\@ysgmin\@ysgmax \tkz@init@NOtrue \fi
  \iftkz@init@NO%
  \ifx\@xsgmin\@xsgmax
      \edef\tkz@init@xmax{\tkz@Dec{\tkz@init@xmax-(\tkz@init@xmin)}}
      \edef\tkz@init@xorigine{\tkz@init@xmin}
      \edef\tkz@init@xmin{0}
  \fi
  \ifx\@ysgmin\@ysgmax
      \edef\tkz@init@ymax{\tkz@Dec{\tkz@init@ymax-(\tkz@init@ymin)}}
      \edef\tkz@init@yorigine{\tkz@init@ymin}
      \edef\tkz@init@ymin{0}
  \fi
  \fi
  \edef\tkz@xa{\tkz@Dec{\tkz@init@xmin/\tkz@init@xstep}}
  \edef\tkz@xb{\tkz@Dec{\tkz@init@xmax/\tkz@init@xstep}}
  \edef\tkz@ya{\tkz@Dec{\tkz@init@ymin/\tkz@init@ystep}}
  \edef\tkz@yb{\tkz@Dec{\tkz@init@ymax/\tkz@init@ystep}}
  \tkz@getdecimal{\tkz@init@xstep} % amélioration nb dec et integer
  \xdef\tkz@init@xdec{\number\c@pgfmath@countb}
  \tkz@getdecimal{\tkz@init@ystep}
  \xdef\tkz@init@ydec{\number\c@pgfmath@countb}
}%
\def\tkzAddName{\pgfutil@ifnextchar[{\tkz@AddName}{\tkz@AddName[]}} 
\def\tkz@AddName[#1]#2{%
\node[above left,#1] at (\pgf@path@lastx,\pgf@path@lasty){#2};  
}% 
%<--------------------------------------------------------------------------–>
\makeatother 
\endinput