diff options
author | Karl Berry <karl@freefriends.org> | 2008-06-14 23:12:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-06-14 23:12:09 +0000 |
commit | 1b839cac605520b4304daee2b100f17d559d70fd (patch) | |
tree | 69387c208249272ddf9b844ebb69407b0c26d905 /Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex | |
parent | 9730d4afc5aab909a3458657d73cba817cf1e3da (diff) |
pst-func update (14jun08)
git-svn-id: svn://tug.org/texlive/trunk@8736 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-func/pst-func-doc.tex | 151 |
1 files changed, 141 insertions, 10 deletions
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 c8193b69342..ddf50223156 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 @@ -10,6 +10,7 @@ \usepackage{longtable} %\usepackage{fancyhdr} %\pagestyle{fancy} +\usepackage{xkvview} \usepackage{pstricks} \usepackage{pst-func} \let\pstFuncFV\fileversion @@ -18,7 +19,7 @@ \usepackage{babel} \usepackage{showexpl} \lstset{pos=t,wide=true,language=PSTricks, - morekeywords={psGammaDist,psChiIIDist,psTDist,psFDist,psBetaDist,psPlotImpl}} + morekeywords={psGammaDist,psChiIIDist,psTDist,psFDist,psBetaDist,psPlotImpl},basicstyle=\small\ttfamily} \lstdefinestyle{syntax}{backgroundcolor=\color{blue!20},numbers=none,xleftmargin=0pt,xrightmargin=0pt, frame=single} % @@ -42,6 +43,7 @@ plotting special mathematical functions\\[5mm] % 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, @@ -185,8 +187,8 @@ changed in the usual way. \endgroup - -\section{\CMD{psPolynomial}} +\section{Polynomials} +\subsection{\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\\ @@ -364,7 +366,98 @@ options can be set in the usual way with \verb+\psset+. \end{pspicture*} \end{LTXexample} +\clearpage +\subsection{\CMD{psBernstein}} +The polynomials defined by +% +\[ B_{i,n}(t)=\binom{n}{i}t^i(1-t)^{n-i} \] +% +where $\tbinom{n}{k}$ is a binomial coefficient are named Bernstein polynomials of degree $n$. +They form a basis for the power polynomials of degree $n$. +The Bernstein polynomials satisfy symmetry +\[B_{i,n}(t)=B_{n-i,n}(1-t)\] +positivity \[B_{i,n}(t)\ge0 \mbox{\qquad for } 0\le t\le1\] +normalization \[\sum_{i=0}^nB_{i,n}(t)=1\] +and $B_{i,n}$ with $i!=0$, $n$ has a single unique local maximum of +\[i^in^{-n}(n-i)^{n-i}\binom{n}{i}\] +occurring at $t=\frac{i}{n}$. +The envelope $f_n(x)$ of the Bernstein polynomials $B_{i,n}(x)$ for $i=0,1,\ldots,n$ +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[<options>](tStart,tEnd)(i,n) +\end{lstlisting} + +The \verb=(tStart,tEnd)= are \emph{optional} and preset by \verb=(0,1)=. The only new optional +argument is the boolean key \texttt{envelope}, which plots the envelope curve instead +of the Bernstein polynomial. + +\begin{LTXexample}[width=5cm,pos=l] +\psset{xunit=4.5cm,yunit=3cm} +\begin{pspicture}(1,1.1) + \psaxes{->}(0,0)(1,1)[$t$,0][$B_{0,0}$,90] + \psBernstein[linecolor=red,linewidth=1pt](0,0) +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=5cm,pos=l] +\psset{xunit=4.5cm,yunit=3cm} +\begin{pspicture}(1,1.1) + \psaxes{->}(0,0)(1,1)[$t$,0][$B_{i,1}$,90] + \psBernstein[linecolor=blue,linewidth=1pt](0,1) + \psBernstein[linecolor=blue,linewidth=1pt](1,1) +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=5cm,pos=l] +\psset{xunit=4.5cm,yunit=3cm} +\begin{pspicture}(1,1.1) + \psaxes{->}(0,0)(1,1)[$t$,0][$B_{i,2}$,90] + \multido{\i=0+1}{3}{\psBernstein[linecolor=red, + linewidth=1pt](\i,2)} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=5cm,pos=l] +\psset{xunit=4.5cm,yunit=3cm} +\begin{pspicture}(1,1.1) + \psaxes{->}(0,0)(1,1)[$t$,0][$B_{i,3}$,90] + \multido{\i=0+1}{4}{\psBernstein[linecolor=magenta, + linewidth=1pt](\i,3)} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=5cm,pos=l] +\psset{xunit=4.5cm,yunit=3cm} +\begin{pspicture}(1,1.1) + \psaxes{->}(0,0)(1,1)[$t$,0][$B_{i,4}$,90] + \multido{\i=0+1}{5}{\psBernstein[linecolor=cyan, + linewidth=1pt](\i,4)} +\end{pspicture} +\end{LTXexample} +\begin{LTXexample}[width=5cm,pos=l] +\psset{xunit=4.5cm,yunit=3cm} +\begin{pspicture}(-0.1,-0.05)(1.1,1.1) + \multido{\i=0+1}{20}{\psBernstein[linecolor=green, + linewidth=1pt](\i,20)} + \psBernstein[envelope,linecolor=black](0.02,0.98)(0,20) + \psaxes{->}(0,0)(1,1)[$t$,0][$B_{i,20}$,180] +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=5cm,pos=l] +\psset{xunit=4.5cm,yunit=3cm} +\begin{pspicture*}(-0.2,-0.05)(1.1,1.1) + \psaxes{->}(0,0)(1,1)[$t$,0][$B_{env}$,180] + \multido{\i=2+1}{20}{\psBernstein[envelope, + linewidth=1pt](0.01,0.99)(0,\i)} +\end{pspicture*} +\end{LTXexample} + + +\psset{unit=1cm} \clearpage \section{\CMD{psFourier}} @@ -1083,7 +1176,7 @@ used as a prior distribution for binomial proportions in Bayesian analysis. % %The plots are for various values of ($\alpha,\beta$) with $\alpha=1$ and $\beta$ ranging from 0.25 to 3.00. % -The domain is [0,1], and the probability function P(x) is given by +The domain is $[0,1]$, and the probability function $P(x)$ is given by % \[ P(x) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}(1-x)^{\beta-1}x^{\alpha-1} @@ -1102,8 +1195,8 @@ and has the syntax (with a default setting of $\alpha=1$ and $\beta=1$): \psset{xunit=10cm,yunit=5cm} \begin{pspicture*}(-0.1,-0.1)(1.1,2.05) \psset{linewidth=1pt} - \multido{\rbeta=0.25+0.25,\ired=0+5,\iblue=50.0+-2.5}{20}{% - \psBetaDist[beta=\rbeta,linecolor=red!\ired!blue!\iblue]{0.01}{0.99}} + \multido{\rbeta=0.25+0.25,\ired=0+5,\rblue=50.0+-2.5}{20}{% + \psBetaDist[beta=\rbeta,linecolor=red!\ired!blue!\rblue]{0.01}{0.99}} \psaxes[Dy=0.2,Dx=0.1]{->}(0,0)(1,2.01) \end{pspicture*} \end{LTXexample} @@ -1190,9 +1283,40 @@ and unit. \end{LTXexample} \egroup + \clearpage +\section{\CMD{psThomae} -- the popcorn function} + +Thomae's function, also known as the popcorn function, +the raindrop function, the ruler function or the +Riemann function, is a modification of the 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} + +\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. + +\begin{LTXexample}[width=6cm,wide=false] +\psset{unit=4cm} +\begin{pspicture}(-0.1,-0.2)(2.5,1.15) + \psaxes{->}(0,0)(2.5,1.1) + \psThomae[dotsize=2.5pt,linecolor=red](0,2){300} +\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 @@ -1433,16 +1557,18 @@ PSfont & PS font name & Times & only valid \PS font names are possible, e 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\\ +decimals & <number> & -1 & the number of printed decimals, a negative value + prints all possible digits.\\ \end{tabularx} \begin{center} \psset{fontscale=12} -\makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[5em]{$\cos x$} +\makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[4em]{$\cos x$}\hspace{1em} \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[4em][r]{\psPrintValue[PSfont=Courier,fontscale=10,decimals=3]{\iA\space cos}}\hspace{1em} \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}}\\} @@ -1452,12 +1578,12 @@ valuewidth & <number> & 10 & the width of the string for the converted \begin{lstlisting} \psset{fontscale=12} -\makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[5em]{$\cos x$} +\makebox[2em]{x(deg)} \makebox[5em]{$\sin x$} \makebox[4em]{$\cos x$}\hspace{1em} \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[4em][r]{\psPrintValue[PSfont=Courier,fontscale=10,decimals=3]{\iA\space cos}\hspace{1em}} \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}}\\} @@ -1477,6 +1603,11 @@ valuewidth & <number> & 10 & the width of the string for the converted \end{pspicture} \end{LTXexample} +\clearpage +\section{List of all optional arguments for \texttt{pst-func}} + +\xkvview{family=pst-func,columns={key,type,default}} + \section{Credits} Rafal Bartczuk | Gerry Coombes | Denis Girou | Christophe Jorssen | Manuel Luque | Timothy Van Zandt |