From 7bd53a20b9a4f0c2696bbe01fda5d72677181f04 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 17 Nov 2008 01:24:33 +0000 Subject: pst-func update (14nov08) git-svn-id: svn://tug.org/texlive/trunk@11314 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-func/Changes | 1 + Master/texmf-dist/doc/generic/pst-func/README | 2 + .../doc/generic/pst-func/pst-func-doc.bib | 1 + .../doc/generic/pst-func/pst-func-doc.pdf | Bin 2695211 -> 2699707 bytes .../doc/generic/pst-func/pst-func-doc.tex | 352 ++++++++++----------- 5 files changed, 179 insertions(+), 177 deletions(-) (limited to 'Master/texmf-dist/doc/generic') diff --git a/Master/texmf-dist/doc/generic/pst-func/Changes b/Master/texmf-dist/doc/generic/pst-func/Changes index 3436a9d6a39..2c6049860b8 100644 --- a/Master/texmf-dist/doc/generic/pst-func/Changes +++ b/Master/texmf-dist/doc/generic/pst-func/Changes @@ -1,4 +1,5 @@ ..... pst-func.tex +0.57 2008-11-13 - new optional argument for the step width of \psPlotImp 0.56 2008-10-31 - fix bug with \psPoisson, thanks to Gerry Coombes - index for the documentation 0.55 2008-06-12 added code for Thomae's function, aka popcorn function diff --git a/Master/texmf-dist/doc/generic/pst-func/README b/Master/texmf-dist/doc/generic/pst-func/README index f5728262e61..8006296267e 100644 --- a/Master/texmf-dist/doc/generic/pst-func/README +++ b/Master/texmf-dist/doc/generic/pst-func/README @@ -40,3 +40,5 @@ CTAN server, f.ex. ftp://ftp.ctan.org PSTricks is PostScript Tricks, the documentation cannot be run with pdftex, use the sequence latex->dvips->ps2pdf. + +%% $Id: README 55 2008-11-14 12:01:12Z herbert $ diff --git a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.bib b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.bib index 59752ab3c9a..8894fa5f494 100644 --- a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.bib +++ b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.bib @@ -156,3 +156,4 @@ year = {2007}, address = {\url{http://mathworld.wolfram.com}} } + 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 index 588de4a7140..3cecc9ab010 100644 Binary files a/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf and b/Master/texmf-dist/doc/generic/pst-func/pst-func-doc.pdf differ 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 08a64c173fa..3f7b0a0a456 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[dvips,a4paper,english]{article} -\usepackage[T1]{fontenc} +%% $Id: pst-func-doc.tex 55 2008-11-14 12:01:12Z herbert $ +\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings + headexclude,footexclude,oneside]{pst-doc} \usepackage[utf8]{inputenc} -\usepackage{pst-news} \usepackage{pst-func} \let\pstFuncFV\fileversion \usepackage{pst-math} @@ -12,57 +12,58 @@ \def\psvlabel#1{\footnotesize#1} % \begin{document} -\title{\texttt{pst-func}\\[1cm] -plotting special mathematical functions\\[5mm] - {\small v.\pstFuncFV}} -%\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{% -Thanks to: - Jean-C\^ome Charpentier, - Martin Chicoine, - Gerry Coombes, - John Frampton, - Attila Gati, - Horst Gierhardt, - Lars Kotthoff, - and Jose-Emilio Vila-Forcen. -}} -\date{\today} +\title{\texttt{pst-func}} +\subtitle{Plotting special mathematical functions; v.\pstFuncFV} +\author{Herbert Vo\ss} +\docauthor{} +\date{\today} \maketitle -\vfill -\begin{center} -\fbox{\parbox{0.8\textwidth}{% -\texttt{pst-func} loads by default the following packages: \texttt{pst-plot}, -\texttt{pstricks-add}, \texttt{pst-math}, \texttt{pst-xkey}, and, of course \texttt{pstricks}. +\tableofcontents + +\clearpage + +\begin{abstract} +\noindent +\LPack{pst-func} loads by default the following packages: \LPack{pst-plot}, +\LPack{pstricks-add}, \LPack{pst-math}, \LPack{pst-xkey}, and, of course \LPack{pstricks}. All should be already part of your local \TeX\ installation. If not, or in case of having older versions, go to \url{http://www.CTAN.org/} and load the newest version. {\itshape If \LPack{pstricks-add} is loaded together with the package \LPack{pst-func} then the \Lkeyword{InsideArrow} - of the \Lcs{psbezier} macro doesn't work!}}} + of the \Lcs{psbezier} macro doesn't work!} -\end{center} -\vfill -\clearpage -\tableofcontents +\vfill\noindent +Thanks to: \\ +Rafal Bartczuk, + Jean-C\^ome Charpentier, + Martin Chicoine, + Gerry Coombes, + Denis Girou, + John Frampton, + Attila Gati, + Horst Gierhardt, + Christophe Jorssen, + Lars Kotthoff, + Manuel Luque, + Jose-Emilio Vila-Forcen, +Timothy Van Zandt, +and last but not least \url{http://mathworld.wolfram.com} -\clearpage +\end{abstract} -\section{\Lcs{psBezier\#}} +\section{\nxLcs{psBezier\#}} This macro can plot a B\'ezier spline from order 1 up to 9 which needs (order+1) pairs of given coordinates. Given a set of $n+1$ control points $P_0$, $P_1$, \ldots, $P_n$, the corresponding \Index{B\'ezier} curve (or \Index{Bernstein-B\'ezier} curve) is given by - +% \begin{align} C(t)=\sum_{i=0}^n P_i B_{i,n}(t) \end{align} - +% Where $B_{i,n}(t)$ is a Bernstein polynomial $B_{i,n}(t)=\binom{n}{i}t^i(1-t)^{n-i}$, and $t \in [0,1]$. The Bézier curve starts through the first and last given point and @@ -76,9 +77,9 @@ by smoothly patching together low-order Bézier curves. The macro \Lcs{psBezier} (note the upper case B) expects the number of the order and $n=order+1$ pairs of coordinates: -\begin{lstlisting}[style=syntax] -\psBezier#[](x0,y0)(x1,y1)...(xn,yn) -\end{lstlisting} +\begin{BDef} +\Lcs{psBezier}\Larg{\#}\OptArgs\coord0\coord1\coordn +\end{BDef} The number of steps between the first and last control points is given by the keyword \Lkeyword{plotpoints} and preset to 200. It can be @@ -172,6 +173,7 @@ changed in the usual way. \section{Polynomials} \subsection{\Lcs{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\\ f^{\prime}(x) &= a_1 + 2a_2x + 3a_3x^2 + \ldots +(n-1)a_{n-1}x^{n-2} + na_nx^{n-1}\\ @@ -182,9 +184,9 @@ f^{\prime\prime}(x) &= 2a_2 + 6a_3x + \ldots +(n-1)(n-2)a_{n-1}x^{n-3} + n(n-1)a \noindent so \LPack{pst-func} needs only the \Index{coefficients} of the polynomial to calculate the function. The syntax is -\begin{lstlisting}[style=syntax] -\psPolynomial[]{xStart}{xEnd} -\end{lstlisting} +\begin{BDef} +\Lcs{psPolynomial}\OptArgs\Largb{xStart}\Largb{xEnd} +\end{BDef} With the option \Lkeyword{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}$; \Lkeyword{xShift}=1 @@ -226,9 +228,10 @@ moves the graph of the polynomial function one unit to the right. The plot is easily clipped using the star version of the -\verb+pspicture+ environment, so that points whose coordinates +\Lenv{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\\ @@ -236,10 +239,7 @@ 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 @@ -249,7 +249,7 @@ Name & \textrm{Value} & \textrm{Default}\\\hline \Lkeyword{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 +value of the parameter \Lkeyword{coeff} is \verb+0 0 1+, which gives the parabola $y=a_0+a_1x+a_2x^2=x^2$.\\ \Lkeyword{xShift} & & 0 & $(x-xShift)$ for the horizontal shift of the polynomial\\ \Lkeyword{Derivation} & & 0 & the default is the function itself\\ @@ -261,15 +261,8 @@ the parabola $y=a_0+a_1x+a_2x^2=x^2$.\\ with this step\\ \Lkeyword{zeroLineTo} & & 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}{@{}l>{\ttfamily}l>{\ttfamily}lX@{}} -Name & \textrm{Value} & \textrm{Default}\\\hline -\Lkeyword{zeroLineStyle} & & dashed & the style is one of the for PSTricks valid styles.\\ -\Lkeyword{zeroLineColor} & & black & any valid xolor is possible\\ +\Lkeyword{zeroLineStyle} & & \Lkeyval{dashed} & the style is one of the for \PST valid styles.\\ +\Lkeyword{zeroLineColor} & & \Lkeyval{black} & any valid xolor is possible\\ \Lkeyword{zeroLineWidth} & & \rlap{0.5\textbackslash pslinewidth} & \\ \end{tabularx} } @@ -277,7 +270,7 @@ Name & \textrm{Value} & \textrm{Default}\\\hline \bigskip -The above parameter are only +The above parameters are only valid for the \Lcs{psPolynomial} macro, except \verb+x0+, which can also be used for the Gauss function. All options can be set in the usual way with \Lcs{psset}. @@ -366,9 +359,9 @@ The envelope $f_n(x)$ of the Bernstein polynomials $B_{i,n}(x)$ for $i=0,1,\ldot is given by \[f_n(x)=\frac{1}{\sqrt{\pi n\cdot x(1-x)}}\] illustrated below for $n=20$. -\begin{lstlisting}[style=syntax] -\psBernstein[](tStart,tEnd)(i,n) -\end{lstlisting} +\begin{BDef} +\Lcs{psBernstein}\OptArgs\Largr{tStart,tEnd}\Largr{i,n} +\end{BDef} The (\Lkeyword{tStart}, \Lkeyword{tEnd}) are \emph{optional} and preset by \verb=(0,1)=. The only new optional argument is the boolean key \Lkeyword{envelope}, which plots the envelope curve instead @@ -443,6 +436,7 @@ of the Bernstein polynomial. \section{\Lcs{psFourier}} A Fourier sum has the form: +% \begin{align} s(x) = \frac{a_0}{2} & + a_1\cos{\omega x} + a_2\cos{2\omega x} + a_3\cos{3\omega x} + @@ -450,16 +444,17 @@ s(x) = \frac{a_0}{2} & + a_1\cos{\omega x} + a_2\cos{2\omega x} + & + b_1\sin{\omega x} + b_2\sin{2\omega x} + b_3\sin{3\omega x} + \ldots + b_m\sin{m\omega x} \end{align} - +% \noindent The macro \Lcs{psFourier} plots \Index{Fourier sums}. The syntax is similiar to \Lcs{psPolynomial}, except that there are two kinds of coefficients: -\begin{lstlisting}[style=syntax] -\psFourier[cosCoeff=a0 a1 a2 ..., sinCoeff=b1 b2 ...]{xStart}{xEnd} -\end{lstlisting} -The coefficients must have the orders $a_0\ a_1\ a_2\ \ldots$ -and $b_1\ b_2\ b_3\ \ldots$ and be separated by +\begin{BDef} +\Lcs{psFourier}\OptArgs\Largb{xStart}\Largb{xEnd} +\end{BDef} + +The coefficients must have the orders $cosCoeff=a_0\ a_1\ a_2\ \ldots$ +and $sinCoeff=b_1\ b_2\ b_3\ \ldots$ and be separated by \textbf{spaces}. The default is \Lkeyword{cosCoeff}=0,\Lkeyword{sinCoeff}=1, which gives the standard \verb+sin+ function. Note that %%JF, I think it is better without the angle brackets, but @@ -501,32 +496,27 @@ the constant value can only be set with \Lkeyword{cosCoeff}=\verb+a0+. \clearpage \section{\Lcs{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)\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{lstlisting}[style=syntax] -\psBessel[options]{order}{xStart}{xEnd} -\end{lstlisting} +\begin{BDef} +\Lcs{psBessel}\OptArgs\Largb{order}\Largb{xStart}\Largb{xEnd} +\end{BDef} There are two special parameters for the Bessel function, and also the settings of many \LPack{pst-plot} or \LPack{pstricks} parameters affect the plot. - -\begin{lstlisting}[style=syntax] -\def\psset@constI#1{\edef\psk@constI{#1}} -\def\psset@constII#1{\edef\psk@constII{#1}} -\psset{constI=1,constII=0} -\end{lstlisting} - These two ,,constants`` have the following meaning: +% \[ f(t) = constI \cdot J_n + constII \] - +% \noindent where \Lkeyword{constI} and \Lkeyword{constII} must be real PostScript expressions, e.g.: @@ -538,11 +528,11 @@ The Bessel function is plotted with the parametricplot macro, this is the reason why the variable is named \verb+t+. The internal procedure \verb+k+ converts the value t from radian into degrees. The above setting is the same as +% \[ f(t) = 2.3 \cdot J_n + 1.2\cdot \sin t + 0.37 \] - - +% In particular, note that the default for \Lkeyword{plotpoints} is $500$. If the plotting computations are too time consuming at this setting, it can be decreased in the usual @@ -585,6 +575,7 @@ way, at the cost of some reduction in graphics resolution. \clearpage \section{\Lcs{psSi}, \Lcs{pssi} and \Lcs{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}\\ @@ -593,11 +584,11 @@ The integral sin and cosin are defined as % \noindent The syntax of the macros is -\begin{lstlisting}[style=syntax] -\psSi[options]{xStart}{xEnd} -\pssi[options]{xStart}{xEnd} -\psCi[options]{xStart}{xEnd} -\end{lstlisting} +\begin{BDef} +\Lcs{psSi}\OptArgs\Largb{xStart}\Largb{xEnd}\\ +\Lcs{pssi}\OptArgs\Largb{xStart}\Largb{xEnd}\\ +\Lcs{psCi}\OptArgs\Largb{xStart}\Largb{xEnd} +\end{BDef} \begin{LTXexample}[pos=t] @@ -638,11 +629,13 @@ The first one is the result of the integral of a function with two variables, an the integral is performed over one of them. The second one is the cumulative integral of a function (similar to \Lcs{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)\mathrm{d}t \\ \text{psCumIntegral}(x) &= \int_{\text{xStart}}^{x} f(t)\mathrm{d}t \\ \text{psConv}(x) & = \int_a^b f(t)g(x-t)\mathrm{d}t \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$ (\Lkeyword{xStart}) and the current @@ -651,11 +644,11 @@ to the convolution, where the integration is performed from $a$ to $b$. The syntax of these macros is: -\begin{lstlisting}[style=syntax] -\psIntegral[]{xStart}{xEnd}(a,b){ function } -\psCumIngegral[]{xStart}{xEnd}{ function } -\psConv[]{xStart}{xEnd}(a,b){ function f }{ function g } -\end{lstlisting} +\begin{BDef} +\Lcs{psIntegral}\OptArgs\Largb{xStart}\Largb{xEnd}\Largr{a,b}\Largb{ function }\\ +\Lcs{psCumIngegral}\OptArgs\Largb{xStart}\Largb{xEnd}\Largb{ function }\\ +\Lcs{psConv}\OptArgs\Largb{xStart}\Largb{xEnd}\Largr{a,b}\Largb{ function f }\Largb{ function g } +\end{BDef} In the first macro, the function should be created such that it accepts two values: \verb|| should be a value. For the second and the third functions, they only need to accept one @@ -726,10 +719,10 @@ f(x) &= \dfrac{1}{\sigma\sqrt{2\pi}}\,e^{-\dfrac{\left(x-\mu\right)^2}{2\sigma{} % \noindent The syntax of the macros is -\begin{lstlisting}[style=syntax] -\psGauss[options]{xStart}{xEnd} -\psGaussI[options]{xStart}{xEnd} -\end{lstlisting} +\begin{BDef} +\Lcs{psGauss}\OptArgs\Largb{xStart}\Largb{xEnd}\\ +\Lcs{psGaussI}\OptArgs\Largb{xStart}\Largb{xEnd} +\end{BDef} \noindent where the only new parameter are \Lkeyword{sigma}=+ and \Lkeyword{mue}=+ for the horizontal shift, @@ -779,12 +772,12 @@ where $(N; n)$ is a binomial coefficient and $P$ the probability. The syntax is quite easy: -\begin{lstlisting}[style=syntax] -\psBinomial[]{N}{probability p} -\psBinomial[]{m,N}{probability p} -\psBinomial[]{m,n,N}{probability p} -\psBinomialN[]{N}{probability p} -\end{lstlisting} +\begin{BDef} +\Lcs{psBinomial}\OptArgs\Largb{N}\Largb{probability p}\\ +\Lcs{psBinomial}\OptArgs\Largb{m,N}\Largb{probability p}\\ +\Lcs{psBinomial}\OptArgs\Largb{m,n,N}\Largb{probability p}\\ +\Lcs{psBinomialN}\OptArgs\Largb{N}\Largb{probability p} +\end{BDef} \begin{itemize} \item with one argument $N$ the sequence $0\ldots N$ is calculated and plotted @@ -896,7 +889,7 @@ P(k) &= P(k-1)\cdot\frac{N-k+1}{k}\cdot\frac{p}{1-p} -For the normalized distribution the plotstyle can be set to \Lkeyval{curve} (\Lkeyword{plotstyle}=\Lkeyval{curve}), +For the normalized distribution the plotstyle can be set to \Lkeyval{curve} (\Lkeyset{plotstyle=curve}), then the binomial distribution looks like a normal distribution. This option is only valid vor \Lcs{psBinomialN}. The option \Lkeyword{showpoints} is valid if \Lkeyval{curve} was chosen. @@ -970,10 +963,10 @@ approaches (with $p=\frac{\lambda}{n}$) which is known as the Poisson distribution and has the follwing syntax: -\begin{lstlisting}[style=syntax] -\psPoisson[settings]{N}{lambda} -\psPoisson[settings]{M,N}{lambda} -\end{lstlisting} +\begin{BDef} +\Lcs{psPoisson}\OptArgs\Largb{N}\Largb{lambda}\\ +\Lcs{psPoisson}\OptArgs\Largb{M,N}\Largb{lambda} +\end{BDef} in which \texttt{M} is an optional argument with a default of 0. @@ -1024,9 +1017,9 @@ f(x)=\frac{\beta(\beta x)^{\alpha-1}e^{-\beta x}}{\Gamma(\alpha)} \qquad % and has the syntax -\begin{lstlisting}[style=syntax] -\psGammaDist[options]{x0}{x1} -\end{lstlisting} +\begin{BDef} +\Lcs{psGammaDist}\OptArgs\Largb{x0}\Largb{x1} +\end{BDef} \begin{LTXexample}[pos=t,preset=\centering] \psset{xunit=1.2cm,yunit=10cm,plotpoints=200} @@ -1041,7 +1034,7 @@ and has the syntax \clearpage \subsection{$\chi^2$-distribution} The $\chi^2$-distribution is a continuous probability distribution. It -usually arises when a k-dimensional vector's orthogonal components are +usually arises when a $k$-dimensional vector's orthogonal components are independent and each follow a standard normal distribution. The length of the vector will then have a $\chi^2$-distribution. @@ -1063,9 +1056,9 @@ is distributed according to chi^2 with r=sum_(j==1)^(k)r_j degrees of freedom. The $\chi^2$ with parameter $\nu$ is the same as a Gamma distribution with $\alpha=\nu/2$ and $\beta=1/2$ and the syntax -\begin{lstlisting}[style=syntax] -\psChiIIDist[options]{x0}{x1} -\end{lstlisting} +\begin{BDef} +\Lcs{psChiIIDist}\OptArgs\Largb{x0}\Largb{x1} +\end{BDef} \begin{LTXexample}[pos=t,preset=\centering] \psset{xunit=1.2cm,yunit=10cm,plotpoints=200} @@ -1078,37 +1071,33 @@ The $\chi^2$ with parameter $\nu$ is the same as a Gamma distribution \iffalse The cumulative distribution function is +% \begin{align*} D_r(\chi^2) &= int_0^{\chi^2}\frac{t^{r/2-1}e^{-t/2}\mathrm{d}t}{\Gamma(1/2r)2^{r/2}} \\ - &= 1-\frac{\Gamma(1/2r,1/2\chi^2)}{\Gamma(1/2r)} \end{align*} \fi -%The $\chi^2_\nu$-distribution has mode $\nu-2$ for $\nu\geq2$. \clearpage \subsection{Student's $t$-distribution} -A \Index{statistical distribution} published by \Index{William Gosset} in 1908 under his %. His employer, Guinness Breweries, -%required him to publish under a -pseudonym %, so he chosed -,,Student``. -%Given N independent measurements x_i, let -%t=(x^_-mu)/(s/sqrt(N)), -The $t$-distribution with parameter $\nu$ has the \Index{density function} +A \Index{statistical distribution} published by \Index{William Gosset} in 1908 under his +pseudonym ,,Student``. The $t$-distribution with parameter $\nu$ has the \Index{density function} +% \[ f(x)=\frac1{\sqrt{\nu\pi}}\cdot \frac{\Gamma[(\nu+1)/2]}{\Gamma(\nu/2)}\cdot\frac1{[1+(x^2/\nu)]^{(\nu+1)/2}} \qquad -\text{for $-\infty0$}\] +\text{for $-\infty0$} +\] % and the following syntax -\begin{lstlisting}[style=syntax] -\psTDist[options]{x0}{x1} -\end{lstlisting} +\begin{BDef} +\Lcs{psTDist}\OptArgs\Largb{x0}\Largb{x1} +\end{BDef} \begin{LTXexample}[pos=t,preset=\centering] @@ -1138,9 +1127,9 @@ f_{n,m}(x)=\frac{\Gamma[(\mu+\nu)/2]}{\Gamma(\mu/2)\Gamma(\nu/2)}\cdot % and the syntax -\begin{lstlisting}[style=syntax] -\psFDist[options]{x0}{x1} -\end{lstlisting} +\begin{BDef} +\Lcs{psFDist}\OptArgs\Largb{x0}\Largb{x1} +\end{BDef} % The default settings are $\mu=1$ and $\nu=1$. @@ -1178,9 +1167,9 @@ P(x) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}(1-x)^{\beta-1}x^ % and has the syntax (with a default setting of $\alpha=1$ and $\beta=1$): -\begin{lstlisting}[style=syntax] -\psBetaDist[options]{x0}{x1} -\end{lstlisting} +\begin{BDef} +\Lcs{psBetaDist}\OptArgs\Largb{x0}\Largb{x1} +\end{BDef} % @@ -1205,9 +1194,9 @@ P(x)=\frac{x^s}{e^{x-mu}-1}\qquad\text{with $s\in\mathbb{Z}$ and $\mu\in\mathbb{ % and has the syntax (with a default setting of $s=1$ and $\mu=1$): -\begin{lstlisting}[style=syntax] -\psBoseEInsteinDist[options]{x0}{x1} -\end{lstlisting} +\begin{BDef} +\Lcs{psBoseEinsteinDist}\OptArgs\Largb{x0}\Largb{x1} +\end{BDef} \fi @@ -1255,9 +1244,9 @@ If $r$ is a rational, then a \Index{superellipse} is algebraic. However, for irr it is transcendental. For even integers $r=n$, the curve becomes closer to a rectangle as $n$ increases. The syntax of the \Lcs{psLame} macro is: -\begin{lstlisting}[style=syntax] -\psLame[settings]{r} -\end{lstlisting} +\begin{BDef} +\Lcs{psLame}\OptArgs\Largb{r} +\end{BDef} It is internally plotted as a \Index{parametric plot} with $0\le\alpha\le360$. Available keywords are \Lkeyword{radiusA} and \Lkeyword{radiusB}, both are preset to 1, but can have any valid value @@ -1278,24 +1267,25 @@ and unit. \clearpage -\section{\Lcs{psThomae} -- the popcorn function} +\section{\nxLcs{psThomae} -- the popcorn function} \Index{Thomae's function}, also known as the \Index{popcorn function}, the \Index{raindrop function}, the \Index{ruler function} or the \Index{Riemann function}, is a modification of the \Index{Dirichlet} function. This real-valued function $f(x)$ is defined as follows: - +% \[ f(x)=\begin{cases} \frac{1}{q}\mbox{ if }x=\frac{p}{q}\mbox{ is a rational number}\\ 0\mbox{ if }x\mbox{ is irrational} \end{cases} \] +% It is assumed here that $\mathop{gcd}(p,q) = 1$ and $q > 0$ so that the function is well-defined and nonnegative. The syntax is: -\begin{lstlisting}[style=syntax] -\psThomae[options](x0,x1){points} -\end{lstlisting} +\begin{BDef} +\Lcs{psThomae}\OptArgs\Largr{x0,x1}\Largb{points} +\end{BDef} \verb+(x0,x1)+ is the plotted interval, both values must be grater zero and $x_1>x_0$. The plotted number of points is the third parameter. @@ -1310,33 +1300,39 @@ The plotted number of points is the third parameter. \clearpage -\section{\Lcs{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 +\section{\nxLcs{psplotImp} -- plotting implicit defined functions} +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 a 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$ +then the pixel must be part of the curve of the function $f(x,y)=0$. In a second step the same is +done column by column. This may 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. +macro itself. +The only special keyword is \Lkeyword{stepFactor} which is preset to 0.67 and controls the horizontal +and vertical step width. -\begin{lstlisting}[style=syntax] -\psplotImp[](xMin,yMin)(xMax,yMax){} -\end{lstlisting} +\begin{BDef} +\Lcs{psplotImp}\OptArgs\Largr{xMin,yMin}\Largr{xMax,yMax}\Largb{function f(x,y)} +\end{BDef} The function must be of $f(x,y)=0$ and described in \PS code, or alternatively with -the option \\Lkeyword{algebraic} (\LPack{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 \Lcs{psplotImp} should be \textbf{greater} than the given \Lenv{pspicture} area. +the option \Lkeyword{algebraic} (\LPack{pstricks-add}) in an algebraic form. No other value names than $x$ and $y$ +are possible. In general, a starred \Lenv{pspicture*} environment maybe a good choice here. + +\medskip +\noindent +\begin{tabularx}{\linewidth}{!{\color{Orange!85!Red}\vrule width 5pt} X @{}} +The given area for \Lcs{psplotImp} should be \textbf{greater} than the given \Lenv{pspicture} area +(see examples). +\end{tabularx} \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 +\psplotImp[linewidth=2pt,linecolor=red](-5,-2.1)(5,2.1){ x dup mul y dup mul add 4 sub } \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 +\psplotImp[linewidth=2pt,linecolor=blue,algebraic](-5,-3)(4,2.4){ (x+1)^2+y^2-4 } \end{pspicture*} \end{LTXexample} @@ -1406,15 +1402,15 @@ for polar plots are also possible (see next example). \clearpage -\section{\Lcs{psVolume} -- Rotating functions around the x-axis} +\section{\nxLcs{psVolume} -- Rotating functions around the x-axis} This macro shows the behaviour of a \Index{rotated function} around the x-axis. -\begin{lstlisting}[style=syntax] -\psVolume[](xMin,xMax){}{} -\end{lstlisting} +\begin{BDef} +\Lcs{psVolume}\OptArgs\Largr{xMin,xMax}\Largb{steps}\Largb{function $f(x)$} +\end{BDef} -$f(x)$ has to be described as usual for the macro psplot. +$f(x)$ has to be described as usual for the macro \Lcs{psplot}. \makebox[\linewidth]{% \begin{pspicture}(-0.5,-2)(5,2.5) @@ -1533,9 +1529,9 @@ $f(x)$ has to be described as usual for the macro psplot. \section{\Lcs{psPrintValue}}\label{sec:printValue} This new macro allows to \Index{print} single values of a math function. It has the syntax -\begin{lstlisting}[style=syntax] -\psPrintValue[]{} -\end{lstlisting} +\begin{BDef} +\Lcs{psPrintValue}\OptArgs\Largb{PostScript code} +\end{BDef} Important is the fact, that \Lcs{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 @@ -1544,13 +1540,14 @@ 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 & & 10 & the font scale in pt\\ -valuewidth & & 10 & the width of the string for the converted +\begin{tabularx}{\linewidth}{@{}l|>{\ttfamily}l>{\ttfamily}lX@{}} +\textrm{name} & \textrm{value} & \textrm{default}\\\hline +\Lkeyword{PSfont} & PS font name & Times & only valid \PS font names are possible, e.g. + \Lps{Times-Roman}, \Lps{Helvetica}, \Lps{Courier}, \Lps{AvantGard}, \Lps{Bookman}\\ +\Lkeyword{fontscale} & & 10 & the font scale in pt\\ +\Lkeyword{valuewidth} & & 10 & the width of the string for the converted real number; if it is too small, no value is printed\\ -decimals & & -1 & the number of printed decimals, a negative value +\Lkeyword{decimals} & & -1 & the number of printed decimals, a negative value prints all possible digits.\\ \end{tabularx} @@ -1602,11 +1599,7 @@ decimals & & -1 & the number of printed decimals, a negative v \xkvview{family=pst-func,columns={key,type,default}} -\section{Credits} -Rafal Bartczuk | Gerry Coombes | Denis Girou | Christophe Jorssen | Manuel Luque | Timothy Van Zandt -and \url{http://mathworld.wolfram.com} -\printindex \bgroup \raggedright @@ -1614,6 +1607,11 @@ and \url{http://mathworld.wolfram.com} \bibliographystyle{plain} \bibliography{pst-func-doc} \egroup + +\printindex + + + \end{document} -- cgit v1.2.3