Debian Codegraph @

texmf-dist/doc/latex/tkz-fct/TKZdoc-fct-faq.tex

raw
1 \section{Quelques remarques}
2
3 \begin{enumerate}
4 \item Modification avec les anciennes versions~:
5 \begin{itemize}
6 \item \tkzcname{tkzTan} est devenu \tkzcname{tkzDrawTangentLine}
7 \item Désormais le domaine est donné comme avec \TIKZ\ et ce n'est plus
8 \parg{$x_a..x_b$}
9 \item \tkzcname{tkzFctPt} est devenu \tkzcname{tkzDefPointByFct}
10 \end{itemize}
11
12 \item Quand \tkzname{xstep} est différent de 1, la variable doit être \tkzcname{x}.
13 \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...
14
15 Elle est aussi stockée avec la syntaxe de \tkzname{fp.sty} dans la macro \tkzcname{tkzFcta} avec le préfixe \tkzname{tkzFcta}.
16
17 La dernière macro utilisée est également sauvegardée sous les deux syntaxes avec \tkzcname{tkzFctgnuLast} et \tkzcname{tkzFctLast}.
18 \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).
19 \item Problème avec gnuplot~:
20 \begin{itemize}
21 \item Si le fichier xxx.table n'est pas créé, la cause probable est~:
22 \begin{itemize}
23 \item soit que \TEX\ ne trouve pas \tkzname{gnuplot}, c'est en général un problème de « PATH »,
24 \item soit \TEX\ n'autorise pas le lancement de \tkzname{gnuplot} alors c'est que l'option \tkzname{shell-escape} n'est pas autorisé.
25 \end{itemize}
26
27 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}.
28
29
30 \item $\pi$ est, avec \tkzname{gnuplot}, défini par \tkzname{pi}
31 \item $\pi$ est, avec \tkzname{fp.sty} défini par \tkzcname{FPpi}.
32 \item (set) samples =2 est suffisant pour tracer une droite.
33 \end{itemize}
34
35 \item La puissance $a^b$ est notée $a \wedge b$ avec fp et pgfmath mais $a**b$ avec gnuplot.
36
37 \item \tkzname{tkz-fct} modife FP@pow (code modifié de Christian Tellechea 2009) afin d'autoriser les puissances entières de nombres négatifs.
38
39
40 \item ({1/exp(1)}) est correct mais (1/exp(1)) donne une erreur
41 \end{enumerate}
42
43 \subsection{Fonctions de \tkzname{gnuplot}}
44
45
46 \begin{tabular}{lll}
47 \toprule
48 Gnuplot&fp&Description \\
49 + & + & addition\\
50 - & - & soustraction\\
51 * & * & multiplication\\
52 / & / & division\\
53 ** & \upp & exponentiation\\
54 \% & absente & modulo \\
55 pi & pi & constante 3.1415 \\
56 abs(x) & abs & Valeur absolue \\
57 cos(x) & cos & Arc -cosinus \\
58 sin(x) & sin & Arc -cosinus \\
59 tan(x) & tan & Arc -cosinus \\
60 acos(x) & arccos & Arc -cosinus \\
61 asin(x) & arcsin & Arc-sinus \\
62 atan(x) & arctan & Arc-tangente \\
63 atan2(y,x) & absente & Arc-tangente \\
64 \midrule
65 cosh(x) & absente & Cosinus hyperbolique \\
66 sinh(x) & absente & Sinus hyperbolique \\
67 acosh(x) & absente & Arc-cosinus hyperbolique \\
68 asinh(x) & absente & Arc-sinus hyperbolique \\
69 atanh(x) & absente & Arc-tangente hyperbolique \\
70 \midrule
71 besj0(x) & absente & Bessel j0 \\
72 besj1(x) & absente & Bessel j1 \\
73 besy0(x) & absente & Bessel y0 \\
74 besy1(x) & absente & Bessel y1 \\
75 \midrule
76 ceil(x) & absente & Le plus petit entier plus grand que \\
77 floor(x) & absente & Plus grand entier plus petit que \\
78 absente & trunc(x,n) & troncature $n$ nombre de décimales \\
79 absente & round(x,n) & arrondi $n$ nombre de décimales \\
80 exp(x) & exp & Exponentielle \\
81 log(x) & ln & Logarithme népérien (base e) \\
82 log10(x) & absente & Logarithme base 10 \\
83 norm(x) & absente & Distribution normale \\
84 rand(x) & random & Générateur de nombre pseudo-aléatoire \\
85 sgn(x) & absente & Signe \\
86 sqrt(x) & absente & Racine carrée \\
87 tanh(x) & absente & Tangente hyperbolique \\
88 \bottomrule
89 \end{tabular}
90 \endinput
91 fp
92
93 fp.sty ,neg,min,max,
94 round,trunc,clip,e,pow,root
95
96
97
98 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 .
99 Les fonctions ceil et floor renvoient un réel.
100 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
101
102
103
104
105
106 rand random (renvoi un nombre entre 0 et 1)
107 real partie real
108 sgn renvoi 1 si l'argument est positif, 0 s'il
109 est nulle, et -1 s'il est négatif
110
111
112 help expressions functions pour avoir la liste totale
113
114
115 fp
116
117
118
119 The following macros are public ones to be used in the document:
120 %controlling messages
121 \FPmessagestrue % print standard FP-messages (default)
122 \FPmessagesfalse % suppress standard FP-messages
123 \FPdebugtrue % print debug messages (mainly for upn)
124 \FPdebugfalse % suppress debug messages (default)
125 %introduction of new values
126 \FPset#1#2 % #1 := #2 (#1 may be macro or string)
127 %print values
128 \FPprint#1 % prints #1 (#1 may be macro or string)
129 %binary operations
130 \FPadd#1#2#3 % #1 := #2+#3
131 \FPdiv#1#2#3 % #1 := #2/#3
132 \FPmul#1#2#3 % #1 := #2*#3
133 \FPsub#1#2#3 % #1 := #2-#3
134 %unary operations
135 \FPabs#1#2 % #1 := abs(#2)
136 \FPneg#1#2 % #1 := -#2
137 %binary relations
138 \FPiflt#1#2...\else...\fi % #1 < #2 ?
139 \FPifeq#1#2...\else...\fi % #1 = #2 ?
140 \FPifgt#1#2...\else...\fi % #1 > #2 ?
141 %unary relations
142 \FPifneg#1 ...\else...\fi % #1 < 0 ?
143 \FPifpos#1 ...\else...\fi % #1 >= 0 ?
144 \FPifzero#1...\else...\fi % #1 = 0 ?
145 \FPifint#1 ...\else...\fi % #1 is integer ?
146 %repeat last test
147 \ifFPtest ...\else...\fi % repeat last test
148 - fp-addons.sty
149 The following macros are public ones to be used in the document:
150 %binary operations
151 \FPmin#1#2#3 % #1 = min(#2,#3)
152 \FPmax#1#2#3 % #1 = max(#2,#3)
153 - fp-eqn.sty (No warranty on correctness and especially on numerical problems!)
154 The following macros are public ones to be used in the document:
155 \FPlsolve#1#2#3
156 % #1 := x with #2*x+#3=0
157 \FPqsolve#1#2#3#4#5
158 % #1,#2 := x with #3*x^2+#4*x+#5 = 0
159 \FPcsolve#1#2#3#4#5#6#7
160 % #1,#2,#3 := x with #4*x^3+#5*x^2+#6*x+#7 = 0
161 \FPqqsolve#1#2#3#4#5#6#7#8#9
162 % #1,#2,#3,#4 := x with #5*x^4+#6*x^3+#7*x^2+#8*x+#9 = 0
163 The resulting solutions are all real values. If there do not
164 exist as much solutions you get a warning message and some
165 other solutions occur several times in the solution vector.
166 - fp-exp.sty
167 The following macros are public ones to be used in the document:
168 \FPe % 2.718281828459045235
169 \FPexp#1#2 % #1 := e^(#2)
170 \FPln#1#2 % #1 := ln(#2)
171 \FPpow#1#2#3 % #1 := (#2)^(#3)
172 \FProot#1#2#3 % #1 := (#2)^(1/#3)
173 - fp-random.sty
174 The following macros are public ones to be used in the document:
175 \FPseed=#1 % set seed counter for random number generation
176 \FPrandom#1 % #1 := a random number between 0 and 1
177 - fp-pas.sty
178 The following macros are public ones to be used in the document:
179 \FPpascal#1#2 % #1 := #2-th line of the pascal triangle
180 - fp-snap.sty:
181 The following macros are public ones to be used in the document:
182 \FPround#1#2#3 % #1 := #2 rounded to #3 digits after '.'
183 \FPtrunc#1#2#3 % #1 := #2 truncated to #3 digits after '.'
184 \FPclip#1#2 % #1 := #2 with all unnecessary 0's removed
185 - fp-trigo.sty:
186 The following macros are public ones to be used in the document:
187 \FPpi % 3.141592653589793238
188 \FPsin#1#2 % #1 := sin(#2)
189 \FPcos#1#2 % #1 := cos(#2)
190 \FPsincos#1#2#3 % #1 := sin(#3), #2 := cos(#3)
191 \FPtan#1#2 % #1 := tan(#2)
192 \FPcot#1#2 % #1 := cot(#2)
193 \FPtancot#1#2#3 % #1 := tan(#3), #2 := cot(#3)
194 \FParcsin#1#2 % #1 := arcsin(#2)
195 \FParccos#1#2 % #1 := arccos(#2)
196 \FParcsincos#1#2#3 % #1 := arcsin(#3), #2 := arccos(#3)
197 \FParctan#1#2 % #1 := arctan(#2)
198 \FParccot#1#2 % #1 := arccot(#2)
199 \FParctancot#1#2#3 % #1 := arctan(#3), #2 := arccot(#3)
200 - fp-upn.sty:
201 The following macros are public ones to be used in the document:
202 \FPupn#1#2 % #1 := eval(#2) where eval evaluates the
203 upn-expression #2
204 Known operations are:
205 +,add,-,sub,*,mul,/,div,abs,neg,min,max,
206 round,trunc,clip,e,exp,ln,pow,root,pi,sin,cos,
207 sincos,tan,cot,tancot,arcsin,arccos,arcsincos,
208 arctan,arccot,arctancot,pop,swap,copy
209 where
210 pop removes the top element
211 swap exchanges the first two elements
212 copy copies the top element
213 Example 1:
214 The macro call
215 \FPupn\result{17 2.5 + 17.5 - 2 1 + * 2 swap /}
216 is equivalent to
217 \result := ((17.5 - (17 + 2.5)) * (2 + 1)) / 2
218 and evaluates to
219 \def\result{-3.000000000000000000}
220 Afterwards the macro call
221 \FPupn\result{\result{} -1 * 0.2 + sin 2 round}
222 ^^ the "{}" is necessary!
223 is equivalent to
224 \result := round_2(sin((\result * -1) + 0.2))
225 and evaluates to
226 \def\result{-0.06}
227 Example 2:
228 As "result" is an abbreviation of "\result{}" you may
229 write
230 \FPupn{result}{17 2.5 + 17.5 - 2 1 + * 2 swap /}
231 and
232 \FPupn{result}{result -1 * 0.2 + sin 2 round}
233 instead leading to the same results.
234 This is even true for other macro names using e.g. "x" for "\x{}"
235 and so on. But be careful with it. We may introduce new constants
236 in further versions overwriting these abbreviations.
237 - fp-eval.sty:
238 The following macros are public ones to be used in the document:
239 \FPeval#1#2 % #1 := eval(#2) where eval evaluates the
240 expression #2
241 ATTENTION: Do not use macro names with \. for its own
242 Use only the name or the macro surrounded by (, and ) instead,
243 i.e. do not write "\value{}" but "value" or "(\value)".
244 This is needed to avoid problems with a prefix "-" of numbers.
245 (I do not intend to write a more complex parsing routine in future.
246 But if you do so, just send it to me.
247 )
248 Known infix operations are
249 +, -, *, /, ^ for add, sub, mul, div, pow
250 Each other operation is a prefix one that needs
251 a (comma or colon seperated) list of subexpressions.
252 Exception: The unary prefix operation - is not known!
253 (Use the function neg instead.)
254 Example 1:
255 With
256 \edef\result{11}
257 and
258 \FPeval\result{round(root(2,sin(result + 2.5)):2)}
259 or
260 \FPeval{result}{round(root(2,sin(result + 2.5)):2)}
261 \result becomes the value 0.90
262 Example 2:
263 \FPeval\result{clip(2*3+5*6)} results to 36
264 \FPeval\result{clip(2*(3+5)*6)} results to 96