summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tkz-base/tkz-tools-obsolete.tex
blob: 82f7e1bcbb023fb97cc3834fa19cdc2fb904804f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
\makeatletter
\global\edef\tkz@sua@lw{0.4pt} 
\global\edef\tkz@sua@color{black} 
\global\edef\tkz@sua@gradsize{\textstyle} 
\global\edef\tkz@sua@tickwd{0.8 pt}
\global\edef\tkz@sua@ticka{2 pt}  
\global\edef\tkz@sua@tickb{2 pt}



\def\tkzX{\pgfutil@ifnextchar[{\tkz@X}{\tkz@X[]}}
\def\tkz@X[#1]{% 
\begingroup
 \pgfkeys{/tkzX/.cd,
 trig     = 0,
 lw       = \tkz@sua@lw,
 gradsize = \tkz@sua@gradsize,
 color    = \tkz@sua@color,
 tickwd   = \tkz@sua@tickwd,
 tickup   = \tkz@sua@ticka,
 tickdn   = \tkz@sua@tickb,  
 pos      = {below = 3pt},
 label    = $x$,
 poslabel = {below = 3pt},
 noticks  = false,
 nograd   = false,
% unit     = false,
 orig     = false,
 step    = \tkz@init@xstep
 }    
 \pgfqkeys{/tkzX}{#1}  
   \FPtrunc\posmax{\tkz@xb}{\tkz@init@xdec}%
   \FPtrunc\posmin{\tkz@xa}{\tkz@init@xdec}%
   \FPdiv\tkz@posnext{\tkz@posnext}{\tkz@init@xstep}
   \FPadd\posnext{\posmin}{\tkz@posnext}
   \FPadd\tkz@xbsup{\tkz@xb}{\tkz@init@rightspace}
   \path (\tkz@xa,0)--(\tkz@xb,0) node(tkz@xline){};%
    \protected@edef\tkz@temp{%
    \noexpand%    
   \draw[xaxe style,line width = \tkz@X@lw,%
         color      = \tkz@X@color]%
        (\tkz@xa,0)--(\tkz@xbsup,0)%
         node[xlabel style,\tkz@X@poslabel]}\tkz@temp%
         {\tkz@X@label};%
    \FPtrunc\xtkzero{0.0000000}{\tkz@init@xdec}% 
   \iftkz@X@noticks%
   \else 
\ifnum\tkz@X@trig=0%
   \FPtrunc\posmax{\posmax}{\tkz@init@xdec}% 
   \foreach \pos in {\posmin,\posnext,...,\posmax}{%
      \FPtrunc\tkz@pos{\pos}{\tkz@init@xdec}%
      \protected@edef\tkz@temp{%
      \noexpand% 
       \draw[line width = \tkz@X@tickwd,shift = {(\pos,0)}]%
            (0pt,\tkz@X@tickup)--(0pt,-\tkz@X@tickdn)%
            node[\tkz@X@pos,inner sep = 0pt]}\tkz@temp
        {\FPmul{\xgrad}{\pos}{\tkz@init@xstep}%
         \FPadd{\xgrad}{\xgrad}{\tkz@init@xorigine}%
         \FPtrunc\xgrad{\xgrad}{\tkz@init@xdec}%
         \iftkz@X@orig% 
               \iftkz@X@nograd
               \else\tkz@showgrad{\xgrad}%
                  $\textcolor{\tkz@sur@colorlabel}{%
                  \tkz@X@gradsize{\numprint{\tkz@result}}}$%
               \fi
          \else % orig
            \iftkz@init@NO% 
               \ifx\tkz@pos\posmin
               \else
                  \tkz@showgrad{\xgrad}%
                  $\textcolor{\tkz@sur@colorlabel}{%
                  \tkz@X@gradsize{\numprint{\tkz@result}}}$
               \fi
            \else % NO
               \ifx\tkz@pos\xtkzero%
                   % \iftkz@X@unit\tkz@showgrad{\xgrad}%
                   % $\textcolor{\tkz@sur@colorlabel}{%
                   % \tkz@X@gradsize{\numprint{\tkz@result}}}$
                   % \fi  
               \else 
                  \iftkz@X@nograd%
                  \else\tkz@showgrad{\xgrad}%
                    $\textcolor{\tkz@sur@colorlabel}{%
                     \tkz@X@gradsize{\numprint{\tkz@result}}}$
                  \fi
               \fi%end of xtkzero
          \fi%end of NO
      \fi%end of orig
};%  end of draw
}% end foreach
   \else %trig affichage
       \FPadd{\posmin}{\posmin}{0.5}%
       \FPdiv\nbtrigticksmax{\posmax}{\FPpi}%
       \FPdiv\nbtrigticksmin{\posmin}{\FPpi}%
       \FPmul\nbtrigticksmax{\nbtrigticksmax}{\tkz@X@trig}%
       \FPmul\nbtrigticksmin{\nbtrigticksmin}{\tkz@X@trig}%
       \FPround\nbtrigticksmin{\nbtrigticksmin}{0}% 
       \foreach \pos in {\nbtrigticksmin,...,\nbtrigticksmax}{%
          \FPmul\pospi{\pos}{\FPpi}
          \FPdiv\pospi{\pospi}{\tkz@X@trig}%
          \protected@edef\tkz@temp{%
          \noexpand\draw[line width = \tkz@X@tickwd,%
                         shift      = {(\pospi,0)}]%
                      (0pt,\tkz@X@tickup)--(0pt,-\tkz@X@tickup)%
                      node[\tkz@X@pos,%
                           text height = 8pt,%
                           inner sep   = 1pt]}\tkz@temp%
                {\tkzPrintFracWithPi{\pos}{\tkz@X@trig}%
                 \tkzprintfrac};% 
        }% end foreach                              
    \fi
\fi% end ticks  
\endgroup
 }% todo macro pour l'affichage 

%<--------------------------------------------------------------------------–>
%                                 tkzY
%<--------------------------------------------------------------------------–>

\pgfkeys{
  tkzY/.cd,
  pos/.code        = {\def\tkz@Y@pos{#1}},
  trig/.code       = {\def\tkz@Y@trig{#1}},
  lw/.code         = {\def\tkz@Y@lw{#1}},
  color/.code      = {\def\tkz@Y@color{#1}},
  label/.code      = {\def\tkz@Y@label{#1}},  
  poslabel/.code   = {\def\tkz@Y@poslabel{#1}},
  tickwd/.code     = {\def\tkz@Y@tickwd{#1}},
  ticklt/.code     = {\def\tkz@Y@ticklt{#1}},
  tickrt/.code     = {\def\tkz@Y@tickrt{#1}},
  gradsize/.code   = {\def\tkz@Y@gradsize{#1}},
  step/.code       = {\def\tkz@posnext{#1}}, 
  noticks/.is if   = tkz@Y@noticks,
  noticks/.default = true,  
  nograd/.is if    = tkz@Y@nograd,
  nograd/.default  = true,  
  orig/.is if      = tkz@Y@orig,
  orig/.default    = true,  
  unit/.is if      = tkz@Y@unit,
  unit/.default    = true  }    
\def\tkzY{\pgfutil@ifnextchar[{\tkz@Y}{\tkz@Y[]}}
\def\tkz@Y[#1]{%
 \pgfkeys{/tkzY/.cd,
 trig     = 0,
 lw       = \tkz@sua@lw,
 gradsize = \tkz@sua@gradsize,
 color    = \tkz@sua@color,
 tickwd   = \tkz@sua@tickwd,
 tickrt   = \tkz@sua@ticka,
 ticklt   = \tkz@sua@tickb,
 label    = $y$,
 poslabel = {left = 3pt},
 pos      = {left = 3pt},   
 noticks  = false,
 nograd   = false,
 unit     = false,
 orig     = false,
 step     = \tkz@init@ystep
 }    
 \pgfqkeys{/tkzY}{#1}  
   \FPtrunc\posmax{\tkz@yb}{\tkz@init@ydec}%
   \FPtrunc\posmin{\tkz@ya}{\tkz@init@ydec}%
     \FPdiv\tkz@posnext{\tkz@posnext}{\tkz@init@ystep}
   \FPadd\posnext{\posmin}{\tkz@posnext}  
   \path (0,\tkz@ya)--(0,\tkz@yb) node(tkz@yline){};%
   \FPadd\tkz@ybsup{\tkz@yb}{\tkz@init@upspace}   
   \protected@edef\tkz@temp{%
   \noexpand% 
   \draw[line width = \tkz@Y@lw,%
         color      = \tkz@Y@color,yaxe style]%
        (0,\tkz@ya)--(0,\tkz@ybsup)%
        node[\tkz@Y@poslabel,ylabel style]}\tkz@temp%
        {\tkz@Y@label};%
   \FPtrunc\ytkzero{0.000000}{\tkz@init@ydec}%
   \iftkz@Y@noticks%
   \else
   \foreach \pos in {\posmin,\posnext,...,\posmax}{%
       \FPtrunc\tkz@pos{\pos}{\tkz@init@ydec}%
       \protected@edef\tkz@temp{%
       \noexpand% 
       \draw[line width = \tkz@Y@tickwd,%
            shift       = {(0,\pos)}]%
            (\tkz@Y@tickrt,0pt)--(-\tkz@Y@ticklt,0pt)%
            node[\tkz@Y@pos,inner sep = 0pt]}\tkz@temp%
         {\FPmul{\ygrad}{\pos}{\tkz@init@ystep}%
          \FPadd{\ygrad}{\ygrad}{\tkz@init@yorigine}
          \FPtrunc\ygrad{\ygrad}{\tkz@init@ydec}%
          \iftkz@Y@orig% 
              \iftkz@Y@nograd\else\tkz@showgrad{\ygrad}%
                         $\textcolor{\tkz@sur@colorlabel}{\tkz@Y@gradsize{\numprint{\tkz@result}}}$\fi
          \else
           \iftkz@init@NO% 
             \ifx\tkz@pos \posmin\else
             \tkz@showgrad{\ygrad}%
                 $\textcolor{\tkz@sur@colorlabel}{\tkz@Y@gradsize{\numprint{\tkz@result}}}$\fi
        \else 
          \ifx\tkz@pos \ytkzero 
            \iftkz@Y@unit\tkz@showgrad{\ygrad}%
               $\textcolor{\tkz@sur@colorlabel}{\tkz@Y@gradsize{\numprint{\tkz@result}}}$\fi\else
            \iftkz@Y@nograd%
             \else \tkz@showgrad{\ygrad}%
              $\textcolor{\tkz@sur@colorlabel}{\tkz@Y@gradsize{\numprint{\tkz@result}}}$\fi\fi
        \fi
    \fi
   };%
  }%
\fi
\iftkz@init@NO\else\iftkz@Y@unit%
  \draw[line width = 1pt,%
        inner sep  = 1pt] (0,0) -- (0,1)%
        node[left=3pt]%
       {$\tkz@Y@gradsize{\numprint{\tkz@init@ystep}}$};% 
  \draw[line width = \tkz@Y@tickwd,%
        shift      = {(0,1)}]%
      (\tkz@Y@tickrt,0pt)--(-\tkz@Y@ticklt,0pt);%
  \fi\fi
}%
\makeatother
\endinput