\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