diff options
author | Karl Berry <karl@freefriends.org> | 2006-07-05 23:46:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-07-05 23:46:50 +0000 |
commit | c019dd2804c957c3982731903682dc99178207e4 (patch) | |
tree | a10e115e97978170c8082bae0fc0b5a95846a68c /Master | |
parent | 1701810d2d2c62e39c9cb8dc3178f5aa1659c607 (diff) |
pst-func 0.45
git-svn-id: svn://tug.org/texlive/trunk@1780 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-func/Changes | 24 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-func/README | 12 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-func/pst-func-doc.bib (renamed from Master/texmf-dist/doc/generic/pst-func/pstricks.bib) | 12 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf | bin | 225912 -> 2083694 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex | 646 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pst-func/pst-func.pro | 221 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-func/pst-func.tex | 382 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-func/pst-func.sty | 3 | ||||
-rw-r--r-- | Master/texmf-dist/tpm/pst-func.tpm | 8 | ||||
-rw-r--r-- | Master/texmf/lists/pst-func | 2 |
10 files changed, 1175 insertions, 135 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-func/Changes b/Master/texmf-dist/doc/generic/pst-func/Changes index d74ea98c5e8..32a3c0e4b09 100644 --- a/Master/texmf-dist/doc/generic/pst-func/Changes +++ b/Master/texmf-dist/doc/generic/pst-func/Changes @@ -1,4 +1,20 @@ ..... pst-func.tex +0.45 2006-04-22 make polarplot and algebraic option work + added \psplotImp for plotting implicit + defined functions (experimental) + accept plotstyle curve for \psBinomialN + new option barwidth for \psBinomial + new macro \psBinomial and \psBinomialN +0.44 2006-01-16 new macros \psCumIntegral, \psIntegral + \psConv +0.43 2005-12-19 new macro psSi for the integral sin Si(x) + and si(x)=Si(x)-pi/2 + and Ci(x), the integral cosin +0.42 2005-12-09 new macro psGaussI for the integral of Gauss + use mue as option name instead of xShift (\psGauss} +0.41 2005-09-23 new macro pstPrintValue +0.40 2005-04-09 new option xShift instaed of x0 for psPolynomial and Gauss +0.39 2005-04-09 new option x0 for Gauss 0.38 2004-11-08 change the option Abbreviation to the right one Derivation 0.37 2004-11-08 changes pstricks object type from closed to open @@ -10,7 +26,15 @@ ..... pst-func.sty 2004-10-18 first version + 2006-04-22 add pst-func.pro to the filelist + ..... pst-func.pro +0.06 2006-04-16 new subroutine MoverN (binomial coefficient) +0.05 2005-12-19 new subroutine Si and si for the integral sin + new subroutine for the integral cosin + new subroutine factorial (recursive) +0.04 2005-12-05 new subroutine Simpson for the integral of Gaussian curve +0.03 2005-07-28 add the complex part 0.02 2004-11-08 change Abbreviation to the right name Derivation 0.01 2004-11-04 first version diff --git a/Master/texmf-dist/doc/generic/pst-func/README b/Master/texmf-dist/doc/generic/pst-func/README index 9d4d289a60f..0c204bf50f0 100644 --- a/Master/texmf-dist/doc/generic/pst-func/README +++ b/Master/texmf-dist/doc/generic/pst-func/README @@ -2,13 +2,13 @@ Save the files pst-func.sty|pro|tex in a directory, which is part of your local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/ Then do not forget to run texhash to update this tree. For more information see the documentation of your LATEX distribution -on installing packages into your LATEX distribution or the +on installing packages into your local TeX system or read the TeX Frequently Asked Questions: (http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages). -pst-func needs pst-plot and pstricks, which should be part of your -local TeX installation, otherwise get it from a CTAN server, f.ex. -ftp://ftp.ctan.org +pst-func needs pst-plot (pstricks-add) and pstricks, which should +be part of your local TeX installation, otherwise get it from a +CTAN server, f.ex. ftp://ftp.ctan.org -The documentation also needs pstricks-add, which is also available from -CTAN or any mirror. +PSTricks is PostScript Tricks, the documentation cannot be run +with pdftex, use the sequence latex->dvips->ps2pdf.
\ No newline at end of file diff --git a/Master/texmf-dist/doc/generic/pst-func/pstricks.bib b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.bib index 820a2401c7e..34f2b8aa705 100644 --- a/Master/texmf-dist/doc/generic/pst-func/pstricks.bib +++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.bib @@ -68,7 +68,8 @@ @Book{voss:chaos, author = {Herbert Vo{\ss}}, - title = {Chaos und {F}raktale selbst programmieren: von {M}andelbrotmengen {\"u}ber {F}arbmanipulationen zur perfekten Darstellung}, + title = {Chaos und {F}raktale selbst programmieren: von {M}andelbrotmengen + {\"u}ber {F}arbmanipulationen zur perfekten Darstellung}, publisher = {{Franzis Verlag}}, year = {1994}, address = {Poing} @@ -130,3 +131,12 @@ year = 1997 } +@Book{PSTricks2, + author = {Herbert Vo\ss}, + title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, + edition = {third}, + publisher = {DANTE -- Lehmanns}, + year = {2006}, + address = {Heidelberg/Hamburg} +} + diff --git a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf Binary files differindex 3e66c6bbad3..2ec213a7d03 100644 --- a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf +++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex index 70fd42cc000..4e3ed6c7a00 100644 --- a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex @@ -1,7 +1,7 @@ \documentclass[a4paper,12pt]{article} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} -\usepackage{geometry} +\usepackage{pamathx} \usepackage{url} \usepackage{amsmath} \usepackage{tabularx} @@ -9,25 +9,31 @@ \usepackage{pstricks} \usepackage{pst-func} \let\pstFuncFV\fileversion -\usepackage{pstricks-add} -\usepackage{pst-example} +\usepackage{pst-math} +\usepackage{pstricks-add}% for the alg parser +\usepackage{showexpl} +\lstset{pos=t,wide=true} % \usepackage{xspace} \def\PS{PostScript\xspace} +\def\CMD#1{{\ttfamily\textbackslash #1}} +\def\dt{\ensuremath{\,\mathrm{d}t}} % -\psset{xyLabel=\footnotesize} +\def\pshlabel{\footnotesize} +\def\psvlabel{\footnotesize} \usepackage[colorlinks,linktocpage]{hyperref} % \begin{document} -\title{\texttt{pst-func}\\plotting special mathematical functions\thanks{% - This document was written with \texttt{Kile: 1.6a (Qt: 3.1.1; KDE: 3.1.1;} - \protect\url{http://sourceforge.net/projects/kile/}) and the PDF output - was build with VTeX/Free (\protect\url{http://www.micropress-inc.com/linux})}\\ +\title{\texttt{pst-func}\\plotting special mathematical functions\\ \small v.\pstFuncFV} -\author{Herbert Voß\thanks{% +%\thanks{% +% This document was written with \texttt{Kile: 1.6a (Qt: 3.1.1; KDE: 3.1.1;} +% \protect\url{http://sourceforge.net/projects/kile/}) and the PDF output +% was build with VTeX/Free (\protect\url{http://www.micropress-inc.com/linux})}\\ +\author{Herbert Vo\ss\thanks{% %%JF %Thanks to: Attila Gati and to John Frampton. -Thanks to: Attila Gati, John Frampton and Lars Kotthoff. +Thanks to: Attila Gati, John Frampton and Lars Kotthoff, Jose-Emilio Vila-Forcen. }} \date{\today} @@ -37,7 +43,7 @@ Thanks to: Attila Gati, John Frampton and Lars Kotthoff. \clearpage -\section{\texttt{psPolynomial}} +\section{\CMD{psPolynomial}} The polynomial function is defined as \begin{align} f(x) &= a_0 + a_1x + a_2x^2 + a_3x^3 + \ldots +a_{n-1}x^{n-1} + a_nx^n\\ @@ -51,16 +57,72 @@ polynomial to calculate the function. The syntax is \psPolynomial[<options>]{xStart}{xEnd} \end{verbatim} +With the option \verb+xShift+ one can do a horizontal shift to the graph of the function. With another +than the predefined value the macro replaces $x$ by $x-x\mathrm{Shift}$; \verb+xShift=1+ +moves the graph of the polynomial function one unit to the right. + + +\begin{center} +\bgroup +\psset{yunit=0.5cm,xunit=1cm} +\begin{pspicture*}(-3,-5)(5,10) + \psaxes[Dy=2]{->}(0,0)(-3,-5)(5,10) + \psset{linewidth=1.5pt} + \psPolynomial[coeff=6 3 -1,linecolor=red]{-3}{5} + \psPolynomial[coeff=2 -1 -1 .5 -.1 .025,linecolor=blue]{-2}{4} + \psPolynomial[coeff=-2 1 -1 .5 .1 .025 .2 ,linecolor=magenta]{-2}{4} + \psPolynomial[coeff=-2 1 -1 .5 .1 .025 .2 ,linecolor=magenta,xShift=1,linestyle=dashed]{-2}{4} + \rput[lb](4,4){\textcolor{red}{$f(x)$}} + \rput[lb](4,8){\textcolor{blue}{$g(x)$}} + \rput[lb](2,4){\textcolor{magenta}{$h(x)$}} +\end{pspicture*} +\egroup +\end{center} + + +\begin{lstlisting} +\psset{yunit=0.5cm,xunit=1cm} +\begin{pspicture*}(-3,-5)(5,10) + \psaxes[Dy=2]{->}(0,0)(-3,-5)(5,10) + \psset{linewidth=1.5pt} + \psPolynomial[coeff=6 3 -1,linecolor=red]{-3}{5} + \psPolynomial[coeff=2 -1 -1 .5 -.1 .025,linecolor=blue]{-2}{4} + \psPolynomial[coeff=-2 1 -1 .5 .1 .025 .2 ,linecolor=magenta]{-2}{4} + \psPolynomial[coeff=-2 1 -1 .5 .1 .025 .2 ,linecolor=magenta,xShift=1,linestyle=dashed]{-2}{4} + \rput[lb](4,4){\textcolor{red}{$f(x)$}} + \rput[lb](4,8){\textcolor{blue}{$g(x)$}} + \rput[lb](2,4){\textcolor{magenta}{$h(x)$}} +\end{pspicture*} +\end{lstlisting} + + +The plot is easily clipped using the star version of the +\verb+pspicture+ environment, so that points whose coordinates +are outside of the desired range are not plotted. +The plotted polynomials are: +\begin{align} +f(x) & = 6 + 3x -x^2 \\ +g(x) & = 2 -x -x^2 +0.5x^3 -0.1x^4 +0.025x^5\\ +h(x) & = -2 +x -x^2 +0.5x^3 +0.1x^4 +0.025x^5+0.2x^6\\ +h^*(x) & = -2 +(x-1) -(x-1)^2 +0.5(x-1)^3 +\nonumber\\ + & \phantom{ = }+0.1(x-1)^4 +0.025(x-1)^5+0.2(x-1)^6 +\end{align} + + + + There are the following new options: \noindent\medskip -\begin{tabularx}{\linewidth}{>{\ttfamily}l|>{\ttfamily}l>{\ttfamily}lX@{}} +{\tabcolsep=2pt +\begin{tabularx}{\linewidth}{@{}>{\ttfamily}l>{\ttfamily}l>{\ttfamily}lX@{}} \textrm{Name} & \textrm{Value} & \textrm{Default}\\\hline coeff & a0 a1 a2 ... & 0 0 1 & The coefficients must have the order $a_0\ a_1\ a_2 \ldots$ and be separated by \textbf{spaces}. The number of coefficients is limited only by the memory of the computer ... The default value of the parameter \verb+coeff+ is \verb+0 0 1+, which gives the parabola $y=a_0+a_1x+a_2x^2=x^2$.\\ +xShift & <number> & 0 & $(x-xShift)$ for the horizontal shift of the polynomial\\ Derivation & <number> & 0 & the default is the function itself\\ markZeros & false|true & false & dotstyle can be changed\\ epsZero & <value> & 0.1 & The distance between two zeros, important for @@ -70,51 +132,31 @@ dZero & <value> & 0.1 & When searching for all zero values, the function i with this step\\ zeroLineTo & <number> & false & plots a line from the zero point to the value of the zeroLineTo's Derivation of the polynomial function\\ +\end{tabularx} +} + +\noindent +{\tabcolsep=2pt +\begin{tabularx}{\linewidth}{@{}>{\ttfamily}l>{\ttfamily}l>{\ttfamily}lX@{}} +\textrm{Name} & \textrm{Value} & \textrm{Default}\\\hline zeroLineStyle & <line style> & dashed & the style is one of the for PSTricks valid styles.\\ zeroLineColor & <color> & black & any valid xolor is possible\\ -zeroLineWidth & <width> & 0.5\textbackslash pslinewidth & \\ +zeroLineWidth & <width> & \rlap{0.5\textbackslash pslinewidth} & \\ \end{tabularx} - +} \bigskip The above parameter are only valid for the \verb+\psPolynomial+ -macro, but can also be set in the usual way with \verb+\psset+. - - - - -\begin{Beispiel} -{\psset{yunit=0.5cm,xunit=1cm} -\begin{pspicture*}(-3,-5)(5,10) - \psaxes[Dy=2]{->}(0,0)(-3,-5)(5,10) - \psset{linewidth=1.5pt} - \psPolynomial[coeff=6 3 -1,linecolor=red]{-3}{5} - \psPolynomial[coeff=2 -1 -1 .5 -.1 .025,linecolor=blue]{-2}{4} - \psPolynomial[coeff=-2 1 -1 .5 .1 .025 .2 ,linecolor=magenta]{-2}{4} - \rput[lb](4,4){\textcolor{red}{$f(x)$}} - \rput[lb](4,8){\textcolor{blue}{$g(x)$}} - \rput[lb](2,4){\textcolor{magenta}{$h(x)$}} -\end{pspicture*} -} -\end{Beispiel} - -The plot is easily clipped using the star version of the -\verb+pspicture+ environment, so that points whose coordinates -are outside of the desired range are not plotted. -The plotted polynomials are: -\begin{align} -f(x) & = 6 + 3x -x^2 \\ -g(x) & = 2 -x -x^2 +0.5x^3 -0.1x^4 +0.025x^5\\ -h(x) & = -2 +x -x^2 +0.5x^3 +0.1x^4 +0.025x^5+0.2x^6 -\end{align} +macro, except \verb+x0+, which can also be used for the Gauss function. All +options can be set in the usual way with \verb+\psset+. \bigskip -\begin{Beispiel} +\begin{LTXexample} \psset{yunit=0.5cm,xunit=2cm} \begin{pspicture*}(-3,-5)(3,10) \psaxes[Dy=2]{->}(0,0)(-3,-5)(3,10) @@ -128,10 +170,10 @@ h(x) & = -2 +x -x^2 +0.5x^3 +0.1x^4 +0.025x^5+0.2x^6 \rput[lb](1,1){\textcolor{red}{$h^{\prime}(x)$}} \rput[lb](-1,6){\textcolor{blue}{$h^{\prime\prime}(x)$}} \end{pspicture*} -\end{Beispiel} - +\end{LTXexample} +%$ -\begin{Beispiel} +\begin{LTXexample} \psset{yunit=0.5cm,xunit=2cm} \begin{pspicture*}(-3,-5)(3,10) \psaxes[Dy=2]{->}(0,0)(-3,-5)(3,10) @@ -142,13 +184,13 @@ h(x) & = -2 +x -x^2 +0.5x^3 +0.1x^4 +0.025x^5+0.2x^6 \psPolynomial[coeff=0 0 0 1,linecolor=cyan,% linestyle=dotted,Derivation=3]{-2}{4} \rput[lb](1.8,4){\textcolor{blue}{$f(x)=x^3$}} - \rput[lb](0.2,8){\textcolor{red}{$f^{\prime}(x)=6x$}} - \rput[lb](-2,5.5){\textcolor{magenta}{$f^{\prime\prime}(x)=6$}} + \rput[lb](0.2,8){\textcolor{red}{$f^{\prime\prime}(x)=6x$}} + \rput[lb](-2,5.5){\textcolor{magenta}{$f^{\prime\prime\prime}(x)=6$}} \end{pspicture*} -\end{Beispiel} - +\end{LTXexample} +%$ -\begin{Beispiel} +\begin{LTXexample} \begin{pspicture*}(-5,-5)(5,5) \psaxes{->}(0,0)(-5,-5)(5,5)% \psset{dotscale=2} @@ -160,9 +202,9 @@ h(x) & = -2 +x -x^2 +0.5x^3 +0.1x^4 +0.025x^5+0.2x^6 \psPolynomial[markZeros,linecolor=magenta,linewidth=1pt,linestyle=dotted,% coeff=-1 1 -1 0 0.15,Derivation=2,zeroLineTo=1]{-4}{3}% \end{pspicture*} -\end{Beispiel} +\end{LTXexample} -\begin{Beispiel} +\begin{LTXexample} \psset{xunit=1.5} \begin{pspicture*}(-5,-5)(5,5) \psaxes{->}(0,0)(-5,-5)(5,5)% @@ -175,11 +217,11 @@ h(x) & = -2 +x -x^2 +0.5x^3 +0.1x^4 +0.025x^5+0.2x^6 \psPolynomial[markZeros,linecolor=magenta,linewidth=1pt,linestyle=dotted,% coeff=-1 1 -1 0 0.15,Derivation=2,zeroLineTo=1]{-4}{3}% \end{pspicture*} -\end{Beispiel} +\end{LTXexample} - -\section{\texttt{psFourier}} +\clearpage +\section{\CMD{psFourier}} A Fourier sum has the form: \begin{align} @@ -206,7 +248,7 @@ which gives the standard \verb+sin+ function. Note that %the constant value can only be set with \verb+cosCoeff=<a0>+. the constant value can only be set with \verb+cosCoeff=a0+. -\begin{Beispiel} +\begin{LTXexample} \begin{pspicture}(-5,-3)(5,5.5) \psaxes{->}(0,0)(-5,-2)(5,4.5) \psset{plotpoints=500,linewidth=1pt} @@ -214,9 +256,9 @@ the constant value can only be set with \verb+cosCoeff=a0+. \psFourier[cosCoeff=0 0 2, linecolor=magenta]{-4.5}{4.5} \psFourier[cosCoeff=2 0 2, linecolor=red]{-4.5}{4.5} \end{pspicture} -\end{Beispiel} +\end{LTXexample} -\begin{Beispiel} +\begin{LTXexample} \psset{yunit=0.75} \begin{pspicture}(-5,-6)(5,7) \psaxes{->}(0,0)(-5,-6)(5,7) @@ -225,27 +267,28 @@ the constant value can only be set with \verb+cosCoeff=a0+. \psFourier[sinCoeff= -1 1 -1 1 -1 1 -1 1,% linecolor=blue,linewidth=1.5pt]{-4.5}{4.5} \end{pspicture} -\end{Beispiel} +\end{LTXexample} -\begin{Beispiel} +\begin{LTXexample} \begin{pspicture}(-5,-5)(5,5.5) \psaxes{->}(0,0)(-5,-5)(5,5) \psset{plotpoints=500,linewidth=1.5pt} -\psFourier[sinCoeff=-.5 1 1 1 1 ,sinCoeff=-.5 1 1 1 1 1,% +\psFourier[sinCoeff=-.5 1 1 1 1 ,cosCoeff=-.5 1 1 1 1 1,% linecolor=blue]{-4.5}{4.5} \end{pspicture} -\end{Beispiel} +\end{LTXexample} -\section{\texttt{psBessel}} -The Bessel function of order $n$ is defined as
+\clearpage +\section{\CMD{psBessel}} +The Bessel function of order $n$ is defined as \begin{align} -J_n(x) &=\frac{1}{\pi}\int_0^\pi\cos(x\sin t-nt)\mathrm{d}t\\ +J_n(x) &=\frac{1}{\pi}\int_0^\pi\cos(x\sin t-nt)\dt\\ &=\sum_{k=0}^{\infty}\frac{(-1)^k \left(\frac{x}{2}\right)^{n+2k}}{k!\Gamma(n+k+1)} \end{align} \noindent The syntax of the macro is \begin{verbatim} -\psBessel[options]{order}{xStart}{xEnd}
+\psBessel[options]{order}{xStart}{xEnd} \end{verbatim} There are two special parameters for the Bessel function, and also the @@ -283,14 +326,14 @@ In particular, note that the default for time consuming at this setting, it can be decreased in the usual way, at the cost of some reduction in graphics resolution. -\begin{Beispiel} +\begin{LTXexample} { \psset{xunit=0.25,yunit=5} \begin{pspicture}(-13,-.85)(13,1.25) \rput(13,0.8){% - $\displaystyle J_n(x)=\frac{1}{\pi}\int_0^\pi\cos(x\sin t-nt)\mathrm{d}t$% + $\displaystyle J_n(x)=\frac{1}{\pi}\int_0^\pi\cos(x\sin t-nt)\dt$% } -\psaxes[Dy=0.2,Dx=4,xyLabel=\footnotesize]{->}(0,0)(-30,-.8)(30,1.2) +\psaxes[Dy=0.2,Dx=4]{->}(0,0)(-30,-.8)(30,1.2) \psset{linewidth=1pt} \psBessel[linecolor=red]{0}{-28}{28}% \psBessel[linecolor=blue]{1}{-28}{28}% @@ -298,33 +341,34 @@ way, at the cost of some reduction in graphics resolution. \psBessel[linecolor=magenta]{3}{-28}{28}% \end{pspicture} } -\end{Beispiel} +\end{LTXexample} -\begin{Beispiel} +\begin{LTXexample} { \psset{xunit=0.25,yunit=2.5} -\begin{pspicture}(-13,-.85)(13,2) +\begin{pspicture}(-13,-1.5)(13,3) \rput(13,0.8){% $\displaystyle f(t) = 2.3 \cdot J_0 + 1.2\cdot \sin t + 0.37$% } -\psaxes[Dy=0.2,Dx=4,xyLabel=\footnotesize]{->}(0,0)(-30,-.8)(30,1.2) +\psaxes[Dy=0.8,dy=2cm,Dx=4]{->}(0,0)(-30,-1.5)(30,3) \psset{linewidth=1pt} \psBessel[linecolor=red,constI=2.3,constII={t k sin 1.2 mul 0.37 add}]{0}{-28}{28}% \end{pspicture} } -\end{Beispiel} +\end{LTXexample} - -\section{\texttt{psGauss}} -The Gauss function is defined as +\clearpage +\section{\CMD{psGauss} and \CMD{psGaussI}} +The Gauss function is defined as \begin{align} -f(x) &= \dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{x^2}{2\sigma{}^2}} +f(x) &= \dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{\left(x-\mu\right)^2}{2\sigma{}^2}} \end{align} -\noindent The syntax of the macro is +\noindent The syntax of the macros is \begin{verbatim} \psGauss[options]{xStart}{xEnd} +\psGaussI[options]{xStart}{xEnd} \end{verbatim} %%JF @@ -334,33 +378,453 @@ f(x) &= \dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{x^2}{2\sigma{}^2}} %\noindent where the only new parameter is \verb+sigma=<value>+, with %the default of \verb+0.5+ and can also be set in the usual way with %\verb+\psset+. It is only valid for the \verb+psGauss+-macro. -\noindent where the only new parameter is \verb+sigma=<value>+, +\noindent where the only new parameter are \verb+sigma=<value>+ and \verb+mue=<value>+ for the +horizontal shift, which can also be set in the usual way with \verb+\psset+. It is -significant only for the \verb+psGauss+-macro. The default is -\verb+0.5+. +significant only for the \verb+psGauss+- and \verb+\psGaussI+-macro. The default is +\verb+sigma=0.5+ and \verb+mue=0+. The integral is caclulated wuth the Simson algorithm +and has one special option, called \verb+Simpson+, which defines the number of intervalls per step +and is predefined with 5. -\begin{Beispiel} +\bgroup \psset{yunit=4cm,xunit=3} -\begin{pspicture}(-2,0)(2,1) +\begin{pspicture}(-2,-0.2)(2,1.4) % \psgrid[griddots=10,gridlabels=0pt, subgriddiv=0] - \psaxes[xyLabel=\footnotesize,Dy=0.25]{->}(0,0)(-2,0)(2,1) + \psaxes[Dy=0.25]{->}(0,0)(-2,0)(2,1.25) \uput[-90](6,0){x}\uput[0](0,1){y} \rput[lb](1,0.75){\textcolor{red}{$\sigma =0.5$}} \rput[lb](1,0.5){\textcolor{blue}{$\sigma =1$}} - \rput[lb](-2,0.5){$f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{x^2}{2\sigma{}^2}}$} + \rput[lb](-2,0.5){$f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{(x-\mu)^2}{2\sigma{}^2}}$} \psGauss[linecolor=red, linewidth=2pt]{-1.75}{1.75}% + \psGaussI[linewidth=1pt,yunit=0.75]{-2}{2}% + \psGauss[linecolor=cyan, mue=0.5, linewidth=2pt]{-1.75}{1.75}% \psGauss[sigma=1, linecolor=blue, linewidth=2pt]{-1.75}{1.75} \end{pspicture} -\end{Beispiel} +\egroup + + +\begin{lstlisting}[xrightmargin=-1cm] +\psset{yunit=4cm,xunit=3} +\begin{pspicture}(-2,-0.5)(2,1.25) +% \psgrid[griddots=10,gridlabels=0pt, subgriddiv=0] + \psaxes[Dy=0.25]{->}(0,0)(-2,0)(2,1.25) + \uput[-90](6,0){x}\uput[0](0,1){y} + \rput[lb](1,0.75){\textcolor{red}{$\sigma =0.5$}} + \rput[lb](1,0.5){\textcolor{blue}{$\sigma =1$}} + \rput[lb](-2,0.5){$f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{(x-x_0)^2}{2\sigma{}^2}}$} + \psGauss[linecolor=red, linewidth=2pt]{-1.75}{1.75}% + \psGaussI[linewidth=1pt,yunit=0.75cm]{-2}{2}% + \psGauss[linecolor=cyan, mue=0.5, linewidth=2pt]{-1.75}{1.75}% + \psGauss[sigma=1, linecolor=blue, linewidth=2pt]{-1.75}{1.75} +\end{pspicture} +\end{lstlisting} + + +\clearpage +\section{\CMD{psSi}, \CMD{pssi} and \CMD{psCi}} +The integral sin and cosin are defined as +\begin{align} +\mathrm{Si}(x) &= \int_0^x\dfrac{\sin t}{t}\dt\\ +\mathrm{si}(x) &= - \int_x^{\infty}\dfrac{\sin t}{t}\dt=\mathrm{Si}(x)-\frac{\pi}{2}\\ +\mathrm{Ci}(x) &= -\int_x^{\infty}\dfrac{\cos t}{t}\dt=\gamma+\ln x +\int_0^{x}\dfrac{\cos t -1}{t}\dt +\end{align} +% +\noindent The syntax of the macros is +\begin{verbatim} +\psSi[options]{xStart}{xEnd} +\pssi[options]{xStart}{xEnd} +\psCi[options]{xStart}{xEnd} +\end{verbatim} + + +\begin{LTXexample}[pos=t] +\def\pshlabel#1{\footnotesize#1} \def\psvlabel#1{\footnotesize#1} +\psset{xunit=0.5} +\begin{pspicture}(-15,-4.5)(15,2) + \psaxes[dx=1cm,Dx=2]{->}(0,0)(-15.1,-4)(15,2) + \psplot[plotpoints=1000]{-14.5}{14.5}{ x RadtoDeg sin x div } + \psSi[plotpoints=1500,linecolor=red,linewidth=1pt]{-14.5}{14.5} + \pssi[plotpoints=1500,linecolor=blue,linewidth=1pt]{-14.5}{14.5} + \rput(-5,1.5){\color{red}$Si(x)=\int\limits_{0}^x \frac{\sin(t)}{t}\dt$} + \rput(8,-1.5){\color{blue}$si(x)=-\int\limits_{x}^{\infty} \frac{\sin(t)}{t}\dt=Si(x)-\frac{\pi}{2}$} + \rput(8,.5){$f(x)= \frac{\sin(t)}{t}$} +\end{pspicture} +\end{LTXexample} + + + +\begin{LTXexample}[pos=t] +\def\pshlabel#1{\footnotesize#1} \def\psvlabel#1{\footnotesize#1} +\psset{xunit=0.5} +\begin{pspicture*}(-15,-4.2)(15,4.2) + \psaxes[dx=1cm,Dx=2]{->}(0,0)(-15.1,-4)(15,4) + \psplot[plotpoints=1000]{-14.5}{14.5}{ x RadtoDeg cos x Div } + \psCi[plotpoints=500,linecolor=red,linewidth=1pt]{-11.5}{11.5} + \psci[plotpoints=500,linecolor=blue,linewidth=1pt]{-11.5}{11.5} + \rput(-8,1.5){\color{red}$Ci(x)=-\int\limits_{x}^{\infty} \frac{\cos(t)}{t}\dt$} + \rput(8,1.5){\color{blue}$ci(x)=-Ci(x)+\ln(x)+\gamma$} +\end{pspicture*} +\end{LTXexample} + + +\clearpage +\section{\CMD{psIntegral}, \CMD{psCumIntegral} and \CMD{psConv}} +These new macros\footnote{Created by Jose-Emilio Vila-Forcen} +allows to plot the result of an integral using the Simpson numerical integration rule. +The first one is the result of the integral of a function with two variables, and +the integral is performed over one of them. The second one is the cumulative +integral of a function (similar to \verb+\psGaussI+ but valid for all functions). The third +one is the result of a convolution. They are defined as: +\begin{align} +\text{psIntegral}(x) &= \int_a^b f(x,t)dt \\ +\text{psCumIntegral}(x) &= \int_{\text{xStart}}^{x} f(t)dt \\ +\text{psConv}(x) & = \int_a^b f(t)g(x-t)dt +\end{align} +In the first one, the integral is performed from $a$ to $b$ and the function $f$ depends +on two parameters. In the second one, the function $f$ depends on only one parameter, and the +integral is performed from the minimum value specified for $x$ (\verb|xStart|) and the current +value of $x$ in the plot. The third one uses the \CMD{psIntegral} macro to perform an approximation +to the convolution, where the integration is performed from $a$ to $b$. + +The syntax of these macros is: +\begin{verbatim} +\psIntegral[<options>]{xStart}{xEnd}(a,b){ function } +\psCumIngegral[<options>]{xStart}{xEnd}{ function } +\psConv[<options>]{xStart}{xEnd}(a,b){ function f }{ function g } +\end{verbatim} + +In the first macro, the function should be created such that it accepts two values: \verb|<x t function>| +should be a value. For the second and the third functions, they only need to accept one +parameter: \verb|<x function>| should be a value. + +There are no new parameters for these functions. The two most important ones are \verb-plotpoints-, +which controls the number of points of the plot (number of divisions on $x$ for the plot) and +\verb-Simpson-, which controls the precision of the integration (a larger number means a smallest +step). The precision and the smoothness of the plot depend strongly on these two parameters. + +\bigskip +\begin{LTXexample} +%\usepackage{pst-math} +\psset{xunit=0.5cm,yunit=2cm} +\begin{pspicture}[linewidth=1pt](-10,-.5)(10,2) + \psaxes[dx=1cm,Dx=2]{->}(0,0)(-10,0)(10,2) + \psCumIntegral[plotpoints=200,Simpson=10]{-10}{10}{0 1 GAUSS} + \psIntegral[plotpoints=200,Simpson=10,linecolor=red]{-10}{10}(-4,6){1 GAUSS} + \psIntegral[plotpoints=200,Simpson=100,linecolor=green]{.1}{10}(-3,3){0 exch GAUSS} +\end{pspicture} +\end{LTXexample} + +In the example, the cumulative integral of a Gaussian is presented in black. In red, a +Gaussian is varying its mean from -10 to 10, and the result is the integral from -4 to 6. +Finally, in green it is presented the integral of a Gaussian from -3 to 3, where the +variance is varying from .1 to 10. + +\begin{LTXexample} +\psset{xunit=1cm,yunit=4cm} +\begin{pspicture}[linewidth=1pt](-5,-.2)(5,1.1) + \psaxes[dx=1cm,Dx=1,Dy=0.5]{->}(0,0)(-5,0)(5,1.1) + \psplot[linecolor=blue,plotpoints=200]{-5}{5}{x abs 2 le {0.25}{0} ifelse} + \psplot[linecolor=green,plotpoints=200]{-5}{5}{x abs 1 le {.5}{0} ifelse} + \psConv[plotpoints=100,Simpson=1000,linecolor=red]{-5}{5}(-10,10)% + {abs 2 le {0.25}{0} ifelse}{abs 1 le {.5} {0} ifelse} +\end{pspicture} +\end{LTXexample} + +In the second example, a convolution is performed using two rectangle functions. +The result (in red) is a trapezoid function. + +\clearpage + +\section{\CMD{psBinomial} and \CMD{psBinomialN}} + +These two macros plot binomial distribution, \CMD{psBinomialN} the normalized one. It is always +done in the $x$-Intervall $[0;1]$. +Rescaling to another one can be done by setting the \verb+xunit+ option +to any other value. + +The binomial distribution gives the discrete probability distribution $P_p(n|N)$ of obtaining +exactly $n$ successes out of $N$ Bernoulli trials (where the result of each +Bernoulli trial is true with probability $p$ and false with probability +$q=1-p$. The binomial distribution is therefore given by + +\begin{align} +P_p(n|N) &= \binom{N}{n}p^nq^{N-n} \\ + &= \frac{N!}{n!(N-n)!}p^n(1-p)^{N-n}, +\end{align} +where $(N; n)$ is a binomial coefficient and $P$ the probability. + +The syntax is quite easy: +\begin{verbatim} +\psBinomial[<options>]{N}{probability p} +\psBinomialN[<options>]{N}{probability p} +\end{verbatim} + +There is a restriction in using the value for N. It depends to the probability, but in general +one should expect problems with $N>100$. PostScript cannot handle such small values and there will +be no graph printed. This happens on PostScript side, so \TeX\ doesn't report any problem in +the log file. The valid options for the macros are \verb+markZeros+ to draw rectangles instead +of a continous line and \verb+printValue+ for printing the $y$-values on top of the lines, +rotated by 90\textdegree. For this option all other options from section~\ref{sec:printValue} +for the macro \verb+\psPrintValue+ are valid, too. The only special option is \verb+barwidth+, +which is a factor (no dimension) and set by default to 1. This option is only valid for +the macro \CMD{psBinomial} and not for the normalized one! + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1cm,yunit=5cm}% +\begin{pspicture}(-1,-0.15)(7,0.55)% +\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-1,0)(7,0.5) +\uput[-90](7,0){$k$} \uput[90](0,0.5){$P(X=k)$} +\psBinomial[markZeros,printValue,fillstyle=vlines]{6}{0.4} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1cm,yunit=10cm}% +\begin{pspicture}(-1,-0.1)(8,0.6)% +\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-1,0)(8,0.5) +\uput[-90](8,0){$k$} \uput[90](0,0.5){$P(X=k)$} +\psBinomial[linecolor=red,markZeros,printValue,fillstyle=solid, + fillcolor=blue,barwidth=0.2]{7}{0.6} +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=0.25cm,yunit=10cm} +\begin{pspicture*}(-1,-0.1)(61,0.52) +\psaxes[Dx=5,dx=5\psxunit,Dy=0.2,dy=0.2\psyunit]{->}(60,0.5) +\uput[-90](60,0){$k$} \uput[0](0,0.5){$P(X=k)$} +\psBinomial[markZeros,linecolor=red]{4}{.5} +\psset{linewidth=1pt} +\psBinomial[linecolor=green]{5}{.5} +\psBinomial[linecolor=blue]{10}{.5} +\psBinomial[linecolor=red]{20}{.5} +\psBinomial[linecolor=magenta]{50}{.5} +\psBinomial[linecolor=cyan]{75}{.5} +\end{pspicture*} +\end{LTXexample} + +The default binomial distribution has the mean of $\mu=E(X)=N\cdot p$ and a variant of $\sigma^2=\mu\cdot(1-p)$. +The normalized distribution has a mean of $0$. Instead of $P(X=k)$ we use $P(Z=z)$ with $Z=\dfrac{X-E(X)}{\sigma(X)}$ +and $P\leftarrow P\cdot\sigma$. +The macros use the rekursive definition of the binomial distribution: +% +\begin{align} +P(k) &= P(k-1)\cdot\frac{N-k+1}{k}\cdot\frac{p}{1-p} +\end{align} + + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1cm,yunit=5cm}% +\begin{pspicture}(-3,-0.15)(4,0.55)% +\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-3,0)(4,0.5) +\uput[-90](4,0){$z$} \uput[0](0,0.5){$P(Z=z)$} +\psBinomialN[markZeros,fillstyle=vlines]{6}{0.4} +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{yunit=10} +\begin{pspicture*}(-8,-0.07)(8.1,0.55) +\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-8,0)(8,0.5) +\uput[-90](8,0){$z$} \uput[0](0,0.5){$P(Z=z)$} +\psBinomialN{125}{.5} +\psBinomialN[markZeros,linewidth=1pt,linecolor=red]{4}{.5} +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{yunit=10} +\begin{pspicture*}(-8,-0.07)(8.1,0.52) +\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-8,0)(8,0.5) +\uput[-90](8,0){$z$} \uput[0](0,0.5){$P(Z=z)$} +\psBinomialN[markZeros,linecolor=red]{4}{.5} +\psset{linewidth=1pt} +\psBinomialN[linecolor=green]{5}{.5}\psBinomialN[linecolor=blue]{10}{.5} +\psBinomialN[linecolor=red]{20}{.5} \psBinomialN[linecolor=gray]{50}{.5} +\end{pspicture*} +\end{LTXexample} + +For the normalized distribution the plotstyle can be set to \verb+curve+ (\verb+plotstyle=curve+), +then the binomial distribution looks like a normal distribution. This option is only +valid vor \CMD{psBinomialN}. The option \verb+showpoints+ is valid if \verb+curve+ was chosen. + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1cm,yunit=10cm}% +\begin{pspicture*}(-4,-0.06)(4.1,0.57)% +\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-4,0)(4,0.5)% +\uput[-90](4,0){$z$} \uput[90](0,0.5){$P(Z=z)$}% +\psBinomialN[linecolor=red,fillstyle=vlines,showpoints=true,markZeros]{36}{0.5}% +\psBinomialN[linecolor=blue,showpoints=true,plotstyle=curve]{36}{0.5}% +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[pos=t,preset=\centering] +\psset{xunit=1cm,yunit=10cm}% +\begin{pspicture*}(-4,-0.06)(4.2,0.57)% +\psaxes[Dy=0.2,dy=0.2\psyunit]{->}(0,0)(-4,0)(4,0.5)% +\uput[-90](4,0){$z$} \uput[90](0,0.5){$P(Z=z)$}% +\psBinomialN[linecolor=red]{10}{0.6}% +\psBinomialN[linecolor=blue,showpoints=true,plotstyle=curve]{10}{0.6}% +\end{pspicture*} +\end{LTXexample} + + +\clearpage +\section{\CMD{psplotImp} -- plotting implicit defined functions} +This macro is still experimental! For a given area, the macro calculates in a +first step row by row for every pixel (1pt) the function $f(x,y)$ and checks for an +changing of the value from $f(x,y)<0$ to $f(x,y)>0$ or vice versa. If this happens, +then the pixel must be a part of the curve of the function $f(x,y)=0$. In a second step the same is +done column by column. This will take some time because an area of $400\times 300$ +pixel needs $120$ thousand calculations of the function value. The user still defines +this area in his own coordinates, the translation into pixel (pt) is done internally by the +macro. + +\begin{verbatim} +\psplotImp[<options>](xMin,yMin)(xMax,yMax){<function f(x,y)>} +\end{verbatim} + +The function must be of $f(x,y)=0$ and described in PostScript code, or alternatively with +the option \verb+algebraic+ (\verb+pstricks-add+) in an algebraic form. No other value names than $x$ and $y$ +are possible. In general a starred \verb+pspicture+ environment maybe a good choice here. +The given area for \verb+\psplotImp+ should be \textbf{greater} than the given \verb+pspicture+ area. + +\begin{LTXexample}[preset=\centering] +\begin{pspicture*}(-3,-3.2)(3.5,3.5) +\psaxes{->}(0,0)(-3,-3)(3.2,3)% +\psplotImp[linewidth=2pt,linecolor=red](-5,-2.1)(5,2.1){% + x dup mul y dup mul add 4 sub }% circle r=2 +\uput[45](0,2){$x^2+y^2-4=0$} +\psplotImp[linewidth=2pt,linecolor=blue,algebraic]% + (-5,-3)(4,2.4){ (x+1)^2+y^2-4 }% circle r=2 +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[preset=\centering] +\begin{pspicture*}(-3,-2.2)(3.5,2.5) +\psaxes{->}(0,0)(-3,-2)(3.2,2)% +\psplotImp[linewidth=2pt,linecolor=blue](-5,-2.2)(5,2.4){% + /xqu x dup mul def + /yqu y dup mul def + xqu yqu add dup mul 2 dup add 2 mul xqu yqu sub mul sub } +\uput*[0](-3,2){$\left(x^2+y^2\right)^2-8(x^2-y^2)=0$} +\psplotImp[linewidth=1pt,linecolor=red,algebraic](-5,-2.2)(5,2.4){% Lemniskate a =2 + (x^2+y^2)^2-4*(x^2-y^2) } +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[preset=\centering] +\begin{pspicture*}(-3,-3.2)(3.5,3.5) +\psaxes{->}(0,0)(-3,-3)(3.2,3)% +\psplotImp[linewidth=2pt,linecolor=green](-6,-6)(4,2.4){% + x 3 exp y 3 exp add 4 x y mul mul sub } +\uput*[45](-2.5,2){$\left(x^3+y^3\right)-4xy=0$} +\end{pspicture*} +\end{LTXexample} + + +\begin{LTXexample}[preset=\centering] +\begin{pspicture*}(-5,-3.2)(5.5,4.5) +\psaxes{->}(0,0)(-5,-3)(5.2,4)% +\psplotImp[algebraic,linecolor=red](-6,-4)(5,4){ y*cos(x*y)-0.2 } +\psplotImp[algebraic,linecolor=blue](-6,-4)(5,4){ y*cos(x*y)-1.2 } +\end{pspicture*} +\end{LTXexample} + + + +Using the \verb+polarplot+ option implies using the variables $r$ and $phi$ for describing +the function, $y$ and $x$ are not respected in this case. Using the \verb+algebraic+ option +for polar plots are also possible (see next example). + +\begin{LTXexample}[preset=\centering] +\begin{pspicture*}(-3,-2.5)(3.75,2.75)\psaxes{->}(0,0)(-3,-2.5)(3.2,2.5)% +\psplotImp[linewidth=2pt,linecolor=cyan,polarplot](-6,-3)(4,2.4){ r 2 sub }% circle r=2 +\uput*[45](0.25,2){$f(r,\phi)=r-2=0$} +\psplotImp[polarplot,algebraic](-6,-3)(4,2.4){ r-1 }% circle r=1 +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[preset=\centering] +\begin{pspicture*}(-5,-2.2)(5.5,3.5) +\pscircle(0,0){1}% +\psaxes{->}(0,0)(-5,-2)(5.2,3)% +\multido{\rA=0.01+0.2}{5}{% +\psplotImp[linewidth=1pt,linecolor=blue,polarplot](-6,-6)(5,2.4){% + r dup mul 1.0 r div sub phi sin dup mul mul \rA\space sub }}% +\uput*[45](0,2){$f(r,\phi)=\left(r^2-\frac{1}{r}\right)\cdot\sin^2\phi=0$} +\end{pspicture*} +\end{LTXexample} + +\begin{LTXexample}[preset=\centering] +\begin{pspicture*}(-4,-3.2)(4.5,4.5) +\psaxes{->}(0,0)(-4,-3)(4.2,4)% +\psplotImp[algebraic,polarplot,linecolor=red](-5,-4)(5,4){ r+cos(phi/r)-2 } +\end{pspicture*} +\end{LTXexample} + +\clearpage + +\section{\CMD{psPrintValue}}\label{sec:printValue} +This new macro allows to print single values of a math function. It has the syntax +\begin{verbatim} +\psPrintValue[<options>]{<PostScript code>} +\end{verbatim} + +Important is the fact, that \CMD{psPrintValue} works on \PS\ side. For \TeX\ it is only a box of +zero dimension. This is the reason why you have to put it into a box, which reserves horizontal +space. + +There are the following new options: + +\noindent\medskip +\begin{tabularx}{\linewidth}{>{\ttfamily}l|>{\ttfamily}l>{\ttfamily}lX@{}} +\textrm{Name} & \textrm{Value} & \textrm{Default}\\\hline +PSfont & PS font name & Times & only valid \PS font names are possible, e.g. \texttt{Times-Roman}, \texttt{Helvetica}, \texttt{Courier}, \texttt{AvantGard}, \texttt{Bookman}\\ +fontscale & <number> & 10 & the font scale in pt\\ +valuewidth & <number> & 10 & the width of the string for the converted + real number; if it is too small, no value is printed\\ +\end{tabularx} + +\begin{center} +\psset{fontscale=12} +\makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[5em]{$\cos x$} +\makebox[5em]{$\sqrt x$}\makebox[7em]{$\sin x+\cos x$}\makebox[6em]{$\sin^2 x+\cos^2 x$}\\[3pt] +\multido{\iA=0+10}{18}{ + \makebox[1em]{\iA} + \makebox[5em]{\psPrintValue[PSfont=Helvetica]{\iA\space sin}} + \makebox[5em]{\psPrintValue[PSfont=Courier,fontscale=10]{\iA\space cos}} + \makebox[5em]{\psPrintValue[valuewidth=15,linecolor=blue,PSfont=AvantGarde]{\iA\space sqrt}} + \makebox[7em]{\psPrintValue[PSfont=Times-Italic]{\iA\space dup sin exch cos add}} + \makebox[6em]{\psPrintValue[PSfont=Palatino-Roman]{\iA\space dup sin dup mul exch cos dup mul add}}\\} +\end{center} + +\bigskip + +\begin{lstlisting} +\psset{fontscale=12} +\makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[5em]{$\cos x$} +\makebox[5em]{$\sqrt x$}\makebox[7em]{$\sin x+\cos x$}\makebox[6em]{$\sin^2 x+\cos^2 x$}\\[3pt] +\multido{\iA=0+10}{18}{ + \makebox[1em]{\iA} + \makebox[5em]{\psPrintValue[PSfont=Helvetica]{\iA\space sin}} + \makebox[5em]{\psPrintValue[PSfont=Courier,fontscale=10]{\iA\space cos}} + \makebox[5em]{\psPrintValue[valuewidth=15,linecolor=blue,PSfont=AvantGarde]{\iA\space sqrt}} + \makebox[7em]{\psPrintValue[PSfont=Times-Italic]{\iA\space dup sin exch cos add}} + \makebox[6em]{\psPrintValue[PSfont=Palatino-Roman]{\iA\space dup sin dup mul exch cos dup mul add}}\\} +\end{lstlisting} + \section{Credits} -Denis Girou | Manuel Luque | Timothy Van Zandt +Denis Girou | Manuel Luque | Timothy Van Zandt \nocite{*} \bibliographystyle{plain} -\bibliography{pstricks} +\bibliography{pst-func-doc} \end{document} diff --git a/Master/texmf-dist/dvips/pst-func/pst-func.pro b/Master/texmf-dist/dvips/pst-func/pst-func.pro index 580e702c837..56b43d8c605 100644 --- a/Master/texmf-dist/dvips/pst-func/pst-func.pro +++ b/Master/texmf-dist/dvips/pst-func/pst-func.pro @@ -3,9 +3,9 @@ %% %% IMPORTANT NOTICE: %% -%% Package `pst-func.tex' +%% Package `pst-func' %% -%% Herbert Voss <voss _at_ perce.de> +%% Herbert Voss <voss _at_ pstricks.de> %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -15,13 +15,70 @@ %% `pst-func' is a PSTricks package to plot special math functions %% %% -%% version 0.02 / 2004-11-08 Herbert Voss <voss _at_ pstricks.de> +%% version 0.06 / 2006-04-16 Herbert Voss <voss _at_ pstricks.de> % -/tx@FuncDict 40 dict def +/tx@FuncDict 100 dict def tx@FuncDict begin % /eps1 1.0e-05 def /eps2 1.0e-04 def +/eps8 1.0e-08 def +/Pi2 1.57079632679489661925640 def +/CEuler 0.5772156649 def % Euler-Mascheroni constant +% +/factorial { % n on stack, returns n! + dup 0 eq { 1 }{ + dup 1 gt { dup 1 sub factorial mul } if } + ifelse } def +% +/MoverN { % m n on stack, returns the binomial coefficient m over n + /n exch def /m exch def + n 0 eq { 1 }{ + m n eq { 1 }{ + m factorial n factorial m n sub factorial mul div } ifelse } ifelse +} def +% +/Si { % integral sin from 0 to x (arg on stack) + /arg exch def + /Sum arg def + /sign -1 def + /index 3 def + { + arg index exp index div index factorial div sign mul + dup abs eps8 lt { pop exit } if + Sum add /Sum exch def + /sign sign neg def + /index index 2 add def + } loop + Sum +} def +/si { % integral sin from x to infty -> si(x)=Si(x)-pi/2 + Si Pi2 sub +} def +/Ci { % integral cosin from x to infty (arg on stack) + abs /arg exch def + arg 0 eq { 0 } { + /argExp 1 def + /fact 1 def + /Sum CEuler arg ln add def + /sign -1 def + /index 2 def + { + /argExp argExp arg arg mul mul def + /fact fact index 1 sub index mul mul def + argExp index div fact div sign mul + dup abs exch Sum add /Sum exch def + eps8 lt { exit } if + /sign sign neg def + /index index 2 add def + } loop + Sum + } ifelse +} def +/ci { % integral cosin from x to infty -> ci(x)=-Ci(x)+ln(x)+CEuler + dup Ci neg exch abs ln add CEuler add +} def +% /MaxIter 255 def /func { coeff Derivation FuncValue } def /func' { coeff Derivation 1 add FuncValue } def @@ -54,7 +111,7 @@ tx@FuncDict begin y0 F sub /Phi exch def Phi func /F2 exch def F2 abs eps2 le { exit }{ - Phi y0 sub dup mul Phi F2 sub 2 Phi mul sub y0 add div /Diff exch def + Phi y0 sub dup mul Phi F2 sub 2 Phi mul sub y0 add Div /Diff exch def y0 Diff sub /y0 exch def Diff abs eps1 le { exit } if } ifelse @@ -113,5 +170,159 @@ tx@FuncDict begin } for } def % +/Simpson { % on stack must be a b M +% /SFunc must be defined + /M ED /b ED /a ED + /h b a sub M 2 mul div def + /s1 0 def + /s2 0 def + 1 1 M { + /k exch def + /x k 2 mul 1 sub h mul a add def + /s1 s1 x SFunc add def + } for + 1 1 M 1 sub { + /k exch def + /x k 2 mul h mul a add def + /s2 s2 x SFunc add def + } for + /I a SFunc b SFunc add s1 4 mul add s2 2 mul add 3 div h mul def +} def + +% +% subroutines for complex numbers, given as an array [a b] +% which is a+bi = Real+i Imag +% +/cxadd { % [a1 b1] [a2 b2] = [a1+a2 b1+b2] + dup 0 get % [a1 b1] [a2 b2] a2 + 3 -1 roll % [a2 b2] a2 [a1 b1] + dup 0 get % [a2 b2] a2 [a1 b1] a1 + 3 -1 roll % [a2 b2] [a1 b1] a1 a2 + add % [a2 b2] [a1 b1] a1+a2 + 3 1 roll % a1+a2 [a2 b2] [a1 b1] + 1 get % a1+a2 [a2 b2] b1 + exch 1 get % a1+a2 b1 b2 + add 2 array astore +} def +% +/cxneg { % [a b] + dup 1 get % [a b] b + exch 0 get % b a + neg exch neg % -a -b + 2 array astore +} def +% +/cxsub { cxneg cxadd } def % same as negative addition +% +% [a1 b1][a2 b2] = [a1a2-b1b2 a1b2+b1a2] = [a3 b3] +/cxmul { % [a1 b1] [a2 b2] + dup 0 get % [a1 b1] [a2 b2] a2 + exch 1 get % [a1 b1] a2 b2 + 3 -1 roll % a2 b2 [a1 b1] + dup 0 get % a2 b2 [a1 b1] a1 + exch 1 get % a2 b2 a1 b1 + dup % a2 b2 a1 b1 b1 + 5 -1 roll dup % b2 a1 b1 b1 a2 a2 + 3 1 roll mul % b2 a1 b1 a2 b1a2 + 5 -2 roll dup % b1 a2 b1a2 b2 a1 a1 + 3 -1 roll dup % b1 a2 b1a2 a1 a1 b2 b2 + 3 1 roll mul % b1 a2 b1a2 a1 b2 a1b2 + 4 -1 roll add % b1 a2 a1 b2 b3 + 4 2 roll mul % b1 b2 b3 a1a2 + 4 2 roll mul sub % b3 a3 + exch 2 array astore +} def +% +% [a b]^2 = [a^2-b^2 2ab] = [a2 b2] +/cxsqr { % [a b] square root + dup 0 get exch 1 get % a b + dup dup mul % a b b^2 + 3 -1 roll % b b^2 a + dup dup mul % b b^2 a a^2 + 3 -1 roll sub % b a a2 + 3 1 roll mul 2 mul % a2 b2 + 2 array astore +} def +% +/cxsqrt { % [a b] +% dup cxnorm sqrt /r exch def +% cxarg 2 div RadtoDeg dup cos r mul exch sin r mul cxmake2 + cxlog % log[a b] + 2 cxrdiv % log[a b]/2 + aload pop exch % b a + 2.781 exch exp % b exp(a) + exch cxconv exch % [Re +iIm] exp(a) + cxrmul % +} def +% +/cxarg { % [a b] + aload pop % a b + exch atan % arctan b/a + DegtoRad % arg(z)=atan(b/a) +} def +% +% log[a b] = [a^2-b^2 2ab] = [a2 b2] +/cxlog { % [a b] + dup % [a b][a b] + cxnorm % [a b] |z| + log % [a b] log|z| + exch % log|z|[a b] + cxarg % log|z| Theta + cxmake2 % [log|z| Theta] +} def +% +% square of magnitude of complex number +/cxnorm2 { % [a b] + dup 0 get exch 1 get % a b + dup mul % a b^2 + exch dup mul add % a^2+b^2 +} def % +/cxnorm { % [a b] + cxnorm2 sqrt +} def +% +/cxconj { % conjugent complex + dup 0 get exch 1 get % a b + neg 2 array astore % [a -b] +} def +% +/cxre { 0 get } def % real value +/cxim { 1 get } def % imag value +% +% 1/[a b] = ([a -b]/(a^2+b^2) +/cxrecip { % [a b] + dup cxnorm2 exch % n2 [a b] + dup 0 get exch 1 get % n2 a b + 3 -1 roll % a b n2 + dup % a b n2 n2 + 4 -1 roll exch div % b n2 a/n2 + 3 1 roll div % a/n2 b/n2 + neg 2 array astore +} def +% +/cxmake1 { 0 2 array astore } def % make a complex number, real given +/cxmake2 { 2 array astore } def % dito, both given +% +/cxdiv { cxrecip cxmul } def +% +% multiplikation by a real number +/cxrmul { % [a b] r + exch aload pop % r a b + 3 -1 roll dup % a b r r + 3 1 roll mul % a r b*r + 3 1 roll mul % b*r a*r + exch 2 array astore % [a*r b*r] +} def +% +% division by a real number +/cxrdiv { % [a b] r + 1 exch div % [a b] 1/r + cxrmul +} def +% +% exp(i theta) = cos(theta)+i sin(theta) polar<->cartesian +/cxconv { % theta + RadtoDeg dup sin exch cos cxmake2 +} def end diff --git a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex index 122dfc0353a..efb3b102086 100644 --- a/Master/texmf-dist/tex/generic/pst-func/pst-func.tex +++ b/Master/texmf-dist/tex/generic/pst-func/pst-func.tex @@ -18,7 +18,7 @@ %% \csname PSTfuncLoaded\endcsname \let\PSTfuncLoaded\endinput -% Requires PSTricks, pst-node +% Requires PSTricks, pst-node, pst-xkey \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi \ifx\PSTnodesLoaded\endinput\else\input pst-plot.tex\fi \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex \fi @@ -27,17 +27,21 @@ % interface to the `xkeyval' package \pst@addfams{pst-func} -\def\fileversion{0.38} -\def\filedate{2004/11/08} -\message{`PST-func' v\fileversion, \filedate\space (Herbert Voss)} +\def\fileversion{0.45} +\def\filedate{2006/04/22} +\message{`PST-func' v\fileversion, \filedate\space (hv)} % \pstheader{pst-func.pro} +%\pstheader{pstricks-add.pro} %\def\pst@funcdict{tx@FuncDict begin } %\def\tx@saveCoor{\pst@3ddict saveCoor end } %\def\tx@ConvertTo2D{\pst@3ddict ConvertTo2D end } - -\define@key[psset]{pst-func}{cosCoeff}{\edef\psk@cosCoeff{#1}} -\define@key[psset]{pst-func}{sinCoeff}{\edef\psk@sinCoeff{#1}} +% +\define@key[psset]{pst-func}{xShift}{\def\psk@xShift{#1}} +\psset[pst-func]{xShift=0} +% +\define@key[psset]{pst-func}{cosCoeff}{\def\psk@cosCoeff{#1}} +\define@key[psset]{pst-func}{sinCoeff}{\def\psk@sinCoeff{#1}} \psset[pst-func]{cosCoeff=0,sinCoeff=1} % coeff=a0 a1 a2 a3 ... % \def\psFourier{\@ifnextchar[{\psFourier@i}{\psFourier@i[]}} @@ -63,14 +67,14 @@ }% }\ignorespaces} % -\define@key[psset]{pst-func}{coeff}{\edef\psk@coeff{#1}} -\define@key[psset]{pst-func}{Abbreviation}{\edef\psk@Deriviation{#1}}% compatibility -\define@key[psset]{pst-func}{Derivation}{\edef\psk@Derivation{#1}} +\define@key[psset]{pst-func}{coeff}{\def\psk@coeff{#1}} +\define@key[psset]{pst-func}{Abbreviation}{\def\psk@Deriviation{#1}}% compatibility +\define@key[psset]{pst-func}{Derivation}{\def\psk@Derivation{#1}} \newif\ifPst@markZeros% \define@key[psset]{pst-func}{markZeros}[true]{\@nameuse{Pst@markZeros#1}} -\define@key[psset]{pst-func}{epsZero}{\edef\psk@epsZero{#1}} -\define@key[psset]{pst-func}{dZero}{\edef\psk@dZero{#1}} -\define@key[psset]{pst-func}{zeroLineTo}{\edef\psk@zeroLineTo{#1}} +\define@key[psset]{pst-func}{epsZero}{\def\psk@epsZero{#1}} +\define@key[psset]{pst-func}{dZero}{\def\psk@dZero{#1}} +\define@key[psset]{pst-func}{zeroLineTo}{\def\psk@zeroLineTo{#1}} \define@key[psset]{pst-func}{zeroLineColor}{\pst@getcolor{#1}\psk@zeroLineColor} \newdimen\psk@zeroLineWidth \define@key[psset]{pst-func}{zeroLineWidth}{\pssetlength\psk@zeroLineWidth{#1}} @@ -124,7 +128,7 @@ \fi /x x0 def /xy { - x coeff Derivation FuncValue \pst@number\psyunit mul + x \psk@xShift\space sub coeff Derivation FuncValue \pst@number\psyunit mul x \pst@number\psxunit mul exch } def xy moveto @@ -154,7 +158,7 @@ mark /n 2 def \psk@plotpoints { - xy + xy n 2 roll /n n 2 add def /x x dx add def @@ -171,8 +175,8 @@ % Manuel Luque, Herbert Voss % Look at the end for some more documentation about the algorithm % -\define@key[psset]{pst-func}{constI}{\edef\psk@constI{#1}} -\define@key[psset]{pst-func}{constII}{\edef\psk@constII{#1}} +\define@key[psset]{pst-func}{constI}{\def\psk@constI{#1 }} +\define@key[psset]{pst-func}{constII}{\def\psk@constII{#1 }} \psset{constI=1,constII=0} % \def\psBessel{\@ifnextchar[{\psBessel@i}{\psBessel@i[]}} @@ -189,29 +193,355 @@ /J1 J1 0.1 xBessel tB sin mul tB #2\space mul sub cos mul add def } for - t J1 180 div \psk@constI\space mul \psk@constII\space add + t J1 180 div \psk@constI mul \psk@constII add }% }\ignorespaces} % -\define@key[psset]{pst-func}{sigma}{\edef\psk@sigma{#1}} -\psset{sigma=0.5} +\define@key[psset]{pst-func}{sigma}{\def\psk@sigma{#1 }} +\define@key[psset]{pst-func}{mue}{\def\psk@mue{#1 }} +\psset[pst-func]{sigma=0.5,mue=0} % \def\psGauss{\@ifnextchar[{\psGauss@i}{\psGauss@i[]}} \def\psGauss@i[#1]#2#3{{% \pst@killglue% \psset{plotpoints=200}% \psset{#1}% - \pstVerb{% - /euler 2.718282 def - /Const 1 \psk@sigma\space div 6.2831 sqrt div def - }% \psplot{#2}{#3}{% - euler x dup mul 2 div \psk@sigma\space dup mul div neg exp Const mul% + Euler x \psk@mue sub dup mul 2 div \psk@sigma dup mul div neg exp + 1.0 \psk@sigma div TwoPi sqrt div mul% }% }\ignorespaces} % +\define@key[psset]{pst-func}{Simpson}{\def\psk@Simpson{#1 }} +\psset[pst-func]{Simpson=5} +% +\def\psGaussI{\pst@object{psGaussI}} +\def\psGaussI@i#1#2{% + \begin@SpecialObj% + \addto@pscode{ + /a #1 def + /dx #2 #1 sub \psk@plotpoints\space div def + /b a dx add def + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + tx@FuncDict begin + /Sigma 1 \psk@sigma div TwoPi sqrt div def + /SFunc {% x on Stack + Euler exch \psk@xShift\space sub dup mul 2 div Sigma dup mul div neg exp Sigma mul + } def + end + a scx 0 moveto + \psk@plotpoints 1 sub { + a b \psk@Simpson % a b M on Styack + tx@FuncDict begin Simpson I end % y value on stack + scy b scx exch lineto + /b b dx add def + } repeat + stroke + }% + \end@SpecialObj% +} +% +\def\psSi{\pst@object{psSi}} +\def\psSi@i#1#2{% + \begin@SpecialObj% + \addto@pscode{ + /x #1 def + /dx #2 #1 sub \psk@plotpoints\space div def + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + x scx x tx@FuncDict begin Si end scy moveto + \psk@plotpoints 1 sub { + x dup scx exch tx@FuncDict begin Si end scy lineto + /x x dx add def + } repeat + stroke + }% + \end@SpecialObj% +} +\def\pssi{\pst@object{pssi}} +\def\pssi@i#1#2{% + \begin@SpecialObj% + \addto@pscode{ + /x #1 def + /dx #2 #1 sub \psk@plotpoints\space div def + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + x scx x tx@FuncDict begin si end scy moveto + \psk@plotpoints 1 sub { + x dup scx exch tx@FuncDict begin si end scy lineto + /x x dx add def + } repeat + stroke + }% + \end@SpecialObj% +} +% +\def\psCi{\pst@object{psCi}} +\def\psCi@i#1#2{% + \begin@SpecialObj% + \addto@pscode{ + /x #1 def + /dx #2 #1 sub \psk@plotpoints\space div def + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + x scx x tx@FuncDict begin Ci end scy moveto + \psk@plotpoints 1 sub { + x dup scx exch tx@FuncDict begin Ci end scy lineto + /x x dx add def + } repeat + stroke + }% + \end@SpecialObj% +} +\def\psci{\pst@object{psci}} +\def\psci@i#1#2{% + \begin@SpecialObj% + \addto@pscode{ + /x #1 def + /dx #2 #1 sub \psk@plotpoints\space div def + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + x scx x tx@FuncDict begin ci end scy moveto + \psk@plotpoints 1 sub { + x dup scx exch tx@FuncDict begin ci end scy lineto + /x x dx add def + } repeat + stroke + }% + \end@SpecialObj% +} +% +\define@key[psset]{pst-func}{PSfont}{\def\psk@PSfont{/#1 }} +\define@key[psset]{pst-func}{valuewidth}{\def\psk@valuewidth{#1 }} +\define@key[psset]{pst-func}{fontscale}{\def\psk@fontscale{#1 }} +\psset[pst-func]{PSfont=Times-Roman,fontscale=10,valuewidth=10} +% +\def\psPrintValue{\pst@object{psPrintValue}} +\def\psPrintValue@i#1{% + \begin@ClosedObj + \addto@pscode{ + gsave \psk@PSfont findfont \psk@fontscale scalefont setfont + #1 \psk@valuewidth string cvs 0 0 moveto show grestore + }% + \end@ClosedObj% +} +% +% Integrals 2006-01-16 +% Jose-Emilio Vila-Forcen, Herbert Voss +% +\def\psCumIntegral{\pst@object{psCumIntegral}} +\def\psCumIntegral@i#1#2#3{% + \begin@SpecialObj% + \addto@pscode{ + /a #1 def + /dx #2 #1 sub \psk@plotpoints\space div def + /b a dx add def + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + tx@FuncDict begin /SFunc { #3 } def end + a scx 0 moveto + \psk@plotpoints 1 sub { + a b \psk@Simpson % a b M on Styack + tx@FuncDict begin Simpson I end % y value on stack + scy b scx exch lineto + /b b dx add def + } repeat + stroke + }% + \end@SpecialObj% +} +% +\def\psIntegral{\pst@object{psIntegral}} +\def\psIntegral@i#1#2(#3,#4)#5{% + \begin@SpecialObj% + \addto@pscode{ + /a #3 def + /dx #4 #3 sub \psk@plotpoints\space div def + /b #4 def + /aa #1 def + /dd #2 #1 sub \psk@plotpoints\space div def + /t aa dd add def + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + tx@FuncDict begin /SFunc { t #5 } def end + a b \psk@Simpson % a b M on Stack + tx@FuncDict begin Simpson I end % y value on stack + scy t scx exch moveto + /t t dd add def + \psk@plotpoints 1 sub { + a b \psk@Simpson % a b M on Stack + tx@FuncDict begin Simpson I end % y value on stack + scy t scx exch lineto + /t t dd add def + } repeat + stroke + }% + \end@SpecialObj% +} +% +\def\psConv{\@ifnextchar[{\psConv@i}{\psConv@i[]}} +\def\psConv@i[#1]#2#3(#4,#5)#6#7{% + \psIntegral[#1]{#2}{#3}(#4,#5){pop pop x #6\space x t neg add #7\space mul}% +}% +% +\newif\ifPst@printValue% +\define@key[psset]{pst-func}{printValue}[true]{\@nameuse{Pst@printValue#1}} +\define@key[psset]{pst-func}{barwidth}{\def\psFunc@barwidth{#1 }}% a factor, not a dimen +\psset[pst-func]{printValue=false,barwidth=1} +% +\def\psBinomial{\pst@object{psBinomial}} +\def\psBinomial@i#1#2{% + \begin@SpecialObj% + \addto@pscode{ + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + /N #1 def + /p #2 def + /dx \psFunc@barwidth 2 div def + /q 1 p sub def + /kOld dx neg def + kOld scx 0 moveto % starting point +% /Y 1 def % start value + 0 1 N { % N times + /k exch def % save loop variable + k 0 eq + { /Y q N exp def } + { /Y Y N k sub 1 add mul k div p mul q div def } + ifelse % recursive definition + kOld scx 0 L kOld scx Y scy L k dx add scx Y scy L + \ifPst@markZeros k dx add scx 0 L \fi + \ifPst@printValue + gsave \psk@PSfont findfont \psk@fontscale scalefont setfont + Y \psk@valuewidth string cvs + k scx \psk@fontscale 2 div add + Y scy \pst@number\pslabelsep add moveto + 90 rotate show grestore + \fi + /kOld kOld 1 add def + } for + }% + \psk@fillstyle + \pst@stroke + \end@SpecialObj% +} +% +\def\psBinomialN{\pst@object{psBinomialN}} +\def\psBinomialN@i#1#2{% + \pst@killglue + \begin@SpecialObj% + \def\cplotstyle{curve}% + \ifx\psplotstyle\cplotstyle \@nameuse{beginplot@\psplotstyle}\fi% + \addto@pscode{ + \ifx\psplotstyle\cplotstyle /Curve true def \else /Curve false def \fi + /scx { \pst@number\psxunit mul } def + /scy { \pst@number\psyunit mul } def + /N #1 def + /p #2 def % probability + /q 1 p sub def + /E N p mul def + /sigma E q mul sqrt def % variant + /dx 1.0 sigma div 2 div def + /xOld dx neg E sub sigma div def + /xEnd xOld neg dx add scx def + Curve + { /Coors [xOld dx sub scx 0] def }% saves the coordinates for curve + { xOld scx 0 moveto } % starting point + ifelse + 0 1 N { % N times + /k exch def % save loop variable + k 0 eq + { /Y q N exp def } + { /Y Y N k sub 1 add mul k div p mul q div def } + ifelse % recursive definition + /x k E sub sigma div dx add def + /y Y sigma mul def % normalize + Curve + { x dx sub scx y scy Coors aload length 2 add array astore /Coors exch def} + { xOld scx y scy L x scx y scy L + \ifPst@markZeros x scx 0 L \fi % + } ifelse + \ifPst@printValue + gsave \psk@PSfont findfont \psk@fontscale scalefont setfont + y \psk@valuewidth string cvs + x dx sub scx \psk@fontscale 2 div add + y scy \pst@number\pslabelsep add moveto + 90 rotate show grestore + \fi + /xOld x def + } for + Curve { [ xEnd 0 Coors aload pop} if % showpoints on top of the stack + }% + \ifx\psplotstyle\cplotstyle \@nameuse{endplot@\psplotstyle} \else% + \psk@fillstyle% + \pst@stroke% + \fi% + \end@SpecialObj% + \ignorespaces% +} +% +% For polar plots +\newif\ifpolarplot +\define@key[psset]{pst-func}{polarplot}[true]{\@nameuse{polarplot#1}} +\newif\ifPst@algebraic% +\define@key[psset]{pst-func}{algebraic}[true]{\@nameuse{Pst@algebraic#1}}% +\psset[pst-func]{polarplot=false,algebraic=false} +% +\def\psplotImp{\pst@object{psplotImp}}% 20060420 +\def\psplotImp@i(#1,#2)(#3,#4)#5{% + \pst@killglue + \begingroup + \begin@SpecialObj% + \addto@pscode{ + /xMin #1 def + /xMax #3 def + /yMin #2 def + /yMax #4 def + \ifpolarplot + /@PolarAlgPlot (#5) tx@addDict begin AlgParser end cvx def + /Func { + /phi y x atan def + /r x y Pyth def + \ifPst@algebraic @PolarAlgPlot \else #5 \fi } def + \else + /Func \ifPst@algebraic (#5) tx@addDict begin AlgParser end cvx \else { #5 } \fi def + \fi + /xPixel xMax xMin sub \pst@number\psxunit mul round cvi def + /yPixel yMax yMin sub \pst@number\psxunit mul round cvi def + /dx xMax xMin sub xPixel div def + /dy yMax yMin sub yPixel div def + /setpixel { dy div exch dx div exch \pst@number\pslinewidth 2 div 0 360 arc fill } bind def +% + /VZ true def % suppose that F(x,y)>=0 + /x xMin def /y yMin def Func 0.0 lt { /VZ false def } if % erster Wert + xMin dx 1.5 div xMax { + /x exch def + yMin dy 1.5 div yMax { + /y exch def + Func 0 lt + { VZ { x y setpixel /VZ false def} if } + { VZ {}{ x y setpixel /VZ true def } ifelse } ifelse + } for + } for +% + /x xMin def /y yMin def Func 0.0 lt { /VZ false def } if % erster Wert + yMin dy 1.5 div yMax { + /y exch def + xMin dx 1.5 div xMax { + /x exch def + Func 0 lt + { VZ { x y setpixel /VZ false def} if } + { VZ {}{ x y setpixel /VZ true def } ifelse } ifelse + } for + } for + }% + \end@SpecialObj% + \endgroup + \ignorespaces +} +% \catcode`\@=\PstAtCode\relax % -%% END: pst-abspos.tex +%% END: pst-func.tex \endinput % diff --git a/Master/texmf-dist/tex/latex/pst-func/pst-func.sty b/Master/texmf-dist/tex/latex/pst-func/pst-func.sty index 01da72601df..0c975dd68db 100644 --- a/Master/texmf-dist/tex/latex/pst-func/pst-func.sty +++ b/Master/texmf-dist/tex/latex/pst-func/pst-func.sty @@ -1,7 +1,8 @@ \RequirePackage{pstricks} -\ProvidesPackage{pst-func}[2004/10/18 package wrapper for +\ProvidesPackage{pst-func}[2006/04/22 package wrapper for pst-func.tex (hv)] \input{pst-func.tex} \ProvidesFile{pst-func.tex} [\filedate\space v\fileversion\space `PST-func' (hv)] +\IfFileExists{pst-func.pro}{\@addtofilelist{pst-func.pro}}{}% \endinput diff --git a/Master/texmf-dist/tpm/pst-func.tpm b/Master/texmf-dist/tpm/pst-func.tpm index f7307a17f03..87010f7b881 100644 --- a/Master/texmf-dist/tpm/pst-func.tpm +++ b/Master/texmf-dist/tpm/pst-func.tpm @@ -3,7 +3,7 @@ <rdf:Description about="http://texlive.dante.de/texlive/Package/pst-func.zip"> <TPM:Name>pst-func</TPM:Name> <TPM:Type>Package</TPM:Type> - <TPM:Date>2006/01/09 00:56:57</TPM:Date> + <TPM:Date>2006/04/22 08:16:24</TPM:Date> <TPM:Version>1.0</TPM:Version> <TPM:Creator>rahtz</TPM:Creator> <TPM:Title> @@ -24,18 +24,18 @@ defined by sigma <TPM:Author>unknown</TPM:Author> <TPM:Size>254837</TPM:Size> <TPM:Build/> - <TPM:RunFiles size="11448"> + <TPM:RunFiles size="26094"> texmf-dist/dvips/pst-func/pst-func.pro texmf-dist/tex/generic/pst-func/pst-func.tex texmf-dist/tex/latex/pst-func/pst-func.sty texmf-dist/tpm/pst-func.tpm </TPM:RunFiles> - <TPM:DocFiles size="243389"> + <TPM:DocFiles size="2122108"> texmf-dist/doc/generic/pst-func/Changes texmf-dist/doc/generic/pst-func/README +texmf-dist/doc/generic/pst-func/pst-func-doc.bib texmf-dist/doc/generic/pst-func/pst-func-doc.pdf texmf-dist/doc/generic/pst-func/pst-func-doc.tex -texmf-dist/doc/generic/pst-func/pstricks.bib </TPM:DocFiles> <TPM:Provides>Package/pst-func</TPM:Provides> </rdf:Description> diff --git a/Master/texmf/lists/pst-func b/Master/texmf/lists/pst-func index d071490519e..2a0c9b3d161 100644 --- a/Master/texmf/lists/pst-func +++ b/Master/texmf/lists/pst-func @@ -1,8 +1,8 @@ texmf-dist/doc/generic/pst-func/Changes texmf-dist/doc/generic/pst-func/README +texmf-dist/doc/generic/pst-func/pst-func-doc.bib texmf-dist/doc/generic/pst-func/pst-func-doc.pdf texmf-dist/doc/generic/pst-func/pst-func-doc.tex -texmf-dist/doc/generic/pst-func/pstricks.bib texmf-dist/dvips/pst-func/pst-func.pro texmf-dist/tex/generic/pst-func/pst-func.tex |