summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-fct/doc/latex/TKZdoc-fct-faq.tex
blob: 031891c855c4986656adcf595b442eaa2c8a4948 (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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
%!TEX root = /Users/ego/Boulot/TKZ/tkz-fct/doc-fr/TKZdoc-fct-main.tex  
\section{Quelques remarques}

\begin{enumerate}
\item Modification avec les anciennes versions~:
  \begin{itemize}
   \item \tkzcname{tkzTan} est devenu \tkzcname{tkzDrawTangentLine}
   \item Désormais le domaine est donné comme avec \TIKZ\ et ce n'est plus
    \parg{$x_a..x_b$}
   \item \tkzcname{tkzFctPt} est devenu \tkzcname{tkzDefPointByFct}
  \end{itemize}

\item  Quand \tkzname{xstep} est différent de 1, la variable doit être \tkzcname{x}.
\item Quand une fonction est passée en argument à la macro \tkzcname{tkzFct}, elle est stockée avec la syntaxe de \tkzname{gnuplot} dans la macro \tkzcname{tkzFctgnua}. \tkzname{tkzFctgnu} est un préfixe, « a » est la référence associée à la fonction, la fonction suivante dans le même environnement \tkzname{tikzpicture} sera référencée « b » et ainsi de suite...

Elle est aussi stockée avec la syntaxe de \tkzname{fp.sty} dans la macro  \tkzcname{tkzFcta} avec le préfixe \tkzname{tkzFcta}.

La dernière macro utilisée est également sauvegardée sous les deux syntaxes  avec \tkzcname{tkzFctgnuLast}   et \tkzcname{tkzFctLast}.
\item Attention dans \tkzname{gnuplot} un quotient doit être entré sous la forme 1./3, car 1/3 donne le quotient d'une division euclidienne (ici 0).
\item Problème avec gnuplot~:
  \begin{itemize}
   \item Si le fichier xxx.table n'est pas créé, la cause probable est~:
     \begin{itemize}
     \item  soit que \TEX\ ne trouve pas \tkzname{gnuplot}, c'est en général un problème de « PATH »,
     \item  soit \TEX\  n'autorise pas le lancement de \tkzname{gnuplot} alors c'est que l'option \tkzname{shell-escape} n'est pas autorisé. 
    \end{itemize} 
 
Une autre possibilité est que le fichier xxx.gnuplot soit incorrect. Il suffit de l'ouvrir avec un éditeur pour lire les commandes passées à \tkzname{gnuplot}. Il est à remarquer un changement de syntaxe de \tkzname{gnuplot} autour de la version 4.2. La syntaxe pour créer une table avec des versions ultérieures (4.4 et bientôt 4.5), est désormais  \tkzname{set table}. 


   \item $\pi$ est, avec \tkzname{gnuplot}, défini par \tkzname{pi}
   \item  $\pi$ est, avec \tkzname{fp.sty} défini par \tkzcname{FPpi}.   
   \item (set) samples =2 est suffisant pour tracer une droite.
  \end{itemize}
 
 \item La puissance $a^b$ est notée $a \wedge b$ avec fp et pgfmath mais $a**b$ avec gnuplot.
 
 \item \tkzname{tkz-fct} modife FP@pow  (code modifié de Christian Tellechea 2009) afin d'autoriser les puissances entières de nombres  négatifs.


\item ({1/exp(1)}) est correct mais (1/exp(1)) donne une erreur
\end{enumerate}

\subsection{Fonctions de \tkzname{gnuplot}}


\begin{tabular}{lll}
\toprule      
Gnuplot&fp&Description \\
+  & +  &  addition\\
-  & -   &  soustraction\\
*  & *  &  multiplication\\
/  & /  &  division\\ 
**  & \upp  &  exponentiation\\ 
\%  & absente & modulo \\
pi  &  pi  &  constante 3.1415   \\
abs(x) & abs  & Valeur absolue                              \\
cos(x) & cos &  Arc -cosinus                                \\
sin(x) & sin &  Arc -cosinus                                \\
tan(x) & tan &  Arc -cosinus                                \\
acos(x) & arccos &  Arc -cosinus                            \\
asin(x) &  arcsin &  Arc-sinus                              \\
atan(x) &  arctan &  Arc-tangente                           \\
atan2(y,x) & absente & Arc-tangente                  \\ 
\midrule
cosh(x) & absente & Cosinus hyperbolique                       \\
sinh(x) & absente & Sinus hyperbolique                         \\
acosh(x) & absente & Arc-cosinus hyperbolique                  \\
asinh(x) & absente & Arc-sinus hyperbolique                  \\
atanh(x) & absente & Arc-tangente hyperbolique                 \\ 
\midrule
besj0(x) & absente  & Bessel j0                       \\
besj1(x) & absente & Bessel j1                       \\
besy0(x) & absente & Bessel y0                       \\
besy1(x) & absente & Bessel y1                       \\
\midrule  
ceil(x) & absente &  Le plus petit entier plus grand que       \\
floor(x) & absente &  Plus grand entier plus petit que         \\
absente & trunc(x,n) &  troncature $n$ nombre de décimales        \\ 
absente & round(x,n) &  arrondi $n$ nombre de décimales         \\ 
exp(x) & exp  & Exponentielle                               \\
log(x) & ln &  Logarithme népérien (base e)                 \\
log10(x) & absente & Logarithme base 10                      \\
norm(x) & absente & Distribution normale                       \\
rand(x) & random &  Générateur de nombre pseudo-aléatoire     \\
sgn(x) & absente & Signe                                       \\
sqrt(x) & absente &  Racine carrée                             \\
tanh(x) & absente & Tangente hyperbolique                      \\
\bottomrule
\end{tabular}  
 \endinput 
fp

 fp.sty    ,neg,min,max,
	   round,trunc,clip,e,pow,root     
	   
	   
	    
Toutes les fonctions qui prennent un angle en paramètre considèrent par défaut la valeur donnée comme étant en radians. Pour changer l'unité, il faut utiliser la commande set angles .
Les fonctions ceil et floor renvoient un réel.
 Les fonctions erf, erfc, gamma, ibeta, inverf, igamma, invnorm, lgamma et norm agissent sur la partie réelle de leur paramètre. Enfin, la fonction sgn ignore la partie imaginaire   
 




   rand   random (renvoi un nombre entre 0 et 1)
   real   partie real
   sgn    renvoi 1 si l'argument est positif, 0 s'il
          est nulle, et -1 s'il est négatif


   help expressions functions pour avoir la liste totale


     fp
     
     
     
     	 The following macros are public ones to be used in the document:
	   %controlling messages
	     \FPmessagestrue	% print standard FP-messages (default)
	     \FPmessagesfalse   % suppress standard FP-messages
	     \FPdebugtrue    	% print debug messages (mainly for upn)
	     \FPdebugfalse	% suppress debug messages (default)
	   %introduction of new values
	     \FPset#1#2		% #1 := #2  (#1 may be macro or string)
	   %print values
	     \FPprint#1		% prints #1 (#1 may be macro or string)
           %binary operations
             \FPadd#1#2#3	% #1 := #2+#3
             \FPdiv#1#2#3	% #1 := #2/#3
             \FPmul#1#2#3	% #1 := #2*#3
             \FPsub#1#2#3	% #1 := #2-#3
           %unary operations
             \FPabs#1#2		% #1 := abs(#2)
             \FPneg#1#2		% #1 := -#2
           %binary relations
             \FPiflt#1#2...\else...\fi % #1 < #2 ?
             \FPifeq#1#2...\else...\fi % #1 = #2 ?
             \FPifgt#1#2...\else...\fi % #1 > #2 ?
           %unary relations
             \FPifneg#1 ...\else...\fi % #1 <  0 ?
             \FPifpos#1 ...\else...\fi % #1 >= 0 ?
             \FPifzero#1...\else...\fi % #1 =  0 ?
             \FPifint#1 ...\else...\fi % #1 is integer ?
           %repeat last test
             \ifFPtest  ...\else...\fi % repeat last test
     - fp-addons.sty
	 The following macros are public ones to be used in the document:
	   %binary operations
	     \FPmin#1#2#3	% #1 = min(#2,#3)
	     \FPmax#1#2#3	% #1 = max(#2,#3)
     - fp-eqn.sty (No warranty on correctness and especially on numerical problems!)
         The following macros are public ones to be used in the document:
	   \FPlsolve#1#2#3           
		% #1 := x with #2*x+#3=0
	   \FPqsolve#1#2#3#4#5 
		% #1,#2 := x with #3*x^2+#4*x+#5 = 0
	   \FPcsolve#1#2#3#4#5#6#7
		% #1,#2,#3 := x with #4*x^3+#5*x^2+#6*x+#7 = 0
	   \FPqqsolve#1#2#3#4#5#6#7#8#9
		% #1,#2,#3,#4 := x with #5*x^4+#6*x^3+#7*x^2+#8*x+#9 = 0
	 The resulting solutions are all real values. If there do not
	 exist as much solutions you get a warning message and some
	 other solutions occur several times in the solution vector.
     - fp-exp.sty
         The following macros are public ones to be used in the document:
           \FPe			% 2.718281828459045235
	   \FPexp#1#2 		% #1 := e^(#2)
	   \FPln#1#2		% #1 := ln(#2)
	   \FPpow#1#2#3  	% #1 := (#2)^(#3)
	   \FProot#1#2#3        % #1 := (#2)^(1/#3)
     - fp-random.sty
         The following macros are public ones to be used in the document:
	   \FPseed=#1		% set seed counter for random number generation
	   \FPrandom#1		% #1 := a random number between 0 and 1
     - fp-pas.sty
         The following macros are public ones to be used in the document:
           \FPpascal#1#2 	% #1 := #2-th line of the pascal triangle
     - fp-snap.sty:
         The following macros are public ones to be used in the document:
	   \FPround#1#2#3       % #1 := #2 rounded   to #3 digits after '.'
	   \FPtrunc#1#2#3       % #1 := #2 truncated to #3 digits after '.'
           \FPclip#1#2		% #1 := #2 with all unnecessary 0's removed
     - fp-trigo.sty:
         The following macros are public ones to be used in the document:
	   \FPpi 		% 3.141592653589793238
	   \FPsin#1#2		% #1 := sin(#2)
	   \FPcos#1#2 		% #1 := cos(#2)
	   \FPsincos#1#2#3	% #1 := sin(#3), #2 := cos(#3)
	   \FPtan#1#2		% #1 := tan(#2)
	   \FPcot#1#2 		% #1 := cot(#2)
	   \FPtancot#1#2#3 	% #1 := tan(#3), #2 := cot(#3)
   	   \FParcsin#1#2	% #1 := arcsin(#2)
	   \FParccos#1#2     	% #1 := arccos(#2)
	   \FParcsincos#1#2#3   % #1 := arcsin(#3), #2 := arccos(#3)
	   \FParctan#1#2 	% #1 := arctan(#2)
	   \FParccot#1#2 	% #1 := arccot(#2)
	   \FParctancot#1#2#3	% #1 := arctan(#3), #2 := arccot(#3)
     - fp-upn.sty:
         The following macros are public ones to be used in the document:
           \FPupn#1#2 		% #1 := eval(#2) where eval evaluates the
	 upn-expression #2
	 Known operations are:
	   +,add,-,sub,*,mul,/,div,abs,neg,min,max,
	   round,trunc,clip,e,exp,ln,pow,root,pi,sin,cos,
	   sincos,tan,cot,tancot,arcsin,arccos,arcsincos,
	   arctan,arccot,arctancot,pop,swap,copy
	   where
	     pop  removes the top element
	     swap exchanges the first two elements
	     copy copies the top element
	 Example 1:
	   The macro call
             \FPupn\result{17 2.5 + 17.5 - 2 1 + * 2 swap /} 
	   is equivalent to
	     \result := ((17.5 - (17 + 2.5)) * (2 + 1)) / 2
	   and evaluates to
	     \def\result{-3.000000000000000000}
	   Afterwards the macro call
             \FPupn\result{\result{} -1 * 0.2 + sin 2 round}
	                          ^^ the "{}" is necessary!
	   is equivalent to
	     \result := round_2(sin((\result * -1) + 0.2))
	   and evaluates to
             \def\result{-0.06}
	 Example 2:
	   As "result" is an abbreviation of "\result{}" you may
	   write
	     \FPupn{result}{17 2.5 + 17.5 - 2 1 + * 2 swap /}
	   and
	     \FPupn{result}{result -1 * 0.2 + sin 2 round}
	   instead leading to the same results.
	   This is even true for other macro names using e.g. "x" for "\x{}"
	   and so on. But be careful with it. We may introduce new constants
	   in further versions overwriting these abbreviations.
     - fp-eval.sty:
         The following macros are public ones to be used in the document:
           \FPeval#1#2 		% #1 := eval(#2) where eval evaluates the
	   					 expression #2
	 ATTENTION: Do not use macro names with \. for its own
	 Use only the name or the macro surrounded by (, and ) instead,
	 i.e. do not write "\value{}" but "value" or "(\value)".
	 This is needed to avoid problems with a prefix "-" of numbers.
	 (I do not intend to write a more complex parsing routine in future.
	  But if you do so, just send it to me.
	 )
	 Known infix operations are
	   +, -, *, /, ^ for add, sub, mul, div, pow
	 Each other operation is a prefix one that needs 
	 a (comma or colon seperated) list of subexpressions.
	 Exception: The unary prefix operation - is not known! 
	 (Use the function neg instead.)
	 Example 1:
	   With
	     \edef\result{11}
	   and
	     \FPeval\result{round(root(2,sin(result + 2.5)):2)}
	   or
	     \FPeval{result}{round(root(2,sin(result + 2.5)):2)}
	   \result becomes the value 0.90
	Example 2:
	  \FPeval\result{clip(2*3+5*6)}   results to 36
	  \FPeval\result{clip(2*(3+5)*6)} results to 96