summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-06-18 23:45:22 +0000
committerKarl Berry <karl@freefriends.org>2006-06-18 23:45:22 +0000
commit2ef3bb4ab770c443b91f054a4673d09e037f02e1 (patch)
tree0f812adb085812f117304b04e8542c5e563317ca /Master
parent3582a525889b15447695e2542f4a5e5b6e7669d9 (diff)
pstricks-add update, pro0.08 tex2.75
git-svn-id: svn://tug.org/texlive/trunk@1698 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/Changes166
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib (renamed from Master/texmf-dist/doc/generic/pstricks-add/pstricks.bib)34
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.ltx51
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdfbin1463232 -> 1489281 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex2322
-rw-r--r--Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro1319
-rw-r--r--Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex1030
-rw-r--r--Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty1
-rw-r--r--Master/texmf-dist/tpm/pstricks-add.tpm8
-rw-r--r--Master/texmf/lists/pstricks-add2
10 files changed, 3434 insertions, 1499 deletions
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/Changes b/Master/texmf-dist/doc/generic/pstricks-add/Changes
index 73ef5a8beeb..70efedc3cbf 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/Changes
+++ b/Master/texmf-dist/doc/generic/pstricks-add/Changes
@@ -1,4 +1,8 @@
pstricks-add.pro ----------- (Dominik Rodriguez/hv)
+ v 0.08 2006-06-17 more improvements to the code (hv)
+ v 0.07 2006-04-03 remove whitespace (dr)
+ v 0.06 2006-01-16 EXP -> Exp, to prevent missmatch with pst-math (hv)
+ v 0.05 2005-11-12 fix bug in GTriangle (hv)
v 0.04 2005-10-06 added subroutines for calculating wavelength to rgb color(hv)
changing name of pst-eqdf.pro to pstricks-add.pro
v 2005.03 2005/05/16 (hv) small changes to the code
@@ -6,74 +10,98 @@ pstricks-add.pro ----------- (Dominik Rodriguez/hv)
v 2004.02 2004/11/14 (dr) correction of a priority problem ^ before unary - (new rule FS)
v 2004.01 2004/09/14 (dr) initial version
+
pstricks-add -----------
- v 2.70 2005-10-20 - use \def instead of \edef for X|YAxisLabel
- - make psgraph correct use of the origin values
- - added a new macro \psLNode and \nlput for a
- node label with absolute position
- v 2.69 2005-10-12 moving the basic arrows into pstricks )-(,]-[
- bugfix for hook arrow
- v 2.68 2005-10-09 fix a bug with trigLabels and showorigin
- v 2.67 2005-10-08 rewrote \psrotate macro
- added three predefined hatchstyles for simulating transparent colors
- TRed, TGreen,TBlue
+ v 2.75 2006-06-17 - plot a derivative of a function by the equation or numerical
+ (\psplot and \paramericplot)
+ - delete macro \psLineIII and the two special options
+ - add macro \psMatrixPlot
+ - option trigLabelBase for advanced setting of trogonometrical
+ x-axis labels
+ - option labelFontSize
+ - fix introduced bug with Hook arrow and (-)
+ - fix bug for Hook arrow with ArrowInside option
+ - fix bug with readdata
+ - revert all changes
+ - fix a bug with lines and psgraph
+ v 2.74 2006-01-02 - add \psdice
+ v 2.73 2005-12-21 - renaming the \setLNode and \setLCNode to
+ \psLNode and \psLCNode.
+ new macro \psLDNode
+ - add missing fillstyle for \psStep
+ - add StepType Riemann
+ v 2.72 2005-11-27 - fix introduced bug in psgraph
+ - add new macro \psStep with new option StepType
+ v 2.71 2005-10-24 - use \def instead of \edef for subtickcolor
+ and also using \pst@getcolor
+ - fix bug with Ox and log axes
+ v 2.70 2005-10-20 - use \def instead of \edef for X|YAxisLabel
+ - make psgraph correct use of the origin values
+ - added a new macro \psLNode and \nlput for a
+ node label with absolute position
+ v 2.69 2005-10-12 moving the basic arrows into pstricks )-(,]-[
+ bugfix for hook arrow
+ v 2.68 2005-10-09 fix a bug with trigLabels and showorigin
+ v 2.67 2005-10-08 rewrote \psrotate macro
+ added three predefined hatchstyles for simulating transparent colors
+ TRed, TGreen,TBlue
v 2.66 2005-10-06 add more support for Gouraud-shading, emulate the PS subroutines
- if not present in the PS level
- v 2.65 2005-10-03 add support for Gouraud-shading
- v 2.64 2005-09-25 fix a bug in reading ticksize values (\pst@getdimdim}
- v 2.63 2005-09-18 fix another bug with option names
- v 2.62 2005-09-08 fix new introduced bug in \psbrace
- v 2.61 2005-09-08 fix bug in \psbrace
- v 2.60 2005-08-28 added some more line fill styles
- v 2.59 2005-08-06 bugfix for option intSeparator
- add macro \psrotate
- v 2.58 2005-07-25 ArrowInside=- for \psbrace
- v 2.57 2005-07-07 some improvements to psgraph
- v 2.56 2005-06-25 fix bug with \pscustom and poynom
- fix introduced trailing space in \readdata
- v 2.55 2005-05-26 some tweeks to the code, updating the documentation
- v 2.54 2005-05-25 added option ChangeOrder
- v 2.53 2005-05-23 dito
- v 2.52 2005-05-22 fix bug in psplotTangent
- v 2.51 2005-05-21 drop support of option varStep
- v 2.50 2005-05-20 first try with psplotDiffEqn, plotting differential equation,
- needs _newest_ pst-eqdf.pro and pstricks.pro
- v 2.49 2005-05-19 fix bug in psplotTangent and make option showpointa available
- v 2.48 2005-05-18 fix some new introduced bugs and make psplotTangent for all
- plot macros working
- v 2.47 2005-05-17 make psplotTangens also available for the parametric plot
- together with the algebraic option
- v 2.46 2005-05-16 make psplotTangens also available for the polarplot and
- algebraic option
- v 2.45 2005-05-16 small changes to the code
- v 2.44 2005-05-15 added macro psplotTangent
- v 2.43 2005-04-20 some more tweeks to triglabels
- v 2.42 2005-04-17 small bugfix with the options
- v 2.41 2005-04-17 new option ignoreLines for \readdata
- v 2.40 2005-04-13 new option trigLabels
- v 2.39 2005-03-17 modify the Rhook subroutine (abs)
- v 2.38 2005-03-03 move the loading of a config file into pstricks-add.sty
- v 2.37 2005-02-20 drop support of tickstyle (pst-plot),
- fix several bugs in connection with the ticksize option
- minor code changes
- v 2.36 2005-02-20 added missing LabelFactor
- v 2.35 2005-02-19 small improvements
- v 2.34 2005-02-10 fix bug with comma
- v 2.33 2005-01-18 add a config file
- v 2.32 2005-01-16 added hook arrow (for bond lines)
- v 2.31 2004-12-11 activate \pslinestyle for the axes
- v 2.30 2004-12-07 make xyAxes run
- v 2.29 2004-12-04 spurious blank in ArrowInside
- v 2.28 2004-11-23 small changes to the code
- v 2.27 2004-11-19 tickstyle now a pstricks-add key
- v 2.26 2004-11-17 spurious blank in \psbrace
- v 2.25 2004-11-13 fixed a new introduced bug
- v 2.24 2004-11-12 added the psRandom macro for random dots
- v 2.23 2004-11-11 added the star option for psgraph
- v 2.22 2004-11-04 fixed bug with \psset
- v 2.21 2004-10-24 added \psParallelLine for lines parallel to another one
- added \psIntersectionPoint(#1)(#2)(#3)(#4){nodeName}
- v 2.20 2004-10-24 added \psRelLine for lines relative to another one
- v 2.19 2004-10-20 small changes
- v 2.18 2004-10-20 add \ncbarr
- v 2.17 2004-10-14 new multiple arrows
+ if not present in the PS level
+ v 2.65 2005-10-03 add support for Gouraud-shading
+ v 2.64 2005-09-25 fix a bug in reading ticksize values (\pst@getdimdim}
+ v 2.63 2005-09-18 fix another bug with option names
+ v 2.62 2005-09-08 fix new introduced bug in \psbrace
+ v 2.61 2005-09-08 fix bug in \psbrace
+ v 2.60 2005-08-28 added some more line fill styles
+ v 2.59 2005-08-06 bugfix for option intSeparator
+ add macro \psrotate
+ v 2.58 2005-07-25 ArrowInside=- for \psbrace
+ v 2.57 2005-07-07 some improvements to psgraph
+ v 2.56 2005-06-25 fix bug with \pscustom and poynom
+ fix introduced trailing space in \readdata
+ v 2.55 2005-05-26 some tweeks to the code, updating the documentation
+ v 2.54 2005-05-25 added option ChangeOrder
+ v 2.53 2005-05-23 dito
+ v 2.52 2005-05-22 fix bug in psplotTangent
+ v 2.51 2005-05-21 drop support of option varStep
+ v 2.50 2005-05-20 first try with psplotDiffEqn, plotting differential equation,
+ needs _newest_ pst-eqdf.pro and pstricks.pro
+ v 2.49 2005-05-19 fix bug in psplotTangent and make option showpointa available
+ v 2.48 2005-05-18 fix some new introduced bugs and make psplotTangent for all
+ plot macros working
+ v 2.47 2005-05-17 make psplotTangens also available for the parametric plot
+ together with the algebraic option
+ v 2.46 2005-05-16 make psplotTangens also available for the polarplot and
+ algebraic option
+ v 2.45 2005-05-16 small changes to the code
+ v 2.44 2005-05-15 added macro psplotTangent
+ v 2.43 2005-04-20 some more tweeks to triglabels
+ v 2.42 2005-04-17 small bugfix with the options
+ v 2.41 2005-04-17 new option ignoreLines for \readdata
+ v 2.40 2005-04-13 new option trigLabels
+ v 2.39 2005-03-17 modify the Rhook subroutine (abs)
+ v 2.38 2005-03-03 move the loading of a config file into pstricks-add.sty
+ v 2.37 2005-02-20 drop support of tickstyle (pst-plot),
+ fix several bugs in connection with the ticksize option
+ minor code changes
+ v 2.36 2005-02-20 added missing LabelFactor
+ v 2.35 2005-02-19 small improvements
+ v 2.34 2005-02-10 fix bug with comma
+ v 2.33 2005-01-18 add a config file
+ v 2.32 2005-01-16 added hook arrow (for bond lines)
+ v 2.31 2004-12-11 activate \pslinestyle for the axes
+ v 2.30 2004-12-07 make xyAxes run
+ v 2.29 2004-12-04 spurious blank in ArrowInside
+ v 2.28 2004-11-23 small changes to the code
+ v 2.27 2004-11-19 tickstyle now a pstricks-add key
+ v 2.26 2004-11-17 spurious blank in \psbrace
+ v 2.25 2004-11-13 fixed a new introduced bug
+ v 2.24 2004-11-12 added the psRandom macro for random dots
+ v 2.23 2004-11-11 added the star option for psgraph
+ v 2.22 2004-11-04 fixed bug with \psset
+ v 2.21 2004-10-24 added \psParallelLine for lines parallel to another one
+ added \psIntersectionPoint(#1)(#2)(#3)(#4){nodeName}
+ v 2.20 2004-10-24 added \psRelLine for lines relative to another one
+ v 2.19 2004-10-20 small changes
+ v 2.18 2004-10-20 add \ncbarr
+ v 2.17 2004-10-14 new multiple arrows
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks.bib b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib
index f99ba002003..36183a7a366 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks.bib
+++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib
@@ -14,6 +14,40 @@
@STRING{theaterkasse = {Von der Theaterkasse} }
@STRING{theatertage = {{\TeX}-Theatertage} }
+@Book{PSTricks2,
+ author = {Herbert Vo\ss},
+ title = {{\PST} {G}rafik f\"ur \TeX{} und \LaTeX},
+ edition = {third},
+ publisher = {DANTE -- Lehmanns},
+ year = {2006},
+ address = {Heidelberg/Hamburg}
+}
+
+@Book{companion04,
+ author = {Frank Mittelbach and Michel Goosens et al},
+ title = {The {\LaTeX} {G}raphics {C}ompanion},
+ edition = {second},
+ publisher = {Addison-Wesley Publishing Company},
+ year = {2004},
+ address = {Boston}
+}
+
+@Book{begleiter05,
+ author = {Frank Mittelbach and Michel Goosens et al},
+ title = {Der {\LaTeX} {B}egleiter},
+ edition = {zweite},
+ publisher = {Pearson Education},
+ year = {2005},
+ address = {München}
+}
+
+@Book{unbound,
+ author = {Alan Hoenig},
+ title = {\TeX{} {U}nbound: \LaTeX{} \& \TeX{} {S}trategies, {F}onts, {G}raphics, and {M}ore},
+ publisher = {Oxford University Press},
+ year = {1998},
+ address = {London}
+}
@Article{ dtk02.2:jackson.voss:plot-funktionen,
author = {Laura E. Jackson and Herbert Vo{\ss}},
title = {Die Plot-Funktionen von {\texttt{pst-plot}}},
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.ltx b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.ltx
index 4e41c58017e..d0870fd3bf5 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.ltx
+++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.ltx
@@ -85,25 +85,23 @@
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
-\usepackage{lmodern}
-%\usepackage[scaled]{luximono}
-\usepackage[lmargin=2.5cm]{geometry}
+\usepackage{pamathx}
+\usepackage[scaled]{luximono}
+%\usepackage{mathptmx}
+\usepackage[lmargin=2.5cm,bmargin=3cm]{geometry}
\usepackage{tabularx}
-\usepackage{url}
\usepackage{graphicx}
-\usepackage[dvipsnames]{pstricks}
-\usepackage{framed}
+\usepackage[svgnames,dvipsnames]{pstricks}
+\usepackage{framed,xspace,multirow,caption}
\usepackage{pst-eucl}
\usepackage{pstricks-add}
\let\pstricksaddFV\fileversion
\def\PST{\texttt{PSTricks}}
+\newcommand*\PostScript{\textsf{PostScript}\xspace}
%
-\usepackage{showexpl}
-\lstset{preset=\raggedright}
%
\usepackage{longtable}
\usepackage{pifont}
-\usepackage{amsmath}
\def\textat{\protect\makeatletter\texttt{@}\protect\makeatother}
\makeatletter
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.5em}}
@@ -115,11 +113,6 @@
\let\psEllipticArc\psellipticarc
\let\psEllipticArcN\psellipticarcn
\let\psWedgeEllipse\psellipticwedge
-\usepackage[colorlinks,linktocpage]{hyperref}
-%\def\UrlFont{\small\ttfamily}
-\makeatletter
-\def\verbatim@font{\small\normalfont\ttfamily}
-\makeatother
%\parindent=0pt
\newcommand\verbI[1]{{\small\texttt{#1}}}
\newcommand\CMD[1]{{\texttt{\textbackslash#1}}}
@@ -149,7 +142,37 @@
\parindent=0pt
\parskip=1ex plus 5pt
+
+\usepackage[colorlinks,linktocpage]{hyperref}
+\makeatletter
+\def\verbatim@font{\small\normalfont\ttfamily}
+\makeatother
+\usepackage{showexpl}
+\lstset{preset=\raggedright}
+\usepackage{amsmath}
+
+\newdimen\fullWidth
+\makeatletter
+\renewcommand\ON{%
+ \gdef\lst@alloverstyle##1{%
+ \fboxrule=0pt
+ \fboxsep=0pt
+ \fcolorbox{DarkBlue}{DarkBlue}{\textcolor{white}{\bfseries\strut##1}}%
+}}
+\renewcommand\OFF{%
+ \xdef\lst@alloverstyle##1{##1}%
+}
+
+\makeatother
+\lstset{escapechar=§}
+
\begin{document}
+\fullWidth=\linewidth
+\advance\fullWidth by \marginparsep
+\advance\fullWidth by \marginparwidth
+
+
\input{pstricks-add-doc}
+
\end{document}
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
index 549cb053d4f..9bd2937fb23 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
index ccd7eacda14..e86490290f3 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
+++ b/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
@@ -5,7 +5,7 @@
% was build with VTeX/Free (\url{http://www.micropress-inc.com/linux})}
\\
\small v.\pstricksaddFV}
-\author{Herbert Vo\ss}
+\author{Dominique Rodriguez and Herbert Vo\ss}
\date{\today}
\maketitle
@@ -24,9 +24,8 @@ a lot of the macros won't work in the expected way.
\item \verb+pstricks-add+ uses the extended version of the keyval package. So be sure, that
you have installed \verb+pst-xkey+ which is part of the \verb+xkeyval+-package and that all
packages, that uses the old keyval interface are loaded \textbf{before} the \verb+xkeyval+.\cite{xkeyval}
-\item the option \verb+tickstyle+ from \verb+pst-plot+is no more supported, use \verb+ticksize+ instead.
-\item the option \verb+xyLabel+ is no more supported, use the macros \verb+\def\pshlabel#1{...}+ and
- \verb+\def\psvlabel#1{...}+ instead.
+\item the option \verb+tickstyle+ from \verb+pst-plot+ is no more supported, use \verb+ticksize+ instead.
+\item the option \verb+xyLabel+ is no more supported, use the option \verb+labelFontSize+ instead.
\end{itemize}
\end{abstract}
@@ -39,9 +38,6 @@ packages, that uses the old keyval interface are loaded \textbf{before} the \ver
\part{\texttt{pstricks}}
%--------------------------------------------------------------------------------------
-
-
-
%--------------------------------------------------------------------------------------
\section{Numeric functions}
%--------------------------------------------------------------------------------------
@@ -165,7 +161,7 @@ It makes some sense to define a new macroname in the preamble to use it througho
%--------------------------------------------------------------------------------------
\section{Dashed Lines}
%--------------------------------------------------------------------------------------
-Tobias N�ring implemented an enhanced feature for dashed lines. The number
+Tobias Nähring implemented an enhanced feature for dashed lines. The number
of arguments is no more limited.
\begin{verbatim}
@@ -227,13 +223,15 @@ macro.
\psdots[linecolor=red,dotscale=1.5](2,1)
\psarc[linecolor=red,linewidth=0.4pt,showpoints=true]
{->}(2,1){3}{0}{60}
- \pspolygon[linecolor=green](2,1)(5,1.1)(6,-1)(2,-2)
- \psrotate[linecolor=blue](2,1){60}{
+ \pspolygon[linecolor=green,linewidth=1pt](2,1)(5,1.1)(6,-1)(2,-2)
+ \psrotate[linecolor=blue,linewidth=1pt](2,1){60}{
\pspolygon(2,1)(5,1.1)(6,-1)(2,-2)}
\end{pspicture}
\end{LTXexample}
+\clearpage
+\iffalse
%--------------------------------------------------------------------------------------
\section{\CMD{pslineII}: Colored lines}
%--------------------------------------------------------------------------------------
@@ -266,8 +264,6 @@ name & meaning\\\hline
\verb|dashNo| can have values greater than $1$. In this case the value will be taken as an absolute width in the pt unit. Only this unit is possible!
-\subsection{Examples}
-
\begin{LTXexample}[width=3.5cm]
\psset{linewidth=2pt}
\begin{pspicture}(3,3)
@@ -297,17 +293,6 @@ name & meaning\\\hline
\end{pspicture}
\end{LTXexample}
-\begin{LTXexample}
-\psset{linecolor=red,arrowscale=3}
-\psset{dashColorI=red,dashColorII=blue,dashNo=20,linewidth=2pt}
-\begin{pspicture}(0,0)(7,-5)
-\pslineII{<->}(0,0)(7,0)(7,-5)(0,-5)
-\pslineII[linewidth=5pt,%
- dashNo=0.1,arrowscale=2]{o-o}(0,-2.5)(7,-2.5)
-\end{pspicture}
-\end{LTXexample}
-
-
\begin{LTXexample}[pos=t]
\psset{linewidth=15pt,dashNo=10}
\begin{pspicture}(0,1)(10,-6)
@@ -319,72 +304,10 @@ name & meaning\\\hline
\end{pspicture}
\end{LTXexample}
-
-%--------------------------------------------------------------------------------------
-\section{\CMD{pslineIII} Variable linewidth}
-%--------------------------------------------------------------------------------------
-By default all lines have a fixed width. \verb|\pslineIII| allows to
-define the start and the end width of a line. It has the same syntax as \verb|\psline|.
-
-\begin{center}
-\begin{pspicture}(0,-0.5)(12,0.5)
-\pslineIII[wBegin=1cm,wEnd=0.3cm,linecolor=cyan](0,0)(12,0)
-\end{pspicture}
-\end{center}
-
-\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
-\pslineIII[wBegin=1cm,wEnd=0.3cm,linecolor=cyan](0,0)(12,0)
-\end{lstlisting}
-
-
-
-%--------------------------------------------------------------------------------------
-\subsection{The options}
-%--------------------------------------------------------------------------------------
-
-\begin{center}
-\begin{tabular}{l|p{8cm}}
-name & meaning\\\hline
-\verb|wBegin| & first width, default is \verb|\pslinewidth|\tabularnewline
-\verb|wEnd| & last width, default is \verb|\pslinewidth|\tabularnewline
-\end{tabular}
-\end{center}
-
-It is also possible to use \verb|pslineIII| with more than two coordinates, like
-
-\begin{center}
-\begin{pspicture}(0,-0.5)(12,2)
-\pslineIII[wBegin=1cm,wEnd=0.1cm,linecolor=red](0,0)(3,1.5)(9,1.5)(12,0)
-\end{pspicture}
-
-\end{center}
-\begin{lstlisting}[basicstyle=\ttfamily\footnotesize]
-\pslineIII[wBegin=1cm,wEnd=0.1cm,linecolor=cyan](0,0)(0,1.5)(12,1.5)(12,0)
-\end{lstlisting}
-
-\iffalse
-%--------------------------------------------------------------------------------------
-\subsection{Examples}
-%--------------------------------------------------------------------------------------
-
-\begin{LTXexample}
-\begin{pspicture}(-5,-5)(5,5)
- \psgrid[griddots=10, gridlabels=7pt, subgriddiv=0]
-%
- \pslineIII[wBegin=1cm,wEnd=0.2cm,linecolor=cyan]%
- (-4,4)(3,4)(5,2)(2,-5)(-5,-2)(-5,0)
- \pslineIII[wBegin=0.5cm](-5,-3)(5,3)
- \pslineIII[wBegin=0.5cm,wEnd=0.1cm,linecolor=red](0,-5)(0,0)(0,5)
- \pslineIII[wBegin=1cm,wEnd=0.3cm,linecolor=blue](-4,4)(5,-4)
-%
-\end{pspicture}
-\end{LTXexample}
-
\clearpage
\fi
-
%--------------------------------------------------------------------------------------
\section{\CMD{psbrace}}
%--------------------------------------------------------------------------------------
@@ -432,7 +355,7 @@ or \verb|r| (right) and \verb|b| (bottom) or \verb|B| (Baseline) or \verb|C| (ce
or \verb|t| (top), where the default is \verb|c|, the center of the object.
%--------------------------------------------------------------------------------------
-\subsection{Examples}
+%\subsection{Examples}
%--------------------------------------------------------------------------------------
\begin{LTXexample}
@@ -469,9 +392,9 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object.
\end{LTXexample}
-\begin{LTXexample}
-\def\someMath{$\int\limits_1^{\infty}\frac{1}{x^2}\,dx=1$}
-\begin{pspicture}(12,11)
+\begin{LTXexample}[width=8cm,wide]
+\psset{unit=0.8}
+\begin{pspicture}(10,11)
\psgrid[subgriddiv=0,griddots=10]
\pnode(0,0){A}
\pnode(4,6){B}
@@ -480,7 +403,7 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object.
\psbrace[linecolor=blue,bracePos=0.25,braceWidth=1,ref=lB](8,1)(1,7){Three}
\psbrace[braceWidth=-1,rot=180,ref=rB](8,1)(1,7){Four}
\psbrace[linearc=0.5,linecolor=red,linewidth=3pt,braceWidth=1.5,%
- bracePos=0.25,ref=lC](8,1)(8,9){\someMath}
+ bracePos=0.25,ref=lC](8,1)(8,9){A}
\psbrace(4,9)(6,9){}
\psbrace(6,9)(6,7){}
\psbrace(6,7)(4,7){}
@@ -495,7 +418,7 @@ or \verb|t| (top), where the default is \verb|c|, the center of the object.
%$
-\begin{LTXexample}[width=5cm]
+\begin{LTXexample}[wide,width=5cm]
\[
\begin{pmatrix}
\Rnode[vref=2ex]{A}{~1} \\
@@ -599,6 +522,7 @@ Some nonsense text, which is nothing more than nonsense.
\end{framed}
\end{lstlisting}
+\clearpage
%--------------------------------------------------------------------------------------
\section{Random dots}
@@ -660,6 +584,60 @@ name & default\\\hline
\psset{unit=1cm}
\clearpage
+%% %--------------------------------------------------------------------------------------
+%% \section{Dice}
+%% %--------------------------------------------------------------------------------------
+%% \CMD{psdice} creates the view of a dice. The number on the dice is the only parameter.
+%% The optional parameters, like the color can be used as usual. The macro is a box of
+%% dimension zero and is placed
+%% at the current point. Use the \CMD{rput} macro to place it anywhere. The only
+%% special option name is \verb+dicescale+, with a default setting of \verb+1+. In this
+%% case the dice has a size of $1\mathrm{cm}\times1\mathrm{cm}$.
+%%
+%% \begin{center}
+%% \begin{pspicture}(-1,-1)(8,8)
+%% \multido{\iA=1+1}{6}{%
+%% \rput(\iA,7.5){\Huge\psdice[dicescale=0.75,linecolor=red]{\iA}}
+%% \rput(! -0.5 7 \iA\space sub){\Huge\psdice[dicescale=0.75,linecolor=green]{\iA}}%
+%% \multido{\iB=1+1}{6}{%
+%% \fpAdd{\iA}{\iB}{\iSum}
+%% \pnode(! \iA\space 7 \iB\space sub ){p\iA\iB}
+%% \rput(! \iA\space 7 \iB\space sub){\iSum}
+%% }}
+%% %
+%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dashed]{p15}{p51}
+%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dotted]{p11}{p66}
+%% \rput{90}(-1.5,3.5){1. dice}
+%% \rput{0}(3.5,8.5){2. dice}
+%% \psline[linewidth=1.5pt](0.25,0.5)(0.25,8)
+%% \psline[linewidth=1.5pt](-1,6.75)(6.5,6.75)
+%% %
+%% \end{pspicture}
+%% \end{center}
+%%
+%% \begin{lstlisting}
+%% \begin{pspicture}(-1,-1)(8,8)
+%% \multido{\iA=1+1}{6}{%
+%% \rput(\iA,7.5){\Huge\psdice[dicescale=0.75,linecolor=red]{\iA}}
+%% \rput(! -0.5 7 \iA\space sub){\Huge\psdice[dicescale=0.75,linecolor=green]{\iA}}%
+%% \multido{\iB=1+1}{6}{%
+%% \fpAdd{\iA}{\iB}{\iSum}
+%% \pnode(! \iA\space 7 \iB\space sub ){p\iA\iB}
+%% \rput(! \iA\space 7 \iB\space sub){\iSum}
+%% }}
+%% %
+%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dashed]{p15}{p51}
+%% \ncbox[linearc=0.35,nodesep=0.4,linestyle=dotted]{p11}{p66}
+%% \rput{90}(-1.5,3.5){1. dice}
+%% \rput{0}(3.5,8.5){2. dice}
+%% \psline[linewidth=1.5pt](0.25,0.5)(0.25,8)
+%% \psline[linewidth=1.5pt](-1,6.75)(6.5,6.75)
+%% %
+%% \end{pspicture}
+%% \end{lstlisting}
+%%
+%%
+%% \clearpage
%--------------------------------------------------------------------------------------
\section{Arrows}
%--------------------------------------------------------------------------------------
@@ -696,6 +674,8 @@ name & default\\\hline
\egroup
\end{center}
+
+
You can also mix and match, e.g., \verb/->/, \verb/*-)/ and \verb/[->/ are all valid values
of the \verb|arrows| parameter. The parameter can be set with
\begin{verbatim}
@@ -726,6 +706,9 @@ is like the one described in the old PSTricks manual.
\end{tabular}
\end{center}
+
+
+
\begin{center}
\bgroup
\psset{linecolor=red,linewidth=1pt,arrowscale=2}%
@@ -750,8 +733,9 @@ is like the one described in the old PSTricks manual.
\egroup
\end{center}
-\subsection{\texttt{hookarrow}}
+\clearpage
+\subsection{\texttt{hookarrow}}
\begin{LTXexample}
\psset{arrowsize=8pt,arrowlength=1,linewidth=1pt,nodesep=2pt,shortput=tablr}
\large
@@ -774,6 +758,7 @@ $e_b:S$ & 1 & & 1 & 0 \\
\end{LTXexample}
+
\subsection{\texttt{hookrightarrow} and \texttt{hookleftarrow}}
This is another type of an arrow and abbreviated with \verb+H+. The length and width of the hook
is set by the new options \verb+hooklength+ and \verb+hookwidth+, which are by default set to
@@ -880,6 +865,12 @@ macro. If you want arrows with an abolute position difference, then choose a
value greater than \verb|1|, e.g. \verb|10| which places an arrow every 10 pt. The
default unit \verb|pt| cannot be changed.
+\noindent
+\begin{tabularx}{\linewidth}{@{\color{red}\vrule width 2pt}lX@{}}
+& The \verb+ArrowInside+ takes only arrow definitions like \verb+->+ into account.
+Arrows from right to left (\verb+<-+) are not possible and ignored. If you need
+such arrows, change the order of the pairs of coordinates for the line or curve macro.
+\end{tabularx}
%--------------------------------------------------------------------------------------
\subsection{\texttt{ArrowFill} Option}
@@ -1259,6 +1250,7 @@ These examples also need the package \verb|pst-node|.
\end{pspicture}
\end{LTXexample}
+\clearpage
%--------------------------------------------------------------------------------------
\section{\CMD{psFormatInt}}
%--------------------------------------------------------------------------------------
@@ -1284,7 +1276,7 @@ With the option \verb|intSeparator| the symbol can be changed to any any non-num
%--------------------------------------------------------------------------------------
%--------------------------------------------------------------------------------------
-\subsection{,,Tranparent colors''}
+\subsection{,,Transparent colors''}
%--------------------------------------------------------------------------------------
\verb+pstricks-add+ simulates transparency with hatch lines:
@@ -1480,7 +1472,7 @@ of calculating lighting for each pixel. The technique was first presented by Hen
\end{quotation}
PostScript level 3 supports this kind of shading and it could only be seen with Acroread 7
-or younger. Die Syntax ist relativ einfach
+or younger. Die Syntax is easy:
\begin{verbatim}
\psGTriangle(x1,y1)(x2,y2)(x3,y3){color1}{color2}{color3}
@@ -1521,6 +1513,8 @@ or younger. Die Syntax ist relativ einfach
%--------------------------------------------------------------------------------------
\part{\texttt{pst-node}}
%--------------------------------------------------------------------------------------
+
+\iffalse
\section{\CMD{nclineII}}
%--------------------------------------------------------------------------------------
The dashed lines are black and white by default. The new macro \verb|\nclineII|
@@ -1594,7 +1588,7 @@ like this connection from here\pnode{D}\pclineII{->}(D)(C){}
to the above word \verb|pstricks|.
\end{LTXexample}
-
+\fi
%--------------------------------------------------------------------------------------
\section{\CMD{ncdiag} and \CMD{pcdiag}}
@@ -1817,7 +1811,7 @@ two valid options:
\begin{tabularx}{\linewidth}{l|l|X}
name & default & meaning\\\hline
\verb|angle| & $0$ & angle between the given line $\overline{P_0P_1}$ and the new one
-$\overline{P_0P_endNode}$\tabularnewline
+$\overline{P_0P_{endNode}}$\tabularnewline
\verb+trueAngle+ & false & defines whether the angle depends to the seen line or to the
mathematical one, which respect the scaling factors \verb+xunit+ and \verb+yunit+.
\end{tabularx}
@@ -2052,14 +2046,15 @@ There is no special parameter here.
\end{pspicture}
\end{LTXexample}
+\clearpage
%--------------------------------------------------------------------------------------
-\section{\CMD{setLNode} and \CMD{setLCNode}}
+\section{\CMD{psLNode} and \CMD{psLCNode}}
%--------------------------------------------------------------------------------------
\CMD{psLNode} interpolates the Line $\overline{AB}$ by the given value and sets a node at this
point. The syntax is
%
\begin{verbatim}
-\setLNode(P1)(P2){value}{Node name}
+\psLNode(P1)(P2){value}{Node name}
\end{verbatim}
\begin{LTXexample}[width=5cm]
@@ -2067,11 +2062,11 @@ point. The syntax is
\psgrid[subgriddiv=0,griddots=10]
\psset{linecolor=red}
\psline{o-o}(1,1)(5,5)
-\setLNode(1,1)(5,5){0.75}{PI}
+\psLNode(1,1)(5,5){0.75}{PI}
\qdisk(PI){4pt}
\psset{linecolor=blue}
\psline{o-o}(4,3)(2,5)
-\setLNode(4,3)(2,5){-0.5}{PII}
+\psLNode(4,3)(2,5){-0.5}{PII}
\qdisk(PII){4pt}
\end{pspicture}
\end{LTXexample}
@@ -2083,7 +2078,7 @@ the new vector as a node. All vectors start at $(0,0)$, so a \verb+\rput+ maybe
The syntax is
%
\begin{verbatim}
-\setLCNode(P1){value 1}(P2){value 2}{Node name}
+\psLCNode(P1){value 1}(P2){value 2}{Node name}
\end{verbatim}
\begin{LTXexample}[width=5cm]
@@ -2094,7 +2089,7 @@ the new vector as a node. All vectors start at $(0,0)$, so a \verb+\rput+ maybe
\psline[linestyle=dashed]{->}(0.375,1.5)
\psset{linecolor=red}
\psline{->}(2,1)\psline{->}(0.5,2)
-\setLCNode(2,1){1.5}(0.5,2){0.75}{PI}
+\psLCNode(2,1){1.5}(0.5,2){0.75}{PI}
\psline[linewidth=2pt]{->}(PI)
\psset{linecolor=black}
\psline[linestyle=dashed](3,1.5)(PI)
@@ -2102,16 +2097,20 @@ the new vector as a node. All vectors start at $(0,0)$, so a \verb+\rput+ maybe
\end{pspicture}
\end{LTXexample}
+\clearpage
%--------------------------------------------------------------------------------------
-\section{\CMD{nlput}}
+\section{\CMD{nlput} and \CMD{psLDNode}}
%--------------------------------------------------------------------------------------
\CMD{ncput} allows to set a label relative to the first node of the last
node connection. With \CMD{nlput} this can be done absolute to a given
-node. The syntax is different to the other node connection makros.
+node. The syntax is different to the other node connection makros. It uses
+internally the macro \CMD{psLDNode} which places a node absolute to
+two given points, starting from the first one.
\begin{verbatim}
\nlput[options](A)(B){distance}{text}
+\psLDNode[options](A)(B){distance}{node name}
\end{verbatim}
@@ -2120,6 +2119,7 @@ node. The syntax is different to the other node connection makros.
\pnode(0,0){A}
\pnode(5,2){B}
\ncline{A}{B}
+\psLDNode(A)(B){1.5cm}{KN}\qdisk(KN){2pt}
\nlput[nrot=:U](A)(B){1cm}{Test}
\nlput[nrot=:D](A)(B){2cm}{Test}
\nlput[nrot=:U](A)(B){3cm}{Test}
@@ -2137,7 +2137,9 @@ node. The syntax is different to the other node connection makros.
\section{ New options}
%--------------------------------------------------------------------------------------
The option \verb+tickstyle=full|top|bottom+ is no more working in the \verb+pstricks-add+
-package, because everything can be set by the \verb+ticksize+ option.
+package, because everything can be set by the \verb+ticksize+ option. When using the
+\verb+comma+ or \verb+trigLabels+ option, the macros \verb+\pshlabel+ and \verb+\psvlabel+
+shouldn't be redefined, because the package does it itself in these cases.
{
\ttfamily
\begin{longtable}{lll}
@@ -2146,6 +2148,7 @@ package, because everything can be set by the \verb+ticksize+ option.
\endfirsthead
\textrm{Name} & \textrm{Type} & \textrm{Default}\\\hline
\endhead
+labelFontSize & <fontsize macro> & \{\} \\
algebraic & false|true & false\\ %ok
comma & false|true & false\\ %ok
xAxis & false|true & true\\%ok
@@ -2203,6 +2206,7 @@ urx & <length> & 0pt\\
ury & <length> & 0pt\\
polarplot & false|true & false\\
trigLabels & false|true & false\\
+trigLabelBase & <number> & 0\\
ChangeOrder & false|true & false\\
\end{longtable}
}
@@ -2210,6 +2214,35 @@ ChangeOrder & false|true & false\\
\clearpage
%--------------------------------------------------------------------------------------
+\subsection{Changing the label font size with \texttt{labelFontSize}}
+%--------------------------------------------------------------------------------------
+
+This option sets the horizontal \textbf{and} vertical font size for the labels.
+It will be overwritten when another package or a user defines
+\begin{lstlisting}
+\def\pshlabel#1{...}
+\def\psvlabel#1{...}
+\end{lstlisting}
+
+\begin{LTXexample}[width=6cm]
+\begin{pspicture}(-0.25,-0.25)(5,2.25)
+\psaxes{->}(5,2.25)
+\end{pspicture}\\[20pt]
+\begin{pspicture}(-0.25,-0.25)(5,2.25)
+\psaxes[labelFontSize=\small]{->}(5,2.25)
+\end{pspicture}\\[20pt]
+\begin{pspicture}(-0.25,-0.25)(5,2.25)
+\psaxes[labelFontSize=\footnotesize]{->}(5,2.25)
+\end{pspicture}\\[20pt]
+\begin{pspicture}(-0.25,-0.25)(5,2.25)
+\psaxes[labelFontSize=\tiny]{->}(5,2.25)
+\end{pspicture}%
+\end{LTXexample}
+
+
+\clearpage
+
+%--------------------------------------------------------------------------------------
\subsection[\texttt{algebraic}]{\texttt{algebraic}\footnote{This part is adapted from the package \texttt{pst-eqdf}, written by Dominique Rodriguez.}}
%--------------------------------------------------------------------------------------
By default the function of \verb+\psplot+ has to be described in Reversed Polish Notation.
@@ -2237,8 +2270,8 @@ the computation is done from left to right. The following functions are defined
\verb$sqrt$ & square root\\
\verb$abs$ & absolute value\\
\verb$fact$ & for the factorial\\
-\verb$SUM$ & for building sums\\
-\verb$IFTE$ & for an easy case structure
+\verb$Sum$ & for building sums\\
+\verb$IfTE$ & for an easy case structure
\end{tabular}
\medskip
@@ -2256,18 +2289,31 @@ For the \verb+\parametricplot+ the two parts must be divided by the \verb+|+ cha
\end{LTXexample}
+\clearpage
\bigskip
-\begin{LTXexample}[pos=t]
+%\begin{LTXexample}[pos=t]
\psset{lly=-0.5cm}
\psgraph(-10,-3)(10,2){\linewidth}{6cm}
\psset{algebraic=true, plotpoints=101}
\psplot[linecolor=yellow, linewidth=4\pslinewidth]{-10}{10}{2*sin(x)}%
\psplot[linecolor=red, showpoints=true]{-10}{10}{2*sin(x)}
\endpsgraph
-\end{LTXexample}
+%\end{LTXexample}
+
+\bigskip
+\begin{lstlisting}
+\psset{lly=-0.5cm}
+\psgraph(-10,-3)(10,2){\linewidth}{6cm}
+ \psset{algebraic=true, plotpoints=101}
+ \psplot[linecolor=yellow, linewidth=4\pslinewidth]{-10}{10}{2*sin(x)}%
+ \psplot[linecolor=red, showpoints=true]{-10}{10}{2*sin(x)}
+\endpsgraph
+\end{lstlisting}
-\begin{LTXexample}[pos=t]
+\bigskip
+%\begin{LTXexample}[pos=t]
+\bgroup
\psset{lly=-0.5cm}
\psgraph(0,-5)(18,3){15cm}{5cm}
\psset{algebraic,plotpoints=501}
@@ -2276,25 +2322,31 @@ For the \verb+\parametricplot+ the two parts must be divided by the \verb+|+ cha
\psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{18}{3*cos(x)*2.71^(-x/10)}
\psplot[linecolor=blue,showpoints=true,plotpoints=51]{0}{18}{3*cos(x)*2.71^(-x/10)}
\endpsgraph
-\end{LTXexample}
+\egroup
+%\end{LTXexample}
+
+
+\bigskip
+\begin{lstlisting}
+\psset{lly=-0.5cm}
+\psgraph(0,-5)(18,3){15cm}{5cm}
+ \psset{algebraic,plotpoints=501}
+ \psplot[linecolor=yellow, linewidth=4\pslinewidth]{0.01}{18}{ln(x)}%
+ \psplot[linecolor=red]{0.01}{18}{ln(x)}
+ \psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{18}{3*cos(x)*2.71^(-x/10)}
+ \psplot[linecolor=blue,showpoints=true,plotpoints=51]{0}{18}{3*cos(x)*2.71^(-x/10)}
+\endpsgraph
+\end{lstlisting}
-\iffalse
-\begin{LTXexample}
-\begin{psgraph}(0,-4)(0.2,4){{15cm}}{5cm}
- \psset{algebraic=true, plotpoints=501}
- \psplot[linecolor=yellow, linewidth=4\pslinewidth]{0.02}{.2}{4*cos(1/x)}%
- \psplot[linecolor=red]{.02}{.2}{4*cos(1/x)}%
-\end{psgraph}
-\end{LTXexample}
-\fi
+\iffalse
%--------------------------------------------------------------------------------------
-\subsubsection{Using the \texttt{SUM} function}
+\subsubsection{Using the \texttt{Sum} function}
%--------------------------------------------------------------------------------------
-Syntax: \verb+SUM(<index name>,<start>,<step>,<end>,<function>)+
+Syntax: \verb+Sum(<index name>,<start>,<step>,<end>,<function>)+
Let's plot the first development of cosine with polynomials:
$\displaystyle\sum_{n=0}^{+\infty}\frac{(-1)^nx^{2n}}{n!}$.
@@ -2309,7 +2361,7 @@ $\displaystyle\sum_{n=0}^{+\infty}\frac{(-1)^nx^{2n}}{n!}$.
\psplot{-7}{7}{cos(x)}
\multido{\n=1+1}{10}{%
\psplot[linecolor=\getColor{\n}]{-7}{7}{%
- SUM(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
+ Sum(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
\endpsclip
\psaxes(0,0)(-7,-1.5)(7,1.5)
\end{pspicture}
@@ -2324,37 +2376,49 @@ $\displaystyle\sum_{n=0}^{+\infty}\frac{(-1)^nx^{2n}}{n!}$.
\psplot{-7}{7}{cos(x)}
\multido{\n=1+1}{10}{%
\psplot[linecolor=\getColor{\n}]{-7}{7}{%
- SUM(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
+ Sum(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
\endpsclip
\psaxes(0,0)(-7,-1.5)(7,1.5)
\end{pspicture}
\end{lstlisting}
-
+\clearpage
%--------------------------------------------------------------------------------------
-\subsubsection{Using the \texttt{IFTE} function}
+\subsubsection{Using the \texttt{IfTE} function}
%--------------------------------------------------------------------------------------
-Syntax: \verb+IFTE(<condition>,<true part>,<false part>)+
+Syntax: \verb+IfTE(<condition>,<true part>,<false part>)+
-Nesting of several \verb+IFTE+ are possible and seen in the following examples.
+Nesting of several \verb+IfTE+ are possible and seen in the following examples.
A classical example is a piece wise linear function.
-\begin{LTXexample}[pos=t]
+\begin{center}
\begin{pspicture}(-7.5,-2.5)(7.5,6)\psgrid[subgriddiv=1,gridcolor=lightgray]
\psset{algebraic=true, plotpoints=21,linewidth=2pt}
- \psplot[linecolor=blue]{-7.5}{7.5}{IFTE(x<-6,8+x,IFTE(x<0,-x/3,IFTE(x<3,2*x,9-x)))}
+ \psplot[linecolor=blue]{-7.5}{7.5}{IfTE(x<-6,8+x,IfTE(x<0,-x/3,IfTE(x<3,2*x,9-x)))}
\psplot[linecolor=red, plotpoints=101]{-7.5}{7.5}{%
- IFTE(2*x<-2^2*sqrt(9),7+x,IFTE(x<0,x^2/18-1,IFTE(x<3,2*x^2/3-1,8-x)))}%
+ IfTE(2*x<-2^2*sqrt(9),7+x,IfTE(x<0,x^2/18-1,IfTE(x<3,2*x^2/3-1,8-x)))}%
\end{pspicture}
-\end{LTXexample}
+\end{center}
+\begin{lstlisting}
+\begin{pspicture}(-7.5,-2.5)(7.5,6)\psgrid[subgriddiv=1,gridcolor=lightgray]
+ \psset{algebraic=true, plotpoints=21,linewidth=2pt}
+ \psplot[linecolor=blue]{-7.5}{7.5}{IfTE(x<-6,8+x,IfTE(x<0,-x/3,IfTE(x<3,2*x,9-x)))}
+ \psplot[linecolor=red, plotpoints=101]{-7.5}{7.5}{%
+ IfTE(2*x<-2^2*sqrt(9),7+x,IfTE(x<0,x^2/18-1,IfTE(x<3,2*x^2/3-1,8-x)))}%
+\end{pspicture}
+\end{lstlisting}
+
When you program a piece-wise defined function you must take care that a
plotting point must be put on each point where the description changes. Use \verb+showpoints=true+ to
see what's going on, when there is a problem. You are on the save side, when you choose a
big number for \verb+plotpoints+.
-\newpage
+\clearpage
+
+\fi
+
%--------------------------------------------------------------------------------------
\subsection{\texttt{comma}}
@@ -2432,16 +2496,14 @@ The default setting \verb|{}| means, that you'll get the standard behaviour.
\begin{LTXexample}[width=6cm]
-\begin{pspicture}(-1.5,-0.5)(5,4.75)
- \psaxes[xyDecimals=2]{->}(0,0)(4.5,4.5)
+\begin{pspicture}(-1.5,-0.5)(5,3.75)
+ \psaxes[xyDecimals=2]{->}(0,0)(4.5,3.5)
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}
-\def\pshlabel#1{\footnotesize$#1$}
-\def\psvlabel#1{\footnotesize$#1$}
-\psset{xunit=10cm, yunit=0.01cm}
+\psset{xunit=10cm,yunit=0.01cm,labelFontSize=\footnotesize}
\begin{pspicture}(-0.3,-150)(1.5,550.0)
\psaxes[Dx=0.25,Dy=100,ticksize=-4pt 0,comma=true,%
xDecimals=3,yDecimals=1]{->}(0,0)(0,-100)(1.4,520)
@@ -2450,32 +2512,6 @@ The default setting \verb|{}| means, that you'll get the standard behaviour.
\resetOptions
-%--------------------------------------------------------------------------------------
-\subsection{Changing the label style}
-%--------------------------------------------------------------------------------------
-There are no special keywords to change the \index{labelstyle}labelstyle for the \verb|\psaxes|
-macro. With a redefinition of the two macros \verb+\pshlabel+ and \verb+\psvlabel+
-it is possible to set both axes in any shape.
-Like the default \verb|pst-plot| package the coordinates are printed in mathmode, changing
-the fontsize to italic needs textmode.
-
-\begin{verbatim}
-\def\pshlabel#1{\scriptsize\itshape #1}
-\def\psvlabel#1{\sffamily\footnotesize #1}
-\end{verbatim}
-
-\resetOptions
-\begin{LTXexample}
-\def\pshlabel#1{\scriptsize\itshape #1}
-\def\psvlabel#1{\sffamily\footnotesize #1}
-\psset{yunit=1cm,xunit=3cm}
-\begin{pspicture}(-0.3,-0.5)(5,4.75)
-\psaxes[Dy=0.5, Dx=0.25]{->}(0,0)(4.5,4.5)
-\end{pspicture}
-\end{LTXexample}
-
-\resetOptions
-
\iffalse
%--------------------------------------------------------------------------------------
@@ -2636,6 +2672,7 @@ A grid is also possible by setting the values to the max/min coordinates.
\end{pspicture}
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsection{\texttt{subticks}}
%--------------------------------------------------------------------------------------
@@ -2695,6 +2732,8 @@ can have any number. 1 sets it to the same length as the main ticks.
\end{pspicture}
\end{LTXexample}
+\clearpage
+
%--------------------------------------------------------------------------------------
\subsection{\texttt{tickcolor}, \texttt{subtickcolor}}
%--------------------------------------------------------------------------------------
@@ -2711,9 +2750,8 @@ ysubtickcolor=<color>
\verb+tickcolor+ and \verb+subtickcolor+ set both for the x- and the y-Axis.
\begin{LTXexample}[preset=\centering,pos=t]
-\def\pshlabel#1{\footnotesize$#1$}
\begin{pspicture}(0,-0.75)(10,1)
-\psaxes[labelsep=2pt,yAxis=false,%
+\psaxes[labelsep=2pt,yAxis=false,labelFontSize=\footnotesize,%
labelsep=-10pt,ticksize=0 10mm,subticks=10,subticksize=0.75,%
tickcolor=red,subtickcolor=blue,tickwidth=1pt,%
subtickwidth=0.5pt](10.01,0)
@@ -2721,15 +2759,15 @@ ysubtickcolor=<color>
\end{LTXexample}
\begin{LTXexample}[width=5cm]
-\def\pshlabel#1{\footnotesize$#1$}
\begin{pspicture}(5,-0.75)(10,1)
-\psaxes[labelsep=2pt,yAxis=false,%
+\psaxes[labelsep=2pt,yAxis=false,labelFontSize=\footnotesize,%
labelsep=5pt,ticksize=0 -10mm,subticks=10,subticksize=0.75,%
tickcolor=red,subtickcolor=blue,tickwidth=1pt,%
subtickwidth=0.5pt,Ox=5](5,0)(5,0)(10.01,0)
\end{pspicture}
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsection{\texttt{ticklinestyle} and \texttt{subticklinestyle}}
%--------------------------------------------------------------------------------------
@@ -2758,6 +2796,7 @@ value \verb+none+ doesn't really makes sense, because it is the same to
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsection{\texttt{loglines}}
%--------------------------------------------------------------------------------------
@@ -2896,6 +2935,7 @@ with an drawing intervall of $1.001\ldots 6$.
+
%--------------------------------------------------------------------------------------
\subsubsection{\texttt{xlogBase}}
%--------------------------------------------------------------------------------------
@@ -2906,7 +2946,7 @@ Now we have to use the easy math function $y=x$ because the x axis is still $\lo
\begin{pspicture}(-3.5,-3.5)(3.5,3.5)
\psplot[linewidth=2pt,linecolor=red]{-3}{3}{x} % log(x)
\psplot[linewidth=2pt,linecolor=blue]{-1.3}{1.5}{x 0.4343 div} % ln(x)
- \psaxes[xlogBase=10,Oy=-3]{->}(-3,-3)(3.5,3.5)
+ \psaxes[ylogBase=10,Oy=-3,Ox=-3]{->}(-3,-3)(3.5,3.5)
\uput[-90](3.5,-3){x}
\uput[180](-3,3.5){y}
\rput(2.5,1){$y=\log x$}
@@ -2914,8 +2954,18 @@ Now we have to use the easy math function $y=x$ because the x axis is still $\lo
\end{pspicture}
\end{LTXexample}
+\begin{center}
+\psset{yunit=3cm,xunit=2cm}
+\begin{pspicture}(-1.25,-1.25)(4.25,1.5)
+ \uput[-90](4.25,-1){x}
+ \uput[0](-1,1){y}
+ \rput(0,1){$y=\sin x$}
+ \psplot[linewidth=2pt,plotpoints=5000,linecolor=red]{-1}{3.5}{10 x exp sin }
+ \psaxes[xlogBase=10,Oy=-1]{->}(-1,-1)(4.25,1.25)
+\end{pspicture}
+\end{center}
-\begin{LTXexample}[preset=\centering,pos=t]
+\begin{lstlisting}
\psset{yunit=3cm,xunit=2cm}
\begin{pspicture}(-1.25,-1.25)(4.25,1.5)
\uput[-90](4.25,-1){x}
@@ -2924,7 +2974,7 @@ Now we have to use the easy math function $y=x$ because the x axis is still $\lo
\psplot[linewidth=2pt,plotpoints=5000,linecolor=red]{-1}{3.5}{10 x exp sin }
\psaxes[xlogBase=10,Oy=-1]{->}(-1,-1)(4.25,1.25)
\end{pspicture}
-\end{LTXexample}
+\end{lstlisting}
\begin{LTXexample}[width=7cm]
@@ -3125,6 +3175,7 @@ of the value.
\pstScalePoints(1,1){}{}% reset
\end{LTXexample}
+\clearpage
%--------------------------------------------------------------------------------------
\subsection{Plot style \texttt{bar} and option \texttt{barwidth}}
%--------------------------------------------------------------------------------------
@@ -3166,7 +3217,7 @@ value of \verb+0.25cm+, which is the total width.
\begin{LTXexample}[preset=\centering,pos=t]
\psset{xunit=.44cm,yunit=.3cm}
-\begin{pspicture}(-2,-1.5)(29,13)
+\begin{pspicture}(-2,-3)(29,13)
\psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,%
ylabelFactor={\,\%}]{-}(29,12)
\listplot[shadow=true,linecolor=blue,plotstyle=bar,barwidth=0.3cm,
@@ -3177,7 +3228,7 @@ value of \verb+0.25cm+, which is the total width.
\begin{LTXexample}[preset=\centering,pos=t]
\psset{xunit=.44cm,yunit=.3cm}
-\begin{pspicture}(-2,-1.5)(29,13)
+\begin{pspicture}(-2,-3)(29,13)
\psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,%
ylabelFactor={\,\%}]{-}(29,12)
\listplot[linecolor=blue,plotstyle=bar,barwidth=0.3cm,
@@ -3188,7 +3239,7 @@ value of \verb+0.25cm+, which is the total width.
\begin{LTXexample}[preset=\centering,pos=t]
\psset{xunit=.44cm,yunit=.3cm}
-\begin{pspicture}(-2,-1.5)(29,13)
+\begin{pspicture}(-2,-3)(29,13)
\psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,%
ylabelFactor={\,\%}]{-}(29,12)
\listplot[linecolor=blue,plotstyle=bar,barwidth=0.3cm,
@@ -3199,38 +3250,310 @@ value of \verb+0.25cm+, which is the total width.
\end{LTXexample}
%--------------------------------------------------------------------------------------
-\subsection{Axis with trigonmetrical units}
+\subsection{\texttt{trigLabels} and \texttt{trigLabelBase} -- axis with trigonmetrical units}
%--------------------------------------------------------------------------------------
-With the option \verb+trigLabels=true+ the labels on the x axis are trigonometrical ones:
+With the option \verb+trigLabels=true+ the labels on the x axis are trigonometrical ones.
+The option \verb+trigLabelBase+ set the demoninator of fraction. The default value of
+0 is the same as no fraction.
+The following constants are are defined in the package:
+\begin{lstlisting}
+\def§\ON§\PiFour§\OFF§{12.566371}
+\def§\ON§\PiTwo§\OFF§{6.283185}
+\def§\ON§\Pi§\OFF§{3.14159265}
+\def§\ON§\PiH§\OFF§{1.570796327}
+\newdimen\RadUnit
+\newdimen\RadUnitInv
+§\ON§\RadUnit§\OFF§=1.047198cm % this is pi/3
+§\ON§\RadUnitInv§\OFF§=0.95493cm % this is 3/pi
+\end{lstlisting}
-\medskip
-\begin{LTXexample}[preset=\centering,pos=t]
-\begin{pspicture}(-0.5,-1.25)(10,1.25)
- \psplot[linecolor=red,linewidth=1.5pt]%
- {0}{9.424777961}{x 180 mul 3.141592654 div sin}
- \psaxes[xunit=1.570796327,showorigin=false,trigLabels]{->}(0,0)(-0.5,-1.25)(6.4,1.25)
+
+
+Because it is a bit complicating to set the right values, we show some more examples
+here.
+
+For \textbf{all} following examples in this section we did a global\\ \lstinline[frame=single]|\psset{trigLabels=true,labelFontSize=\small}|.
+
+
+
+\psset{trigLabels,labelFontSize=\small}
+Translating the decimal ticks to geometrical makes no real sense,
+because every 1 xunit (1cm) is a tick and the last one at 6cm.
+
+\begin{minipage}{0.4\fullWidth}
+\begin{pspicture}[trigLabels=true](-0.5,-1.25)(6.5,1.25)%
+ \pnode(5,0){A}%
+ \psaxes{->}(0,0)(-0.5,-1.25)(\PiTwo,1.25)%
\end{pspicture}
-\end{LTXexample}
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)%
+ \pnode(5,0){A}%
+ \psaxes{->}(0,0)(-.5,-1.25)(\PiTwo,1.25)
+\end{pspicture}
+\end{lstlisting}
+\end{minipage}
-With the value of \verb+xunit+ one can change the labels.
+\begin{minipage}{0.4\fullWidth}
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)%
+ \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(\PiTwo,1.25)
+\end{pspicture}
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\begin{pspicture}(-0.5,-1.25)(10,1.25)%
+ \psaxes[§\ON§trigLabelBase=3§\OFF§]{->}(0,0)(-0.5,-1.25)(\PiTwo,1.25)
+\end{pspicture}
+\end{lstlisting}
+\end{minipage}
-\medskip
-\begin{LTXexample}[preset=\centering,pos=t]
+
+
+Modifing the ticks to have the last one exactly at the end is possible
+with a different dx value ($\frac{\pi}{3}\approx 1.047$):
+
+
+\begin{minipage}{0.4\fullWidth}
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(\PiTwo,0){C}%
+ \psaxes[dx=\RadUnit]{->}(0,0)(-0.5,-1.25)(\PiTwo,1.25)
+\end{pspicture}%
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(\PiTwo,0){C}%
+ \psaxes[§\ON§dx=\RadUnit§\OFF§]{->}(0,0)(-0.5,-1.25)(\PiTwo,1.25)
+\end{pspicture}%
+\end{lstlisting}
+\end{minipage}
+
+
+\begin{minipage}{0.4\fullWidth}
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(5,0){B}%
+ \psaxes[dx=\RadUnit,trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(\PiTwo,1.25)
+\end{pspicture}%
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(5,0){B}%
+ \psaxes[dx=\RadUnit,§\ON§trigLabelBase=3§\OFF§] {->}(0,0)(-0.5,-1.25)(\PiTwo,1.25)
+\end{pspicture}%
+\end{lstlisting}
+\end{minipage}
+
+\ncline[linestyle=dashed,linewidth=0.4pt]{A}{B}
+
+Set globaly everything in radiant unit. Now 6 units on the $x$-axis
+are $6\pi$. Using \verb+trigLabelBase=3+ reduces this value to $2\pi$, a.s.o.
+
+\bigskip
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(6,0){D}%
+ \psaxes{->}(0,0)(-0.5,-1.25)(6.5,1.25)%
+\end{pspicture}%
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{§\ON§xunit=\RadUnit§\OFF§}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(6,0){D}%
+ \psaxes{->}(0,0)(-0.5,-1.25)(6.5,1.25)%
+\end{pspicture}%
+\end{lstlisting}
+\end{minipage}
+\ncline[linestyle=dashed,linewidth=0.4pt]{C}{D}
+
+
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+\end{pspicture}%
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{§\ON§xunit=\RadUnit§\OFF§}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[§\ON§trigLabelBase=3§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+\end{pspicture}%
+\end{lstlisting}
+\end{minipage}
+
+
+
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[trigLabelBase=4]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+\end{pspicture}%
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{§\ON§xunit=\RadUnit§\OFF§}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[§\ON§trigLabelBase=4§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+\end{pspicture}%
+\end{lstlisting}
+\end{minipage}
+
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[trigLabelBase=6]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+\end{pspicture}%
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{§\ON§xunit=\RadUnit§\OFF§}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[§\ON§trigLabelBase=6§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+\end{pspicture}%
+\end{lstlisting}
+\end{minipage}
+
+
+
+The best way seems to be setting the $x$-unit to \verb+\RadUnit+. Plotting a
+function doesn't consider the value for \verb+trigLabelBase+, it has to be done by
+the user. The first example sets the unit locally for the \verb+\psplot+
+back to 1cm, which is needed, because we use this unit on PostScript side.
+
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[xunit=1cm,linecolor=red,linewidth=1.5pt]{0}{\PiTwo}{x RadtoDeg sin}
+\end{pspicture}
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[§\ON§xunit=1cm§\OFF§,linecolor=red,linewidth=1.5pt]{0}{§\ON§\PiTwo§\OFF§}{x RadtoDeg sin}
+\end{pspicture}
+\end{lstlisting}
+\end{minipage}
+
+
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[linecolor=red,linewidth=1.5pt]{0}{6}{x Pi 3 div mul RadtoDeg sin}
+\end{pspicture}
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[linecolor=red,linewidth=1.5pt]{0}{6}{x §\ON§Pi 3 div mul §\OFF§RadtoDeg sin}
+\end{pspicture}
+\end{lstlisting}
+\end{minipage}
+
+
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[dx=1.5]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[xunit=.5cm,linecolor=red,linewidth=1.5pt]{0}{\PiFour}{x RadtoDeg sin}
+\end{pspicture}
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[§\ON§dx=1.5§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[§\ON§xunit=0.5cm§\OFF§,linecolor=red,linewidth=1.5pt]{0}{§\ON§\PiFour§\OFF§}{x RadtoDeg sin}
+\end{pspicture}
+\end{lstlisting}
+\end{minipage}
+
+
+\begin{minipage}{0.4\fullWidth}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[dx=0.75,trigLabelBase=2]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[xunit=.5cm,linecolor=red,linewidth=1.5pt]{0}{\PiFour}{x RadtoDeg sin}
+\end{pspicture}
+\end{minipage}%
+\begin{minipage}{0.6\fullWidth}
+\begin{lstlisting}
+\psset{xunit=\RadUnit}%
+\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
+ \psaxes[§\ON§dx=0.75§\OFF§,§\ON§trigLabelBase=2§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
+ \psplot[§\ON§xunit=0.5cm§\OFF§,linecolor=red,linewidth=1.5pt]{0}{\PiFour}{x RadtoDeg sin}
+\end{pspicture}
+\end{lstlisting}
+\end{minipage}
+
+
+It is also possible to set the $x$ unit and $dx$ value to get the labels
+right. But this needs some more understanding how it really works.
+A \verb+xunit=1.570796327+ sets the unit to $\pi/2$ and a \verb+dx=0.666667+
+then puts every $2/3$ of the unit a tick mark and a label. The length of
+the $x$-axis is 6.4 units which is $6.4\cdot 1.570796327cm\approx 10cm$.
+The function then is plotted from $0$ to $3\pi=9.424777961$.
+
+
+
+
+\begin{center}
+\psset{unit=1cm}
\begin{pspicture}(-0.5,-1.25)(10,1.25)
- \psplot[linecolor=red,linewidth=1.5pt]%
- {0}{9.424777961}{x 180 mul 3.141592654 div sin}
- \psaxes[xunit=0.7853981635,showorigin=false,trigLabels]{->}(0,0)(-1,-1.25)(12.8,1.25)
+ \psaxes[xunit=1.570796327,showorigin=false,trigLabelBase=3,dx=0.666667]{->}(0,0)(-0.5,-1.25)(6.4,1.25)
+ \psplot[linecolor=red,linewidth=1.5pt]{0}{9.424777961}{%
+ x RadtoDeg dup sin exch 1.1 mul cos add}
\end{pspicture}
-\end{LTXexample}
+\end{center}
+\begin{lstlisting}
+\begin{pspicture}(-0.5,-1.25)(10,1.25)
+ \psaxes[§\ON§xunit=1.570796327§\OFF§,§\ON§trigLabelBase=3§\OFF§,§\ON§dx=0.666667§\OFF§]{->}(0,0)(-0.5,-1.25)(6.4,1.25)
+ \psplot[linecolor=red,linewidth=1.5pt]{0}{§\ON§9.424777961§\OFF§}{%
+ x RadtoDeg dup sin exch 1.1 mul cos add}
+\end{pspicture}
+\end{lstlisting}
-\medskip
-\begin{LTXexample}[preset=\centering,pos=t]
+\begin{center}
+\psset{unit=1cm}
\begin{pspicture}(-0.5,-1.25)(10,1.25)
- \psplot[linecolor=red,linewidth=1.5pt]%
- {0}{9.424777961}{x 180 mul 3.141592654 div sin}
- \psaxes[xunit=0.7853981635,showorigin=false,trigLabels,Dx=2]{->}(0,0)(-1,-1.25)(12.8,1.25)
+ \psaxes[xunit=\Pi,dx=0.25]{->}(0,0)(-0.25,-1.25)(3.2,1.25)
+ \psplot[xunit=0.25,plotpoints=500,linecolor=red,linewidth=1.5pt]{0}{37.70}{%
+ x RadtoDeg dup sin exch 1.1 mul cos add}
\end{pspicture}
-\end{LTXexample}
+\end{center}
+\begin{lstlisting}
+\psset{§\ON§unit=1cm§\OFF§}
+ \psplot[§\ON§xunit=0.25§\OFF§,§\ON§plotpoints=500§\OFF§,linecolor=red,linewidth=1.5pt]{0}{37.70}{%
+ x RadtoDeg dup sin exch 1.1 mul cos add}
+\end{pspicture}
+\end{lstlisting}
+
+
+\begin{center}
+\psset{unit=1cm}
+\begin{pspicture}(-0.5,-2)(10,2)
+ \psplot[xunit=0.0625,linecolor=red,linewidth=1.5pt,plotpoints=5000]{0}{150.80}{%
+ x RadtoDeg dup sin exch 1.1 mul cos add}
+ \psaxes[xunit=\Pi,dx=0.5,Dx=8,subticks=2]{->}(0,0)(-0.1,-2)(3.2,2)
+\end{pspicture}
+\end{center}
+\begin{lstlisting}
+\psset{§\ON§unit=1cm§\OFF§}
+\begin{pspicture}(-0.5,-1.25)(10,1.25)
+ \psplot[§\ON§xunit=0.0625§\OFF§,linecolor=red,linewidth=1.5pt,%
+ §\ON§plotpoints=5000§\OFF§]{0}{150.80}%
+ {x RadtoDeg dup sin exch 1.1 mul cos add}
+ \psaxes[§\ON§xunit=\Pi§\OFF§,§\ON§dx=0.5§\OFF§,§\ON§Dx=8§\OFF§]{->}(0,0)(-0.25,-1.25)(3.2,1.25)
+\end{pspicture}
+\end{lstlisting}
+
+
+\psset{trigLabels=false}
+
+
%------------------------------------------------------------------------------------
\subsection{New options for \CMD{readdata}}
@@ -3268,6 +3591,7 @@ some nonsense in this line ���time forcex forcey
\endpspicture
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsection{New options for \texttt{\textbackslash listplot}}
%--------------------------------------------------------------------------------------
@@ -3310,6 +3634,7 @@ is read and plotted.
When both, \verb|x/yStart/End| are defined then the values are also compared with
both values.
+
%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{nStep/xStep}}
%--------------------------------------------------------------------------------------
@@ -3329,6 +3654,7 @@ of all records with the plotstyle option \verb|curve|.
+
%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{nStart/xStart}}
%--------------------------------------------------------------------------------------
@@ -3342,6 +3668,7 @@ of all records with the plotstyle option \verb|curve|.
\end{pspicture}
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{nEnd/xEnd}}
%--------------------------------------------------------------------------------------
@@ -3356,6 +3683,7 @@ of all records with the plotstyle option \verb|curve|.
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsubsection{Example for all new options}
%--------------------------------------------------------------------------------------
@@ -3371,6 +3699,7 @@ of all records with the plotstyle option \verb|curve|.
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{xStart}}
%--------------------------------------------------------------------------------------
@@ -3381,15 +3710,14 @@ To show the important part of the curve there is another one plotted with a
greater \verb|yunit| and a start value of \verb|xStart=0.35|. This makes it
possible to have a kind of a zoom to the original graphic.
-\begin{LTXexample}[preset=\centering,pos=t]
-\def\pshlabel#1{\scriptsize\sffamily$#1$}
-\def\psvlabel#1{\sffamily\scriptsize$#1$}
+\begin{center}
\psset{xunit=10cm, yunit=0.01cm}
\readdata{\data}{examples/data3.dat}
\begin{pspicture}(-0.1,-100)(1.5,700.0)
- \psaxes[Dx=0.25,Dy=100,dy=100\psyunit,ticksize=-4pt 0]{->}(0,0)(0,-100)(1.4,520)
+ \psaxes[Dx=0.25,Dy=100,dy=100\psyunit,ticksize=-4pt 0,%
+ labelFontSize={\footnotesize}]{->}(0,0)(0,-100)(1.4,520)
\uput[0](1.4,0){\textsf{t [s]}}
- \rput(-0.125,200){\psrotateleft{\small\sffamily flow [ml/s]}}
+ \rput(-0.125,200){\psrotateleft{\small flow [ml/s]}}
\listplot[linewidth=2pt, linecolor=blue]{\data}
\rput(0.4,300){
\pscustom[yunit=0.04cm, linewidth=1pt]{%
@@ -3401,11 +3729,38 @@ possible to have a kind of a zoom to the original graphic.
}
\psline[linewidth=.01]{->}(0.75,300)(0.4,20)
\psline[linewidth=.01]{->}(1,290)(1.1,440)
- \rput(1.1,470){\footnotesize\sffamily leak volume}
+ \rput(1.1,470){\footnotesize leak volume}
\psline[linewidth=.01]{->}(0.78,200)(1,100)
- \rput[l](1.02,100){\footnotesize\sffamily closing volume}
+ \rput[l](1.02,100){\footnotesize closing volume}
\end{pspicture}
-\end{LTXexample}
+\end{center}
+
+
+\begin{lstlisting}
+\psset{xunit=10cm, yunit=0.01cm}
+\readdata{\data}{examples/data3.dat}
+\begin{pspicture}(-0.1,-100)(1.5,700.0)
+ \psaxes[Dx=0.25,Dy=100,dy=100\psyunit,ticksize=-4pt 0,%
+ labelFontSize={\footnotesize}]{->}(0,0)(0,-100)(1.4,520)
+ \uput[0](1.4,0){\textsf{t [s]}}
+ \rput(-0.125,200){\psrotateleft{\small flow [ml/s]}}
+ \listplot[linewidth=2pt, linecolor=blue]{\data}
+ \rput(0.4,300){
+ \pscustom[yunit=0.04cm, linewidth=1pt]{%
+ \listplot[xStart=0.355]{\data}
+ \psline(1,-2.57)(1,0)(0.355,0)
+ \fill[fillstyle=hlines,fillcolor=gray,hatchwidth=0.4pt,hatchsep=1.5pt,hatchcolor=red]%
+ \psline[linewidth=0.5pt]{->}(0.7,0)(1.05,0)
+ }%
+ }
+ \psline[linewidth=.01]{->}(0.75,300)(0.4,20)
+ \psline[linewidth=.01]{->}(1,290)(1.1,440)
+ \rput(1.1,470){\footnotesize leak volume}
+ \psline[linewidth=.01]{->}(0.78,200)(1,100)
+ \rput[l](1.02,100){\footnotesize closing volume}
+\end{pspicture}
+\end{lstlisting}
+
\resetOptions
@@ -3477,6 +3832,7 @@ without any modification to the data file:
\end{LTXexample}
+
%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{changeOrder}}
%--------------------------------------------------------------------------------------
@@ -3504,6 +3860,7 @@ the values are used in a reverse order:
+
%--------------------------------------------------------------------------------------
\section{Polar plots}
%--------------------------------------------------------------------------------------
@@ -3525,11 +3882,10 @@ x sin dup mul x cos dup mul add sqrt
\medskip
\begin{LTXexample}[width=6cm]
\resetOptions
-\def\pshlabel#1{\footnotesize$#1$}
-\def\psvlabel#1{\footnotesize$#1$}
\psset{plotpoints=200,unit=0.75}
\begin{pspicture}*(-5,-5)(3,3)
\psaxes[labelsep=.75mm,arrowlength=1.75,ticksize=2pt,%
+ labelFontSize=\footnotesize,%
linewidth=0.17mm]{->}(0,0)(-4.99,-4.99)(3,3)
\rput[Br](3,-.35){$x$}
\rput[tr](-.15,3){$y$}
@@ -3580,14 +3936,8 @@ x sin dup mul x cos dup mul add sqrt
\resetOptions
-
-
-
-%--------------------------------------------------------------------------------------
-\section{New commands and environments}
-%--------------------------------------------------------------------------------------
%--------------------------------------------------------------------------------------
-\subsection{\CMD{pstScalePoints}}
+\section{\CMD{pstScalePoints}}
%--------------------------------------------------------------------------------------
The syntax is
\begin{verbatim}
@@ -3626,8 +3976,13 @@ macros. This is the reason why it is a good idea to reset the values at the end
\pstScalePoints(1,1){}{}
\end{verbatim}
+
+%--------------------------------------------------------------------------------------
+\part{New commands and environments}
+%--------------------------------------------------------------------------------------
+
%--------------------------------------------------------------------------------------
-\subsection{\texttt{psgraph} environment}
+\section{\texttt{psgraph} environment}
%--------------------------------------------------------------------------------------
This new environment does the scaling, it expects as parameter the values (without units!) for the
coordinate system and the values of the physical width and height (with units!). The syntax is:
@@ -3647,20 +4002,20 @@ coordinate system and the values of the physical width and height (with units!).
where the options are valid \textbf{only} for the the \verb+\psaxes+ macro. The first
two arguments have the usual \verb+PSTricks+ behaviour.
\begin{itemize}
- \item if \verb+(xOrig,yOrig)+ is missing, it is substituted to $(0,0)$;
- \item if \verb+(xOrig,yOrig)+ \textbf{and} (xMin,yMin) are missing, they are both
- substituted to $(0,0)$.
+ \item if \verb+(xOrig,yOrig)+ is missing, it is substituted to \verb+(xMin,xMax)+;
+ \item if \verb+(xOrig,yOrig)+ \textbf{and} \verb+(xMin,yMin)+ are missing, they are both
+ substituted to \verb+(0,0)+.
\end{itemize}
-\begin{LTXexample}[pos=t,preset=\centering]
+\begin{LTXexample}[pos=t]
\readdata{\data}{demo1.dat}
\pstScalePoints(1,0.000001){}{}% (x,y){additional x operator}{y op}
\psset{llx=-1cm,lly=-1cm}
\psgraph[axesstyle=frame,xticksize=0 759,yticksize=0 25,%
subticks=0,ylabelFactor={\cdot 10^6},%
Dx=5,dy=100\psyunit,Dy=100](0,0)(25,750){10cm}{6cm} % parameters
- \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
+ \listplot[linecolor=red,linewidth=2pt,showpoints=true]{\data}
\endpsgraph
\end{LTXexample}
@@ -3676,7 +4031,6 @@ two arguments have the usual \verb+PSTricks+ behaviour.
\end{psgraph}
\end{LTXexample}
-
\begin{LTXexample}[width=6.5cm]
\readdata{\data}{demo1.dat}
\psset{llx=-0.5cm,lly=-1cm}
@@ -3690,6 +4044,7 @@ two arguments have the usual \verb+PSTricks+ behaviour.
\begin{LTXexample}[pos=t,preset=\centering]
+\readdata{\data}{demo1.dat}
\pstScalePoints(1,0.2){}{log}
\psset{lly=-0.75cm}
\psgraph[ylogBase=10,Dx=5,Dy=1,subticks=5](0,0)(25,2){12cm}{4cm}
@@ -3731,7 +4086,10 @@ two arguments have the usual \verb+PSTricks+ behaviour.
\endpsgraph
\end{LTXexample}
+
\begin{LTXexample}[pos=t,preset=\centering]
+\readdata{\data}{demo2.dat}%
+\readdata{\dataII}{demo3.dat}%
\psset{llx=-0.5cm,lly=-0.75cm}
\pstScalePoints(1,1){1989 sub}{2 sub}
\begin{psgraph}[axesstyle=frame,Dx=2,Ox=1989,Oy=2,subticks=2](0,0)(12,4){6in}{3in}%
@@ -3744,18 +4102,27 @@ two arguments have the usual \verb+PSTricks+ behaviour.
%\newpage
An example with ticks on every side of the frame:
-\begin{LTXexample}[pos=t,preset=\centering]
+\begin{center}
\def\data{0 0 1 1 2 4 3 9}
\psset{lly=-0.5cm}
\begin{psgraph}[axesstyle=frame,ticksize=0 4pt](0,0)(3.0,9.0){12cm}{5cm}
\psaxes[axesstyle=frame,labels=none,ticksize=-4pt 0](3,9)(0,0)(3,9)
\listplot[linecolor=red,linewidth=2pt]{\data}
\end{psgraph}
-\end{LTXexample}
+\end{center}
+
+\begin{lstlisting}
+\def\data{0 0 1 1 2 4 3 9}
+\psset{lly=-0.5cm}
+\begin{psgraph}[axesstyle=frame,ticksize=0 4pt](0,0)(3.0,9.0){12cm}{5cm}
+ \psaxes[axesstyle=frame,labels=none,ticksize=-4pt 0](3,9)(0,0)(3,9)
+ \listplot[linecolor=red,linewidth=2pt]{\data}
+\end{psgraph}
+\end{lstlisting}
%-------------------------------------------------------------------------------------------
-\subsubsection{The new options}
+\subsection{The new options}
%-------------------------------------------------------------------------------------------
\begin{center}
@@ -3779,24 +4146,45 @@ as parameters of \verb+psgraph+ itself.
\medskip
\resetOptions
-\begin{LTXexample}[pos=t]
+\begin{center}
+\readdata{\data}{demo2.dat}%
+\readdata{\dataII}{demo3.dat}%
\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
yAxisLabel=Whatever,xAxisLabelPos={.4\linewidth,-0.4in},%
yAxisLabelPos={-0.4in,2in}}
\pstScalePoints(1,1){1989 sub}{}
\psframebox[linestyle=dashed,boxsep=0pt]{%
-\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{4in}%
+\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
\listplot[linecolor=red,linewidth=2pt]{\data}%
\listplot[linecolor=blue,linewidth=2pt]{\dataII}%
\listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
\end{psgraph}%
}
-\end{LTXexample}
+\end{center}
+
+
+\begin{lstlisting}
+\readdata{\data}{demo2.dat}%
+\readdata{\dataII}{demo3.dat}%
+\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
+ yAxisLabel=Whatever,xAxisLabelPos={.4\linewidth,-0.4in},%
+ yAxisLabelPos={-0.4in,2in}}
+\pstScalePoints(1,1){1989 sub}{}
+\psframebox[linestyle=dashed,boxsep=0pt]{%
+\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
+ \listplot[linecolor=red,linewidth=2pt]{\data}%
+ \listplot[linecolor=blue,linewidth=2pt]{\dataII}%
+ \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
+\end{psgraph}%
+}
+\end{lstlisting}
+
+
\pstScalePoints(1,1){}{}% reset
%--------------------------------------------------------------------------------------
-\subsubsection{Problems}
+\subsection{Problems}
%--------------------------------------------------------------------------------------
Floating point operations in \TeX\ are a real mess, which causes a lot of problems
when there are very small oder very big units. With the options of \verb+\pst-plot+
@@ -3833,7 +4221,96 @@ the linewidth od the document.
\resetOptions
%--------------------------------------------------------------------------------------
-\subsection[\CMD{psplotTangent}]{\CMD{psplotTangent}\footnote{This part is adapted from the package \texttt{pst-eqdf}, written by Dominique Rodriguez.}}
+\section{\CMD{psStep}}
+%--------------------------------------------------------------------------------------
+\verb+\psStep+ caclulates a step function for the upper or lower sum or the max/min
+of the Riemann integral definition of a given function. The available option is
+
+\verb+StepType=lower|upper|Riemann+
+
+with \verb+lower+ as the default setting. The syntax of the function is
+
+\verb+\psStep[options](x1,x2){n}{function}+
+
+
+(x1,x2) is the given Intervall for the step wise caculated function,
+n is the number of the rectangles and \verb+function+ is the mathematical function
+in postfix or algebraic notation (with \verb+algebraic=true+).
+
+\begin{center}
+\bgroup
+\begin{pspicture}(-0.5,-0.5)(10,3) \psaxes{->}(10,3)
+ \psplot[plotpoints=100,linewidth=1.5pt,algebraic,%
+ labelFontSize=\footnotesize]{0}{10}{sqrt(x)}
+ \psStep[linecolor=magenta,StepType=upper,fillstyle=hlines](0,9){9}{x sqrt}
+ \psStep[linecolor=blue,fillstyle=vlines](0,9){9}{x sqrt }
+\end{pspicture}
+
+\psset{plotpoints=200}
+\begin{pspicture}(-0.5,-2.25)(10,3) \psaxes{->}(0,0)(0,-2.25)(10,3)
+ \psplot[linewidth=1.5pt,algebraic,labelFontSize=\footnotesize]{0}{10}{sqrt(x)*sin(x)}
+ \psStep[algebraic,linecolor=magenta,StepType=upper](0,9){20}{sqrt(x)*sin(x)}
+ \psStep[linecolor=blue,linestyle=dashed](0,9){20}{x sqrt x RadtoDeg sin mul}
+\end{pspicture}
+
+\psset{yunit=1.25cm}
+\begin{pspicture}(-0.5,-1.5)(10,1.5) \psaxes{->}(0,0)(0,-1.5)(10,1.5)
+ \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=black!10](0,10){50}%
+ {sqrt(x)*cos(x)*sin(x)}
+ \psplot[linewidth=1.5pt,algebraic,labelFontSize=\footnotesize]%
+ {0}{10}{sqrt(x)*cos(x)*sin(x)}
+\end{pspicture}
+
+\psset{unit=1.5cm}
+\begin{pspicture}[plotpoints=200](-0.5,-3)(10,2.5)
+ \psStep[algebraic,fillstyle=solid,fillcolor=yellow](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)}
+ \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=blue](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)}
+ \psaxes{->}(0,0)(0,-2.75)(10,2.5)
+ \psplot[algebraic,linecolor=white,labelFontSize=\footnotesize]%
+ {0.001}{9.75}{2*sqrt(x)*cos(ln(x))*sin(x)}
+ \uput[90](6,1.2){$f(x)=2\cdot\sqrt{x}\cdot\cos{(\ln{x})}\cdot\sin{x}$}
+\end{pspicture}
+\egroup
+\end{center}
+
+
+\begin{lstlisting}
+\begin{pspicture}(-0.5,-0.5)(10,3) \psaxes{->}(10,3)
+ \psplot[plotpoints=100,linewidth=1.5pt,algebraic,%
+ labelFontSize=\footnotesize]{0}{10}{sqrt(x)}
+ \psStep[linecolor=magenta,StepType=upper,fillstyle=hlines](0,9){9}{x sqrt}
+ \psStep[linecolor=blue,fillstyle=vlines](0,9){9}{x sqrt }
+\end{pspicture}
+
+\psset{plotpoints=200}
+\begin{pspicture}(-0.5,-2.25)(10,3) \psaxes{->}(0,0)(0,-2.25)(10,3)
+ \psplot[linewidth=1.5pt,algebraic,labelFontSize=\footnotesize]{0}{10}{sqrt(x)*sin(x)}
+ \psStep[algebraic,linecolor=magenta,StepType=upper](0,9){20}{sqrt(x)*sin(x)}
+ \psStep[linecolor=blue,linestyle=dashed](0,9){20}{x sqrt x RadtoDeg sin mul}
+\end{pspicture}
+
+\psset{yunit=1.25cm}
+\begin{pspicture}(-0.5,-1.5)(10,1.5) \psaxes{->}(0,0)(0,-1.5)(10,1.5)
+ \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=black!10](0,10){50}%
+ {sqrt(x)*cos(x)*sin(x)}
+ \psplot[linewidth=1.5pt,algebraic,labelFontSize=\footnotesize]%
+ {0}{10}{sqrt(x)*cos(x)*sin(x)}
+\end{pspicture}
+
+\psset{unit=1.5cm}
+\begin{pspicture}[plotpoints=200](-0.5,-3)(10,2.5)
+ \psStep[algebraic,fillstyle=solid,fillcolor=yellow](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)}
+ \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=blue](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)}
+ \psaxes{->}(0,0)(0,-2.75)(10,2.5)
+ \psplot[algebraic,linecolor=white,labelFontSize=\footnotesize]%
+ {0.001}{9.75}{2*sqrt(x)*cos(ln(x))*sin(x)}
+ \uput[90](6,1.2){$f(x)=2\cdot\sqrt{x}\cdot\cos{(\ln{x})}\cdot\sin{x}$}
+\end{pspicture}
+\end{lstlisting}
+
+
+%--------------------------------------------------------------------------------------
+\section[\CMD{psplotTangent}]{\CMD{psplotTangent}}
%--------------------------------------------------------------------------------------
There is an additional option, named \verb+Derive+ vor an alternative function (see
following example) to calculate the slope of the tangent. This will be in general the
@@ -3928,7 +4405,7 @@ tangent.
%--------------------------------------------------------------------------------------
-\subsubsection{A \texttt{polarplot} example}
+\subsection{A \texttt{polarplot} example}
%--------------------------------------------------------------------------------------
Let's work with the classical cardioid : $\rho=2(1+\cos(\theta))$
@@ -3971,7 +4448,7 @@ where $x=r\cdot\cos\theta$ and $y=r\cdot\sin\theta$
%--------------------------------------------------------------------------------------
-\subsubsection{A \CMD{parametricplot} example}
+\subsection{A \CMD{parametricplot} example}
%--------------------------------------------------------------------------------------
Let's work with a Lissajou curve :
@@ -4005,22 +4482,702 @@ divide the two equations by a | (see example).
+\resetOptions
+
+\section{Successive derivatives of a function}
+
+The new PostScript function \verb$Derive$ has been added for plotting
+the succesive derivatives of a
+function. It must be used wiht the \verb|algebaic| option. This function has two
+arguments:
+
+\begin{enumerate}
+\item a positive integer with define the order of the derivative, obviously $0$ means the
+ function itself!
+\item a function of variable $x$ which can be any function using the common operators,
+\end{enumerate}
+
+Do not think that the derivative is approximated, the internal PostScript engine will
+compute the real derivative using a formal derivative engine.
+
+The following diagram contains the plot of the polynomial:
+
+\[ f(x)=\sum_{i=0}^{14}\frac{(-1)^{i}x^{2i}}{i!}=1-\frac{x^2}{2}+\frac{x^4}{4!}-\frac{x^6}{6!}+\frac{x^8}{8!}-
+ \frac{x^{10}}{10!}+\frac{x^{12}}{12!}-\frac{x^{14}}{14!}\]
+
+and of its 15 first derivatives. It is the sequence definition of the cosine.
+
+
+\begin{LTXexample}[pos=t,wide,preset=\centering]
+\psset{unit=2}
+\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
+ DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
+ OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
+\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
+ \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
+ \multido{\in=0+1}{16}{%
+ \psplot[algebraic=true,linecolor=\getColor{\in},linewidth=1pt]{0}{7}
+ {Derive(\in,1-x^2/2+x^4/24-x^6/720+x^8/40320-x^10/3628800+x^12/479001600-x^14/87178291200)}}
+ \endpsclip
+\end{pspicture}
+\end{LTXexample}
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Other examples}
+
+
+\begin{LTXexample}[width=3.5cm]
+\begin{pspicture}[shift=-2.5,showgrid=true,linewidth=1pt](0,-2)(3,3)
+ \psplot[algebraic=true]{.001}{3}{x*ln(x)} % f(x)
+ \psplot[algebraic=true,linecolor=red]{.05}{3}{Derive(1,x*ln(x))} % f'(x)=1+ln(x)
+\end{pspicture}
+\end{LTXexample}
+
+
+\section{Variable step for plotting a curve}
+\subsection{Theory}
+
+As you know with the \verb$\psplot$ macro, the curve is plotted using a piece wise
+linear curve. The step is given by the parameter \texttt{plotpoints}. For
+each step between $x_i$ and $x_{i+1}$, the area defined between the curve and its
+approximation (a segment) is majored by this formula :
+
+\begin{minipage}[m]{.5\linewidth}
+\[|\varepsilon|\le\frac{M_2(f)(x_{i+1}-x_i)^3}{12}\]
+
+$M_2(f)$ is a majorant of the second derivative of $f$ in the interval $[x_i;x_{i+1}]$.
+\end{minipage}
+{\psset{unit=1cm, showpoints=false}
+\begin{pspicture}[shift=-2,showgrid=true](0,-1)(6,3)
+ \pscurve(0,0)(1,1)(3,2.2)(5,2)(6,1)\psline(1,1)(5,2)
+ \psline(.5,0)(5.5,0)\psline(1,0)(1,1)\psline(5,0)(5,2)
+ \rput[t](1,-.1){$x_n$}\rput[t](5,-.1){$x_{n+1}$}
+ \psclip{\pscustom{\psecurve(0,0)(1,1)(3,2.2)(5,2)(6,1)\psline(5,2)}}
+ \psframe[fillstyle=solid, fillcolor=gray](0,0)(5,5)
+ \endpsclip
+ \rput*(3,1.8){$\varepsilon$}
+\end{pspicture}}
+
+The parameter \verb$VarStep$ (\verb$false$ by default) activates the variable step
+algorithm. It is set to a tolerance defines by the parameter \verb$VarStepEpsilon$
+(\verb+default+ by default, accept real value). If this parameter is not set by the
+user, then it is automatically computed using the default first step given by the
+parameter \verb+plotpoints+. Then, for each step, $f''(x_n)$ and $f''(x_{n+1})$ are
+computed and the smaller is used as $M_2(f)$, and then the step is approximated. This
+means that the step is constant for a second order polynomials.
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \subsection{The cosine}
+
+ Different value for the tolerance from $0.01$ to $0.000\,1$, a factor $10$ between
+ each of them. In black, there is the classical \verb+psplot+ behavior, and in
+ magenta the default variable step behavior.
+
+\begin{center}
+\bgroup
+\psset{algebraic=true, VarStep=true, unit=2, showpoints=true, linecolor=red}
+\begin{pspicture}(-0,-1)(3.14,2)\psgrid
+ \psplot[VarStepEpsilon=.01]{0}{3.14}{cos(x)}
+ \psplot[VarStepEpsilon=.001]{0}{3.14}{cos(x)+.15}
+ \psplot[VarStepEpsilon=.0001]{0}{3.14}{cos(x)+.3}
+ \psplot[linecolor=magenta]{0}{3.14}{cos(x)+.45}
+ \psplot[VarStep=false, linewidth=2\pslinewidth, linecolor=black]{-0}{3.14}{cos(x)+.6}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{algebraic=true, VarStep=true, unit=2, showpoints=true, linecolor=red}
+\begin{pspicture}[showgrid=true](-0,-1)(3.14,2)
+ \psplot[VarStepEpsilon=.01]{0}{3.14}{cos(x)}
+ \psplot[VarStepEpsilon=.001]{0}{3.14}{cos(x)+.15}
+ \psplot[VarStepEpsilon=.0001]{0}{3.14}{cos(x)+.3}
+ \psplot[linecolor=magenta]{0}{3.14}{cos(x)+.45}
+ \psplot[VarStep=false,linewidth=1pt,linecolor=black]{-0}{3.14}{cos(x)+.6}
+\end{pspicture}
+\end{lstlisting}
+
+
+\subsection{The neperian Logarithm}
+
+A really classical example wich gives a bad beginning, the tolerance is set to $0.001$.
+
+\begin{center}
+\bgroup
+\psset{algebraic=true, VarStep=true, linecolor=red, showpoints=true}
+\begin{pspicture}[showgrid=true](0,-5)(16,4)
+ \psplot[VarStep=false, linecolor=black]{.01}{16}{ln(x)+1}
+ \psplot[linecolor=magenta]{.51}{16}{ln(x-1/2)+1/2}
+ \psplot[VarStepEpsilon=.001]{1.01}{16}{ln(x-1)}
+ \psplot[VarStepEpsilon=.01]{1.51}{16}{ln(x-1.5)-100/200}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{algebraic=true, VarStep=true, linecolor=red, showpoints=true}
+\begin{pspicture}[showgrid=true](0,-5)(16,4)
+ \psplot[VarStep=false, linecolor=black]{.01}{16}{ln(x)+1}
+ \psplot[linecolor=magenta]{.51}{16}{ln(x-1/2)+1/2}
+ \psplot[VarStepEpsilon=.001]{1.01}{16}{ln(x-1)}
+ \psplot[VarStepEpsilon=.01]{1.51}{16}{ln(x-1.5)-100/200}
+\end{pspicture}
+\end{lstlisting}
+
+
+\clearpage
+\subsection{Sinus of the inverse of $x$}
+Impossible to draw, but let's try!
+
+\begin{center}
+\bgroup
+\psset{xunit=64,algebraic,VarStep,linecolor=red,showpoints=true,linewidth=1pt}
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStepEpsilon=.0001]{.01}{.25}{sin(1/x)}
+\end{pspicture}\\
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStepEpsilon=.00001]{.01}{.25}{sin(1/x)}
+\end{pspicture}\\
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStepEpsilon=.000001]{.01}{.25}{sin(1/x)}
+\end{pspicture}\\
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStep=false, linecolor=black]{.01}{.25}{sin(1/x)}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{xunit=64,algebraic,VarStep,linecolor=red,showpoints=true,linewidth=1pt}
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStepEpsilon=.0001]{.01}{.25}{sin(1/x)}
+\end{pspicture}\\
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStepEpsilon=.00001]{.01}{.25}{sin(1/x)}
+\end{pspicture}\\
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStepEpsilon=.000001]{.01}{.25}{sin(1/x)}
+\end{pspicture}\\
+\begin{pspicture}[showgrid=true](0,-1)(.5,1)
+ \psplot[VarStep=false, linecolor=black]{.01}{.25}{sin(1/x)}
+\end{pspicture}
+\end{lstlisting}
+
+
+
+
+
+\subsection{A really complex function}
+
+Just appreciate the difference between the normal behavior and the plotting with the
+\texttt{varStep} option. The function is :
+
+\[f(x)=x-\frac{x^2}{10}+\ln(x)+\cos(2x)+\sin(x^2)-1\]
+
+\begin{center}
+\bgroup
+\psset{xunit=3, algebraic, VarStep, showpoints=true}
+\begin{pspicture}[showgrid=true](0,-2)(5,6)
+ \psplot[VarStepEpsilon=.0005, linecolor=red]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)}
+ \psplot[linecolor=magenta]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)+.5}
+ \psplot[VarStep=false]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)-1}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{xunit=3, algebraic, VarStep, showpoints=true}
+\begin{pspicture}[showgrid=true](0,-2)(5,6)
+ \psplot[VarStepEpsilon=.0005, linecolor=red]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)}
+ \psplot[linecolor=magenta]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)+.5}
+ \psplot[VarStep=false]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)-1}
+\end{pspicture}
+\end{lstlisting}
+
+
+\subsection{A hyperbola}
+
+\begin{center}
+\bgroup
+\psset{algebraic=true, showpoints=true, unit=0.75}
+\begin{pspicture}(-5,-4)(9,6)
+ \psplot[linecolor=black]{-5}{1.8}{(x-1)/(x-2)}
+ \psplot[VarStep=true, VarStepEpsilon=.001, linecolor=red]{2.2}{9}{(x-1)/(x-2)}
+ \psaxes{->}(0,0)(-5,-4)(9,6)
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{algebraic=true, showpoints=true, unit=0.75}
+\begin{pspicture}(-5,-4)(9,6)
+ \psplot[linecolor=black]{-5}{1.8}{(x-1)/(x-2)}
+ \psplot[VarStep=true, VarStepEpsilon=.001, linecolor=red]{2.2}{9}{(x-1)/(x-2)}
+ \psaxes{->}(0,0)(-5,-4)(9,6)
+\end{pspicture}
+\end{lstlisting}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{Successive derivatives of a polynom}
+
+\begin{center}
+\bgroup
+\psset{unit=2, algebraic=true, VarStep=true, showpoints=true, VarStepEpsilon=.001}
+\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
+ DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
+ OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
+\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
+ \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
+ \multido{\in=0+1}{16}{%
+ \psplot[algebraic=true, linecolor=\getColor{\in}]{0.1}{7}
+ {Derive(\in,Sum(i,0,1,7,(-1)^i*x^(2*i)/Fact(2*i)))}}
+ \endpsclip
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{unit=2, algebraic=true, VarStep=true, showpoints=true, VarStepEpsilon=.001}
+\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
+ DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
+ OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
+\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
+ \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
+ \multido{\in=0+1}{16}{%
+ \psplot[algebraic=true, linecolor=\getColor{\in}]{0.1}{7}
+ {Derive(\in,Sum(i,0,1,7,(-1)^i*x^(2*i)/Fact(2*i)))}}
+ \endpsclip
+\end{pspicture}
+\end{lstlisting}
+
+
+\subsection{The variable step algorithm together with the \texttt{IfTE} primitive}
+
+\begin{center}
+\bgroup
+\psset{unit=1.5, algebraic, VarStep, showpoints=true, VarStepEpsilon=.001}
+\begin{pspicture}[showgrid=true](-7,-2)(2,4)
+ \psplot{-7}{2}{IfTE(x<-5,-(x+5)^3/2,IfTE(x<0,0,x^2))}
+ \psplot{-7}{2}{5*x/9+26/9}
+ \psplot[linecolor=blue]{-7}{2}{(x+7)^30/9^30*4.5-1/2}
+ \psplot[linecolor=red]{-6.9}{2}
+ {IfTE(x<-6,ln(x+7),IfTE(x<-3,x+6,IfTE(x<0.1415926,sin(x+3)+3,3.1415926-x)))}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{unit=1.5, algebraic, VarStep, showpoints=true, VarStepEpsilon=.001}
+\begin{pspicture}[showgrid=true](-7,-2)(2,4)
+ \psplot{-7}{2}{IfTE(x<-5,-(x+5)^3/2,IfTE(x<0,0,x^2))}
+ \psplot{-7}{2}{5*x/9+26/9}
+ \psplot[linecolor=blue]{-7}{2}{(x+7)^30/9^30*4.5-1/2}
+ \psplot[linecolor=red]{-6.9}{2}
+ {IfTE(x<-6,ln(x+7),IfTE(x<-3,x+6,IfTE(x<0.1415926,sin(x+3)+3,3.1415926-x)))}
+\end{pspicture}
+\end{lstlisting}
+
+
+
+\subsection{Using \CMD{parametricplot}}
+
+\begin{center}
+\bgroup
+\psset{unit=2.5}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
+ VarStepEpsilon=.0001]
+ {-3.14}{3.14}{cos(3*t)|sin(2*t)}
+\end{pspicture}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
+ VarStepEpsilon=.0001]
+ {-3.14}{3.14}{cos(3*t)|sin(2*t)}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{unit=3}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
+ VarStepEpsilon=.0001]
+ {-3.14}{3.14}{cos(3*t)|sin(2*t)}
+\end{pspicture}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
+ VarStepEpsilon=.0001]
+ {-3.14}{3.14}{cos(3*t)|sin(2*t)}
+\end{pspicture}
+\end{lstlisting}
+
+
+\begin{center}
+\bgroup
+\psset{unit=2.5}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
+ VarStepEpsilon=.0001]
+ {0}{47.115}{cos(5*t)|sin(3*t)}
+\end{pspicture}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
+ VarStepEpsilon=.0001]
+ {0}{47.115}{cos(5*t)|sin(3*t)}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{unit=2.5}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
+ VarStepEpsilon=.0001]
+ {0}{47.115}{cos(5*t)|sin(3*t)}
+\end{pspicture}
+\begin{pspicture}[showgrid=true](-1,-1)(1,1)
+\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
+ VarStepEpsilon=.0001]
+ {0}{47.115}{cos(5*t)|sin(3*t)}
+\end{pspicture}
+\end{lstlisting}
+
+
+\begin{center}
+\bgroup
+\psset{xunit=.5}
+\begin{pspicture}[showgrid=true](0,0)(12.566,2)
+\parametricplot[algebraic,linecolor=red,VarStep, showpoints=true,
+ VarStepEpsilon=.01]{0}{12.566}{t+cos(-t-PI/2)|1+sin(-t-PI/2)}
+\end{pspicture}
+%
+\begin{pspicture}[showgrid=true](0,0)(12.566,2)
+\parametricplot[algebraic,linecolor=blue,VarStep, showpoints=false,
+ VarStepEpsilon=.001]{0}{12.566}{t+cos(-t-PI/2)|1+sin(-t-PI/2)}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{xunit=.5}
+\begin{pspicture}[showgrid=true](0,0)(12.566,2)
+\parametricplot[algebraic,linecolor=red,VarStep, showpoints=true,
+ VarStepEpsilon=.01]{0}{12.566}{t+cos(-t-PI/2)|1+sin(-t-PI/2)}
+\end{pspicture}
+%
+\begin{pspicture}[showgrid=true](0,0)(12.566,2)
+\parametricplot[algebraic,linecolor=blue,VarStep, showpoints=false,
+ VarStepEpsilon=.001]{0}{12.566}{t+cos(-t-PI/2)|1+sin(-t-PI/2)}
+\end{pspicture}
+\end{lstlisting}
+
+
+\resetOptions
+
+
+\section{New math functions and their derivative}
+
+\subsection{The inverse sin and its derivative}
+
+\begin{center}
+\bgroup
+\psset{unit=1.5}
+\begin{pspicture}[showgrid=true](-1,-2)(1,2)
+ \psplot[linecolor=blue,algebraic]{-1}{1}{asin(x)}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,-2)(1,2)
+ \psplot[linecolor=blue]{-.999}{.999}{asin(x)}
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}[showgrid=true](-1,0)(1,4)
+ \psplot[linecolor=blue]{-.97}{.97}{Derive(1,asin(x))}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,0)(1,4)
+ \psplot[linecolor=blue]{-.97}{.97}{Derive(1,asin(x))}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{unit=1.5}
+\begin{pspicture}[showgrid=true](-1,-2)(1,2)
+ \psplot[linecolor=blue,algebraic]{-1}{1}{asin(x)}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,-2)(1,2)
+ \psplot[linecolor=blue]{-.999}{.999}{asin(x)}
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}[showgrid=true](-1,0)(1,4)
+ \psplot[linecolor=red]{-.97}{.97}{Derive(1,asin(x))}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,0)(1,4)
+ \psplot[linecolor=red]{-.97}{.97}{Derive(1,asin(x))}
+\end{pspicture}
+\end{lstlisting}
+
+
+\subsection{The inverse cosine and its derivative}
+
+\begin{center}
+\bgroup
+\psset{unit=1.5}
+\begin{pspicture}[showgrid=true](-1,0)(1,3)
+ \psplot[linecolor=blue,algebraic]{-1}{1}{acos(x)}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,0)(1,3)
+ \psplot[linecolor=blue]{-.999}{.999}{acos(x)}
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
+ \psplot[linecolor=blue]{-.97}{.97}{Derive(1,acos(x))}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
+ \psplot[linecolor=blue]{-.97}{.97}{Derive(1,acos(x))}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\psset{unit=1.5}
+\begin{pspicture}[showgrid=true](-1,0)(1,3)
+ \psplot[linecolor=blue,algebraic]{-1}{1}{acos(x)}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,0)(1,3)
+ \psplot[linecolor=blue]{-.999}{.999}{acos(x)}
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
+ \psplot[linecolor=red]{-.97}{.97}{Derive(1,acos(x))}
+\end{pspicture}
+\hspace{1em}
+\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
+\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
+ \psplot[linecolor=red]{-.97}{.97}{Derive(1,acos(x))}
+\end{pspicture}
+\end{lstlisting}
+
+
+
+\subsection{The inverse tangente and its derivative}
+
+\begin{center}
+\bgroup
+\begin{pspicture}[showgrid=true](-4,-2)(4,2)
+\psset{algebraic=true}
+ \psplot[linecolor=blue,linewidth=1pt]{-4}{4}{atg(x)}
+ \psplot[linecolor=red,VarStep, VarStepEpsilon=.0001, showpoints=true]{-4}{4}{Derive(1,atg(x))}
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}[showgrid=true](-4,-2)(4,2)
+\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=blue]{-4}{4}{atg(x)}
+ \psplot[linecolor=red]{-4}{4}{Derive(1,atg(x))}
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\begin{pspicture}[showgrid=true](-4,-2)(4,2)
+\psset{algebraic=true}
+ \psplot[linecolor=blue,linewidth=1pt]{-4}{4}{atg(x)}
+ \psplot[linecolor=red,VarStep, VarStepEpsilon=.0001, showpoints=true]{-4}{4}{Derive(1,atg(x))}
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}[showgrid=true](-4,-2)(4,2)
+\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=blue]{-4}{4}{atg(x)}
+ \psplot[linecolor=red]{-4}{4}{Derive(1,atg(x))}
+\end{pspicture}
+\end{lstlisting}
+
+\subsection{Hyperbolique functions}
+
+\begin{center}
+\bgroup
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\end{lstlisting}
+
+
+
+\begin{center}
+\bgroup
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true,linewidth=1pt}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\hspace{1em}
+\begin{pspicture}(-3,-4)(3,4)
+\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
+ \psaxes{->}(0,0)(-3,-4)(3,4)
+\end{pspicture}
+\end{lstlisting}
+
+
+
+\begin{center}
+\bgroup
+\begin{pspicture}(-7,-3)(7,3)
+\psset{algebraic=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{1}{7}{Argch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
+ \psaxes{->}(0,0)(-7,-3)(7,3)
+\end{pspicture}\\[\baselineskip]
+\begin{pspicture}(-7,-3)(7,3)
+ \psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{1.001}{7}{Argch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
+ \psaxes{->}(0,0)(-7,-3)(7,3)
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\begin{pspicture}(-7,-3)(7,3)
+\psset{algebraic=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{1}{7}{Argch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
+ \psaxes{->}(0,0)(-7,-3)(7,3)
+\end{pspicture}\\[\baselineskip]
+\begin{pspicture}(-7,-3)(7,3)
+ \psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
+ \psplot[linecolor=blue,linewidth=1pt]{1.001}{7}{Argch(x)}
+ \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
+ \psaxes{->}(0,0)(-7,-3)(7,3)
+\end{pspicture}
+\end{lstlisting}
+
+
+
+\begin{center}
+\bgroup
+\begin{pspicture}(-7,-0.5)(7,6)
+\psset{algebraic=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
+ \psaxes{->}(0,0)(-7,0)(7,6)
+\end{pspicture}\\[\baselineskip]
+\begin{pspicture}(-7,-0.5)(7,6)
+\psset{algebraic=true}
+ \psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
+ \psaxes{->}(0,0)(-7,0)(7,6)
+\end{pspicture}
+\egroup
+\end{center}
+
+\begin{lstlisting}
+\begin{pspicture}(-7,-0.5)(7,6)
+\psset{algebraic=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
+ \psaxes{->}(0,0)(-7,0)(7,6)
+\end{pspicture}\\[\baselineskip]
+\begin{pspicture}(-7,-0.5)(7,6)
+\psset{algebraic=true}
+ \psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
+ \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
+ \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
+ \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
+ \psaxes{->}(0,0)(-7,0)(7,6)
+\end{pspicture}
+\end{lstlisting}
+
+\clearpage
%--------------------------------------------------------------------------------------
-\subsection[\CMD{psplotDiffEqn} -- solving diffential equations]{\CMD{psplotDiffEqn} -- solving diffential equations\footnote{This part is adapted from the package \texttt{pst-eqdf}, written by Dominique Rodriguez.}}
+\section[\CMD{psplotDiffEqn} -- solving diffential equations]{\CMD{psplotDiffEqn} -- solving diffential equations}
%--------------------------------------------------------------------------------------
A differential euqation of first order is like
-\begin{align} y'=f(x,y) \end{align}
+\begin{align} y^\prime=f(x,y,y^\prime) \end{align}
where $y$ is a function of $x$. We define some vectors $Y=[y, y', \cdots , y^{(n-1)}]$
-und $Y'=[y', y'', \cdots , y^{n}]$, depending to the order $n$.
+und $Y^\prime=[y^\prime, y^{\prime\prime}, \cdots , y^{n}]$, depending to the order $n$.
The syntax of the macro is
\begin{verbatim}
-\psplotDiffEqn[options]{x0}{x1}{y0}{f(x,y)}
+\psplotDiffEqn[options]{x0}{x1}{y0}{f(x,y,y',...)}
\end{verbatim}
\begin{itemize}\setlength\itemsep{0pt}\setlength\parsep{0pt}\setlength\parskip{0pt}
@@ -4060,11 +5217,274 @@ The new options are:
\end{itemize}
-The variable $t$ (time) is represented by $x$ in the \verb+\psplotDiffEqn+,
-$x$ and $y$ (position) are represented respectively by $y[0]$ and $y[1]$
-For \verb+funcx+ and \verb+funcy+ there is some examples at the end.
-\def\Grav{%
+\subsection{Variable step for differential equations}
+
+A new algorithm has been added for adjusting the step according to the variations of
+the curve. The parameter \verb+method+ has a new possible value : \verb+varrkiv+ to
+activate the \textsc{Runge-Kutta} method with variable step, then the parameter
+\verb+varsteptol+ (real value; \verb+.01+ by default) can control the tolerance of
+the algortihm.
+
+\begin{center}
+\bgroup
+\def\Funct{neg}\def\FunctAlg{-y[0]}
+\psset{xunit=1.5, yunit=8, showpoints=true}
+\begin{pspicture}[showgrid=true](0,0)(10,1.2)
+ \psplot[linewidth=6\pslinewidth, linecolor=green, showpoints=false]{0}{10}{2.71828182846 x neg exp}
+ \psplotDiffEqn[linecolor=magenta, method=varrkiv, varsteptol=.1, plotpoints=2]{0}{10}{1}{\Funct}
+ \rput(0,.0){\psplotDiffEqn[linecolor=blue, method=varrkiv, varsteptol=.01, plotpoints=2]{0}{10}{1}{\Funct}}
+ \rput(0,.1){\psplotDiffEqn[linecolor=Orange, method=varrkiv, varsteptol=.001, plotpoints=2]{0}{10}{1}{\Funct}}
+ \rput(0,.2){\psplotDiffEqn[linecolor=red, method=varrkiv, varsteptol=.0001, plotpoints=2]{0}{10}{1}{\Funct}}
+ \psset{linewidth=4\pslinewidth,showpoints=false}
+ \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}
+ \rput*[l](3.3,.9){\small RK ordre 4 : $\varepsilon<10^{-1}$}
+ \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}
+ \rput*[l](3.3,.8){\small RK ordre 4 : $\varepsilon<10^{-2}$}
+ \rput*(3.3,.7){\psline[linecolor=Orange](-.75cm,0)}
+ \rput*[l](3.3,.7){\small RK ordre 4 : $\varepsilon<10^{-3}$}
+ \rput*(3.3,.6){\psline[linecolor=red](-.75cm,0)}
+ \rput*[l](3.3,.6){\small RK ordre 4 : $\varepsilon<10^{-4}$}
+ \rput*(3.3,.5){\psline[linecolor=green](-.75cm,0)}
+ \rput*[l](3.3,.5){\small solution exacte}
+\end{pspicture}
+\captionof{figure}{Equation $y'=-y$ with $y_0=1$.} \label{fig:minusexpvarstep}
+\egroup
+\end{center}
+
+
+\begin{lstlisting}[wide=true]
+\def\Funct{neg}\def\FunctAlg{-y[0]}
+\psset{xunit=1.5, yunit=8, showpoints=true}
+\begin{pspicture}[showgrid=true](0,0)(10,1.2)
+ \psplot[linewidth=6\pslinewidth, linecolor=green, showpoints=false]{0}{10}{2.71828182846 x neg exp}
+ \psplotDiffEqn[linecolor=magenta, method=varrkiv, varsteptol=.1, plotpoints=2]{0}{10}{1}{\Funct}
+ \rput(0,.0){\psplotDiffEqn[linecolor=blue, method=varrkiv, varsteptol=.01, plotpoints=2]{0}{10}{1}{\Funct}}
+ \rput(0,.1){\psplotDiffEqn[linecolor=Orange, method=varrkiv, varsteptol=.001, plotpoints=2]{0}{10}{1}{\Funct}}
+ \rput(0,.2){\psplotDiffEqn[linecolor=red, method=varrkiv, varsteptol=.0001, plotpoints=2]{0}{10}{1}{\Funct}}
+ \psset{linewidth=4\pslinewidth,showpoints=false}
+ \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}
+ \rput*[l](3.3,.9){\small RK ordre 4 : $\varepsilon<10^{-1}$}
+ \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}
+ \rput*[l](3.3,.8){\small RK ordre 4 : $\varepsilon<10^{-2}$}
+ \rput*(3.3,.7){\psline[linecolor=Orange](-.75cm,0)}
+ \rput*[l](3.3,.7){\small RK ordre 4 : $\varepsilon<10^{-3}$}
+ \rput*(3.3,.6){\psline[linecolor=red](-.75cm,0)}
+ \rput*[l](3.3,.6){\small RK ordre 4 : $\varepsilon<10^{-4}$}
+ \rput*(3.3,.5){\psline[linecolor=green](-.75cm,0)}
+ \rput*[l](3.3,.5){\small solution exacte}
+\end{pspicture}
+\end{lstlisting}
+
+
+
+\begin{center}
+\bgroup
+\def\Funct{exch neg}
+\psset{xunit=1.5, yunit=5, method=varrkiv, showpoints=true}%%
+\def\quatrepi{12.5663706144}
+\begin{pspicture}(0,-1)(10,1.3)
+ \psaxes{->}(0,0)(0,-1)(10,1.3)
+ \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{10}{cos(x)}
+ \rput(0,.0){\psplotDiffEqn[linecolor=magenta, plotpoints=7, varsteptol=.1]{0}{10}{1 0}{\Funct}}
+ \rput(0,.0){\psplotDiffEqn[linecolor=blue, plotpoints=201, varsteptol=.01]{0}{10}{1 0}{\Funct}}
+ \rput(0,.1){\psplotDiffEqn[linewidth=2\pslinewidth, linecolor=red, varsteptol=.001]{0}{10}{1 0}{\Funct}}
+ \rput(0,.2){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{10}{1 0}{\Funct}}
+ \rput(0,.3){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{10}{1 0}{\Funct}}
+ \psset{linewidth=4\pslinewidth,showpoints=false}
+ \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
+ \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
+ \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
+ \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
+ \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
+ \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
+ \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
+ \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
+ \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
+ \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
+ \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
+ \rput*[l](2.3,.4){\small solution exacte}
+\end{pspicture}
+\captionof{figure}{Equation $y''=-y$}\label{fig:trigfunc}
+\egroup
+\end{center}
+
+\begin{lstlisting}[wide=true]
+\def\Funct{exch neg}
+\psset{xunit=1.5, yunit=5, method=varrkiv, showpoints=true}%%
+\def\quatrepi{12.5663706144}
+\begin{pspicture}(0,-1)(10,1.3)
+ \psaxes{->}(0,0)(0,-1)(10,1.3)
+ \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{10}{cos(x)}
+ \rput(0,.0){\psplotDiffEqn[linecolor=magenta, plotpoints=7, varsteptol=.1]{0}{10}{1 0}{\Funct}}
+ \rput(0,.0){\psplotDiffEqn[linecolor=blue, plotpoints=201, varsteptol=.01]{0}{10}{1 0}{\Funct}}
+ \rput(0,.1){\psplotDiffEqn[linewidth=2\pslinewidth, linecolor=red, varsteptol=.001]{0}{10}{1 0}{\Funct}}
+ \rput(0,.2){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{10}{1 0}{\Funct}}
+ \rput(0,.3){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{10}{1 0}{\Funct}}
+ \psset{linewidth=4\pslinewidth,showpoints=false}
+ \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
+ \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
+ \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
+ \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
+ \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
+ \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
+ \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
+ \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
+ \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
+ \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
+ \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
+ \rput*[l](2.3,.4){\small solution exacte}
+\end{pspicture}
+\end{lstlisting}
+
+
+
+
+\begin{center}
+\bgroup
+\def\Funct{exch}
+\psset{xunit=4, yunit=1, method=varrkiv, showpoints=true}%%
+\def\quatrepi{12.5663706144}
+\begin{pspicture}(0,-0.5)(3,11)
+ \psaxes{->}(0,0)(3,11)
+ \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{3}{ch(x)}
+ \rput(0,.0){\psplotDiffEqn[linecolor=magenta, varsteptol=.1]{0}{3}{1 0}{\Funct}}
+ \rput(0,.3){\psplotDiffEqn[linecolor=blue, varsteptol=.01]{0}{3}{1 0}{\Funct}}
+ \rput(0,.6){\psplotDiffEqn[linecolor=red, varsteptol=.001]{0}{3}{1 0}{\Funct}}
+ \rput(0,.9){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{3}{1 0}{\Funct}}
+ \rput(0,1.2){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{3}{1 0}{\Funct}}
+ \psset{linewidth=4\pslinewidth,showpoints=false}
+ \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
+ \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
+ \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
+ \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
+ \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
+ \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
+ \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
+ \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
+ \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
+ \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
+ \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
+ \rput*[l](2.3,.4){\small solution exacte}
+\end{pspicture}
+\captionof{figure}{Equation $y''=y$}
+\egroup
+\end{center}
+
+\begin{lstlisting}[wide=true]
+\def\Funct{exch}
+\psset{xunit=4, yunit=1, method=varrkiv, showpoints=true}%%
+\def\quatrepi{12.5663706144}
+\begin{pspicture}(0,-0.5)(3,11)
+ \psaxes{->}(0,0)(3,11)
+ \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{3}{ch(x)}
+ \rput(0,.0){\psplotDiffEqn[linecolor=magenta, varsteptol=.1]{0}{3}{1 0}{\Funct}}
+ \rput(0,.3){\psplotDiffEqn[linecolor=blue, varsteptol=.01]{0}{3}{1 0}{\Funct}}
+ \rput(0,.6){\psplotDiffEqn[linecolor=red, varsteptol=.001]{0}{3}{1 0}{\Funct}}
+ \rput(0,.9){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{3}{1 0}{\Funct}}
+ \rput(0,1.2){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{3}{1 0}{\Funct}}
+ \psset{linewidth=4\pslinewidth,showpoints=false}
+ \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
+ \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
+ \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
+ \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
+ \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
+ \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
+ \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
+ \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
+ \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
+ \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
+ \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
+ \rput*[l](2.3,.4){\small solution exacte}
+\end{pspicture}
+\end{lstlisting}
+
+
+
+
+
+\subsection{Equation of second order}
+
+Here is the traditionnal simulation of two stars attracting each other according to
+the classical gravitation law in $\displaystyle\frac{1}{r^2}$. In 2-Dimensions, the system to be
+solved is composed of four second order differential equations. In order to be
+described, each of them gives two first order equations, then we obtain a 8 sized vectorial
+equation. In the following example the masses of the stars are 1 and 20.
+
+\[
+\left\{
+\begin{array}[m]{l}
+ x''_1=\displaystyle\frac{M_2}{r^2}\cos(\theta)\\
+ y''_1=\displaystyle\frac{M_2}{r^2}\sin(\theta)\\
+ x''_2=\displaystyle\frac{M_1}{r^2}\cos(\theta)\\
+ y''_2=\displaystyle\frac{M_1}{r^2}\sin(\theta)\\
+\end{array}
+\right.
+\mbox{ avec }
+\left\{
+\begin{array}[m]{l}
+ r^2=(x_1-x_2)^2+(y_1-y_2)^2\\
+ \cos(\theta)=\displaystyle\frac{(x_1-x_2)}{r}\\
+ \sin(\theta)=\displaystyle\frac{(y_1-y_2)}{r}\\
+\end{array}
+\right.
+\mbox{%
+\begin{pspicture}[shift=-2](5,4)\psset{arrowscale=2}
+ \psframe[linewidth=.75\pslinewidth](5,4)
+ \pstGeonode[PosAngle={-90,90}](1,1){M_1}(4,3){M_2}
+ \pstHomO[HomCoef=.33, PointSymbol=none]{M_1}{M_2}[F_1]
+ \psline[arrows=->](M_1)(F_1)
+ \pstHomO[HomCoef=.33, PointSymbol=none]{M_2}{M_1}[F_2]
+ \psline[arrows=->, arrowscale=2](M_2)(F_2)
+ \pstGeonode[PointSymbol=none, PointName=none](M_2|M_1){A}
+ \psline[linewidth=.5\pslinewidth](M_1)(A)
+ \pstMarkAngle{A}{M_1}{M_2}{$\theta$}
+ \ncline[linewidth=.5\pslinewidth, offset=.5, arrows=<->]{M_1}{M_2}
+ \ncput*{$r$}
+\end{pspicture}}
+\]
+
+\begin{table}[htbp]
+ \begin{center}\small
+ \begin{tabular}{|l@{}>{\ttfamily}l@{}>{ \ttfamily \%\% }l|}
+ \hline
+ && x1 y1 x'1 y'1 x2 y2 x'2 y'2\\
+ &/yp2 exch def /xp2 exch def /ay2 exch def /ax2 exch def&mise en variables\\
+ &/yp1 exch def /xp1 exch def /ay1 exch def /ax1 exch def&mise en variables\\
+ &/ro2 ax2 ax1 sub dup mul ay2 ay1 sub dup mul add def&calcul de r*r\\
+ &xp1 yp1&\\
+ &ax2 ax1 sub ro2 sqrt div ro2 div&calcul de x''1\\
+ &ay2 ay1 sub ro2 sqrt div ro2 div&calcul de y''1\\
+ &xp2 yp2&\\
+ &3 index -20 mul&calcul de x''2=-20x''1\\
+ &3 index -20 mul&calcul de y''2=-20y''1\\
+ \hline
+ \end{tabular}
+ \caption{\PostScript source code for the gravitational interaction}
+ \label{intgravcode}
+ \end{center}
+\end{table}
+
+\begin{table}[htbp]
+ \begin{center}\small\newcommand{\POW}{\symbol{'136}}
+ \begin{tabular}{|l@{}>{\ttfamily}l@{}>{ \ttfamily \%\% }l|}
+ \hline
+ &y[2]|&y'[0]\\
+ &y[3]|&y'[1]\\
+ &(y[4]-y[0])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5|&y'[2]=y''[0]\\
+ &(y[5]-y[1])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5|&y'[3]=y''[1]\\
+ &y[6]|&y'[4]\\
+ &y[7]|&y'[5]\\
+ &20*(y[0]-y[4])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5|&y'[6]=y''[4]\\
+ &20*(y[1]-y[5])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5&y'[7]=y''[5]\\
+ \hline
+ \end{tabular}
+ \caption{Algebraic description for the gravitational interaction}
+ \label{intgravalgcode}
+ \end{center}
+\end{table}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand\Grav{%
/yp2 exch def /xp2 exch def /ay2 exch def /ax2 exch def
/yp1 exch def /xp1 exch def /ay1 exch def /ax1 exch def
/ro2 ax2 ax1 sub dup mul ay2 ay1 sub dup mul add def
@@ -4074,102 +5494,81 @@ For \verb+funcx+ and \verb+funcy+ there is some examples at the end.
xp2 yp2
3 index -20 mul
3 index -20 mul}
+\newcommand\GravAlg{%
+ y[2]|y[3]|%
+ (y[4]-y[0])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
+ (y[5]-y[1])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
+ y[6]|y[7]|%
+ 20*(y[0]-y[4])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
+ 20*(y[1]-y[5])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5}
%% 0 1 2 3 4 5 6 7
%% x1 y1 x'1 y'1 x2 y2 x'2 y'2
-\def\InitCond{ 1 1 .1 0 -1 -1 -2 0}
-\begin{lstlisting}
-\def\Grav{%
- /yp2 exch def /xp2 exch def /ay2 exch def /ax2 exch def
- /yp1 exch def /xp1 exch def /ay1 exch def /ax1 exch def
- /ro2 ax2 ax1 sub dup [21~mul ay2 ay1 sub dup mul add def
- xp1 yp1
- ax2 ax1 sub ro2 sqrt div ro2 div
- ay2 ay1 sub ro2 sqrt div ro2 div
- xp2 yp2
- 3 index -20 mul 3 index -20 mul}
- %% 0 1 2 3 4 5 6 7
- %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
+
+\begin{LTXexample}[width=5cm]
\def\InitCond{ 1 1 .1 0 -1 -1 -2 0}
-\end{lstlisting}
+\begin{pspicture}[shift=-2,showgrid=true](-3,-2)(2,2)
+ \psplotDiffEqn[whichabs=0, whichord=1, linecolor=blue, method=rk4, plotpoints=100]{0}{3.95}
+ {\InitCond}{\Grav}
+ \psset{showpoints=true,whichabs=4, whichord=5}
+ \psplotDiffEqn[linecolor=black, method=varrkiv, varsteptol=.0001, plotpoints=200]{0}{3.9}
+ {\InitCond}{\Grav}
+\end{pspicture}
+\end{LTXexample}
+\captionof{figure}{Gravitational interaction : fixed landmark, trajectory of the stars}\label{fig:InterGravRepFix}
-%--------------------------------------------------------------------------------------
-\subsubsection{\texttt{plotfuncx} and \texttt{plotfuncy}}
-%--------------------------------------------------------------------------------------
-%[pos=b,caption={Gravitational interaction: center to one of the star}]
-\begin{lstlisting}
-\begin{pspicture}(-4,-2.5)(1,1.1)\psgrid[subgriddiv=1]
- \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=200,%
- plotfuncx=y dup 4 get exch 0 get sub,%
- plotfuncy=dup 5 get exch 1 get sub ]{0}{3.9}{\InitCond}{\Grav}
+
+
+\begin{LTXexample}[width=5cm]
+\def\InitCond{ 1 1 .1 0 -1 -1 -2 0}
+\begin{pspicture}[shift=-1.5,showgrid=true](-4,-2)(1,1)
+ \psset{showpoints=true}
+ \psplotDiffEqn[linecolor=red, plotpoints=200,method=varrkiv, varsteptol=.0001,
+ plotfuncx=y dup 4 get exch 0 get sub ,
+ plotfuncy=dup 5 get exch 1 get sub ]{0}{3.9}{\InitCond}{\Grav}
\end{pspicture}
-\end{lstlisting}
+\end{LTXexample}
+\captionof{figure}{Gravitational interaction : landmark defined by one star}\label{fig:IGnewrep}
\begin{center}
\bgroup
-\begin{pspicture}(-4,-2.5)(1,1.1)\psgrid[subgriddiv=1]
- \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=200,%
- plotfuncx=y dup 4 get exch 0 get sub,%
- plotfuncy=dup 5 get exch 1 get sub ]{0}{3.9}{\InitCond}{\Grav}
+\def\InitCond{ 1 1 .1 0 -1 -1 -2 0}
+\psset{xunit=2}
+\begin{pspicture}[showgrid=true](0,0)(8,9)
+ \psset{showpoints=true}
+ \psplotDiffEqn[linecolor=red, method=varrkiv, plotpoints=2, varsteptol=.0001,
+ plotfuncy=dup 6 get dup mul exch 7 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
+ \psplotDiffEqn[linecolor=blue, method=varrkiv, plotpoints=2, varsteptol=.0001,
+ plotfuncy=dup 2 get dup mul exch 3 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
\end{pspicture}
\egroup
+\captionof{figure}{Gravitational interaction : vitessesspeed of the stars}
\end{center}
-The center of the landmark is set to $y[0]$ and $y[1]$
-There is also a drawing of the speed (vitesse in french) of the stars which uses
-these parameters.
-
-\iffalse
-
-%--------------------------------------------------------------------------------------
-\subsection{PostScript}
-%--------------------------------------------------------------------------------------
-
-PostScript uses the stack system and the LIFO system, "'Last In, First Out"`.
-
-\newlength{\Li}\settowidth{\Li}{Function}
-\begin{table}[htbp]
- \begin{center}{\ttfamily
- \begin{tabular}{|l|r@{ $\rightarrow$ }l|}\hline
- \multirow{2}{\Li}{\normalfont Function}&\multicolumn{2}{c|}{\normalfont Pile de donnés}\\
- &\normalfont on stack before & \normalfont after\\\hline\hline
- add&$x\quad y$&$x+y$\\\hline
- sub&$x\quad y$&$x-y$\\\hline
- mul&$x\quad y$&$x\times y$\\\hline
- div&$x\quad y$&$x\div y$\\\hline
- sqrt&$x$&$\sqrt{x}$\\\hline
- abs&$x$&$|x|$\\\hline
- neg&$x$&$-x$\\\hline
- cos&$x$&$\cos(x)$ ($x$ in degrees)\\\hline
- sin&$x$&$\sin(x)$ ($x$ in degrees)\\\hline
- tan&$x$&$\tan(x)$ ($x$ in degrees)\\\hline
- atan&$y\quad x$&$\angle{(\vec{Ox};\vec{OM})}$ (in degrees of $M(x,y)$)\\\hline
- ln&$x$&$\ln(x)$\\\hline
- log&$x$&$\log(x)$\\\hline
- array&$n$&\normalfont$v$ (of dimension $n$)\\\hline
- aload&$v$&$x_1\quad x_2\quad \cdots\quad x_n\quad v$\\\hline
- astore&$x_1\quad x_2\quad \cdots\quad x_n\quad v$&$v$\\\hline
- pop&$x$&\\\hline
- dup&$x\quad x$&\\\hline
- roll&$x_1\quad x_2\quad \cdots\quad x_n\quad n p$&\\\hline
- \end{tabular}}
- \caption{Some primitive PostScript macros}\label{tab:primpost}
- \end{center}
-\end{table}
+\begin{lstlisting}
+\psset{xunit=2}
+\begin{pspicture}[showgrid=true](0,0)(8,9)
+ \psset{showpoints=true}
+ \psplotDiffEqn[linecolor=red, method=varrkiv, plotpoints=2, varsteptol=.0001,
+ plotfuncy=dup 6 get dup mul exch 7 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
+ \psplotDiffEqn[linecolor=blue, method=varrkiv, plotpoints=2, varsteptol=.0001,
+ plotfuncy=dup 2 get dup mul exch 3 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
+\end{pspicture}
+\end{lstlisting}
-\fi
%--------------------------------------------------------------------------------------
\subsubsection{Simple equation of first order$y'=y$}
%--------------------------------------------------------------------------------------
-
+
For the initial value $y(0)=1$ we have the solution $y(x)=e^x$. $y$ is always
on the stack, so we have to do nothing. Using the \verb+algebraic+ option, we write it
as \verb$y[0]$. The following example shows different solutions depending to the number of plotpoints
with $y_0=1$:
-\begin{lstlisting}
+\begin{center}
+\bgroup
\psset{xunit=4, yunit=.4}
\begin{pspicture}(3,19)\psgrid[subgriddiv=1]
\psplot[linewidth=6\pslinewidth, linecolor=green]{0}{3}{Euler x exp}
@@ -4189,10 +5588,10 @@ with $y_0=1$:
\rput*(0.35,11){\psline[linecolor=green](-.75cm,0)}
\rput*[l](0.35,11){\small solution exacte}
\end{pspicture}
-\end{lstlisting}
+\egroup
+\end{center}
-\begin{center}
-\bgroup
+\begin{lstlisting}
\psset{xunit=4, yunit=.4}
\begin{pspicture}(3,19)\psgrid[subgriddiv=1]
\psplot[linewidth=6\pslinewidth, linecolor=green]{0}{3}{Euler x exp}
@@ -4212,66 +5611,9 @@ with $y_0=1$:
\rput*(0.35,11){\psline[linecolor=green](-.75cm,0)}
\rput*[l](0.35,11){\small solution exacte}
\end{pspicture}
-\egroup
-\end{center}
-
-\clearpage
-%--------------------------------------------------------------------------------------
-\subsubsection{$y'=-y$}
-%--------------------------------------------------------------------------------------
-
-For the initial value $y(0)=1$ we get the solution $y(x)=e^{-x}$, which is seen in
-the following example with $y_0=1$:
-
-\begin{lstlisting}[xrightmargin=-1cm]
-\def\Funct{neg}\def\FunctAlg{-y[0]}
-\psset{xunit=1.5, yunit=7}
-\begin{pspicture}(0,0)(10,1)\psgrid[subgriddiv=1]
- \psplot[linewidth=6\pslinewidth,linecolor=green]{0}{10}{Euler x neg exp}
- \psplotDiffEqn[linecolor=magenta,plotpoints=11]{0}{10}{1}{\Funct}
- \psplotDiffEqn[linecolor=blue,plotpoints=101,algebraic=true]{0}{10}{1}{\FunctAlg}
- \psplotDiffEqn[linecolor=Orange,method=rk4,plotpoints=11]{0}{10}{1}{\Funct}
- \psplotDiffEqn[linecolor=red,method=rk4,plotpoints=51]{0}{10}{1}{\Funct}
- \psset{linewidth=4\pslinewidth}
- \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}
- \rput*[l](3.3,.9){\small Euler order 1 $h=1$}
- \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}
- \rput*[l](3.3,.8){\small Euler order 1 $h=0{,}1$}
- \rput*(3.3,.7){\psline[linecolor=Orange](-.75cm,0)}
- \rput*[l](3.3,.7){\small RK ordre 4 $h=1$}
- \rput*(3.3,.6){\psline[linecolor=red](-.75cm,0)}
- \rput*[l](3.3,.6){\small RK ordre 4 $h=0{,}2$}
- \rput*(3.3,.5){\psline[linecolor=green](-.75cm,0)}
- \rput*[l](3.3,.5){\small solution exacte}
-\end{pspicture}
\end{lstlisting}
-
-\begin{center}
-\bgroup
-\def\Funct{neg}\def\FunctAlg{-y[0]}
-\psset{xunit=1.5, yunit=7}
-\begin{pspicture}(0,0)(10,1)\psgrid[subgriddiv=1]
- \psplot[linewidth=6\pslinewidth,linecolor=green]{0}{10}{Euler x neg exp}
- \psplotDiffEqn[linecolor=magenta,plotpoints=11]{0}{10}{1}{\Funct}
- \psplotDiffEqn[linecolor=blue,plotpoints=101,algebraic=true]{0}{10}{1}{\FunctAlg}
- \psplotDiffEqn[linecolor=Orange,method=rk4,plotpoints=11]{0}{10}{1}{\Funct}
- \psplotDiffEqn[linecolor=red,method=rk4,plotpoints=51]{0}{10}{1}{\Funct}
- \psset{linewidth=4\pslinewidth}
- \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}
- \rput*[l](3.3,.9){\small Euler order 1 $h=1$}
- \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}
- \rput*[l](3.3,.8){\small Euler order 1 $h=0{,}1$}
- \rput*(3.3,.7){\psline[linecolor=Orange](-.75cm,0)}
- \rput*[l](3.3,.7){\small RK ordre 4 $h=1$}
- \rput*(3.3,.6){\psline[linecolor=red](-.75cm,0)}
- \rput*[l](3.3,.6){\small RK ordre 4 $h=0{,}2$}
- \rput*(3.3,.5){\psline[linecolor=green](-.75cm,0)}
- \rput*[l](3.3,.5){\small solution exacte}
-\end{pspicture}
-\egroup
-\end{center}
-
+\clearpage
%--------------------------------------------------------------------------------------
\subsubsection{$y'=\displaystyle\frac{2-ty}{4-t^2}$}% $
%--------------------------------------------------------------------------------------
@@ -4427,7 +5769,7 @@ The integrals of Fresnel :
-
+\clearpage
%--------------------------------------------------------------------------------------
\subsubsection{Lotka-Volterra}
%--------------------------------------------------------------------------------------
@@ -4697,112 +6039,8 @@ sub %% y' y'/-4-2y
\psplotDiffEqn[linecolor=black,algebraic=true]{0}{26}{5 0}{y[1]|-y[1]/4-2*y[0]}
\end{pspicture}
\end{lstlisting}
-%--------------------------------------------------------------------------------------
-\subsubsection{Gravitation example of second order}
-%--------------------------------------------------------------------------------------
-
-\[
-\left\{
-\begin{array}[m]{l}
- x''_1=\displaystyle\frac{M_2}{r^2}\cos(\theta)\\
- y''_1=\displaystyle\frac{M_2}{r^2}\sin(\theta)\\
- x''_2=\displaystyle\frac{M_1}{r^2}\cos(\theta)\\
- y''_2=\displaystyle\frac{M_1}{r^2}\sin(\theta)\\
-\end{array}
-\right.
-\mbox{ avec }
-\left\{
-\begin{array}[m]{l}
- r^2=(x_1-x_2)^2+(y_1-y_2)^2\\
- \cos(\theta)=\displaystyle\frac{(x_1-x_2)}{r}\\
- \sin(\theta)=\displaystyle\frac{(y_1-y_2)}{r}\\
-\end{array}
-\right.
-\mbox{
-\begin{pspicture}[shift=.5](5,4)\psset{arrowscale=2}
- \psframe[linewidth=.75\pslinewidth](5,4)
- \pstGeonode[PosAngle={-90,90}](1,1){M1}(4,3){M2}
- \pstHomO[HomCoef=.33, PointSymbol=none]{M1}{M2}{F1}
- \psline[arrows=->](M1)(F1)
- \pstHomO[HomCoef=.33, PointSymbol=none]{M2}{M1}{F2}
- \psline[arrows=->, arrowscale=2](M2)(F2)
- \pstGeonode[PointSymbol=none](M2|M1){A}
- \psline[linewidth=.5\pslinewidth](M1)(A)
- \pstMarkAngle{A}{M1}{M2}{$\theta$}
- \ncline[linewidth=.5\pslinewidth, offset=.5, arrows=<->]{M1}{M2}
- \ncput*{$r$}
-\end{pspicture}%
-}
-\]
-
-
-\begin{table}[htbp]
-\centering
- \caption{PostScript code for the gravitation examples}\label{intgravcode}
-\small\ttfamily
- \begin{tabularx}{\linewidth}{XX} \hline
- & x1 y1 x'1 y'1 x2 y2 x'2 y'2\\
- /yp2 exch def /xp2 exch def /ay2 exch def /ax2 exch def&mise en variables\\
- /yp1 exch def /xp1 exch def /ay1 exch def /ax1 exch def&mise en variables\\
- /ro2 ax2 ax1 sub dup mul ay2 ay1 sub dup mul add def&calcul de r*r\\
- xp1 yp1&\\
- ax2 ax1 sub ro2 sqrt div ro2 div&calcul de x''1\\
- ay2 ay1 sub ro2 sqrt div ro2 div&calcul de y''1\\
- xp2 yp2&\\
- 3 index -20 mul&calcul de x''2=-20x''1\\
- 3 index -20 mul&calcul de y''2=-20y''1\\\hline
- \end{tabularx}
-\end{table}
-
-\def\Grav{%
- /yp2 exch def /xp2 exch def /ay2 exch def /ax2 exch def
- /yp1 exch def /xp1 exch def /ay1 exch def /ax1 exch def
- /ro2 ax2 ax1 sub dup mul ay2 ay1 sub dup mul add def
- xp1 yp1
- ax2 ax1 sub ro2 sqrt div ro2 div
- ay2 ay1 sub ro2 sqrt div ro2 div
- xp2 yp2
- 3 index -20 mul
- 3 index -20 mul}
-\def\GravAlg{%
- y[2]|y[3]|%
- (y[4]-y[0])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
- (y[5]-y[1])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
- y[6]|y[7]|%
- 20*(y[0]-y[4])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
- 20*(y[1]-y[5])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5}
- %% 0 1 2 3 4 5 6 7
- %% x1 y1 x'1 y'1 x2 y2 x'2 y'2
-\def\InitCond{ 1 1 .1 0 -1 -1 -2 0}
-
-\begin{LTXexample}[pos=t,preset=\centering]
-\begin{pspicture}(-3,-2.5)(2,2.25)
- \psgrid[subgriddiv=0,gridcolor=lightgray,linewidth=1.5pt]
- \psset{method=rk4,plotpoints=200,whichord=1}
- \psplotDiffEqn[whichabs=0,linecolor=blue]{0}{8}{\InitCond}{\Grav}
- \psplotDiffEqn[whichabs=4,whichord=5,linecolor=red]{0}{8}{\InitCond}{\Grav}
- \psplotDiffEqn[whichabs=4,linecolor=Orange,algebraic]{0}{8}{\InitCond}{\GravAlg}
- \psplotDiffEqn[whichabs=0,whichord=1,linecolor=yellow,algebraic]{0}{8}{\InitCond}{\GravAlg}
-\end{pspicture}
-\end{LTXexample}
-
-\begin{LTXexample}[pos=t,preset=\centering]
-\begin{pspicture}(-4,-2.5)(1,1.25)
- \psgrid[subgriddiv=0,gridcolor=lightgray]
- \psplotDiffEqn[linecolor=red,method=rk4,plotpoints=200,linewidth=1.5pt,%
- plotfuncx=y dup 4 get exch 0 get sub,
- plotfuncy=dup 5 get exch 1 get sub ]{0}{8}{\InitCond}{\Grav}
-\end{pspicture}
-\end{LTXexample}
-\begin{LTXexample}[pos=t,preset=\centering]
-\begin{pspicture}(0,-0.5)(8,8)
- \psset{yunit=0.8,method=rk4,plotpoints=200,linewidth=1.5pt}
- \psgrid[subgriddiv=0,gridcolor=lightgray](8,9)
- \psplotDiffEqn[linecolor=red,plotfuncy=dup 6 get dup mul exch 7 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
- \psplotDiffEqn[linecolor=blue,plotfuncy=dup 2 get dup mul exch 3 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
-\end{pspicture}
-\end{LTXexample}
+\iffalse
\newpage
%--------------------------------------------------------------------------------------
@@ -4886,12 +6124,128 @@ est remarquable.
\end{pspicture}
\end{LTXexample}
+\fi
+
+
+%--------------------------------------------------------------------------------------
+\subsection{\CMD{psMatrixPlot}}
+%--------------------------------------------------------------------------------------
+\begin{filecontents}{matrix.dat}
+/dotmatrix [ %
+0 1 1 0 0 0 0 1 1 1
+0 1 1 0 1 1 1 0 1 0
+1 0 1 1 0 0 0 1 1 0
+0 0 1 0 0 0 0 0 1 1
+1 1 1 1 1 0 1 0 0 1
+0 0 1 1 0 1 0 1 1 1
+1 0 0 0 1 1 0 0 0 1
+0 0 0 1 1 1 0 1 1 0
+1 1 0 0 0 0 1 0 0 1
+1 0 1 0 0 1 1 1 0 0
+] def
+\end{filecontents}
+
+
+This macro allows to visualize a matrix. The datafile must be defined as a PostScript matrix
+named \verb+/dotmatrix+:
+\begin{verbatim}
+/dotmatrix [ % <------------ important line
+0 1 1 0 0 0 0 1 1 1
+0 1 1 0 1 1 1 0 1 0
+1 0 1 1 0 0 0 1 1 0
+0 0 1 0 0 0 0 0 1 1
+1 1 1 1 1 0 1 0 0 1
+0 0 1 1 0 1 0 1 1 1
+1 0 0 0 1 1 0 0 0 1
+0 0 0 1 1 1 0 1 1 0
+1 1 0 0 0 0 1 0 0 1
+1 0 1 0 0 1 1 1 0 0
+] def % <------------ important line
+\end{verbatim}
+
+Important is only the value 0, in this case there happens nothing and for all other
+cases a dot is printed. The syntax of the macro is:
+\begin{verbatim}
+ \psMatrixPlot[options]{rows}{columns}{data file}
+\end{verbatim}
+
+The matrix is scanned line by line from the the first one to the last. In general it
+looks vice versa than the above listed matrix, the first row $0\,1\,1\,0\,0\,0\,0\,1\,1\,1$
+is the first plotted line ($y=1$). With the option \verb+ChangeOrder=true+ it looks exactly like
+the above view.
+
+\bgroup
+\begin{center}
+%\begin{LTXexample}[pos=t,preset=\centering]
+\begin{pspicture}(-0.5,-0.75)(11,11)
+ \psaxes{->}(11,11)
+ \psMatrixPlot[dotsize=1.1cm,dotstyle=square*,linecolor=magenta]%
+ {10}{10}{matrix.dat}
+ \psMatrixPlot[dotsize=.5cm,dotstyle=o,ChangeOrder]{10}{10}{matrix.dat}
+\end{pspicture}
+%\end{LTXexample}
+
+\begin{lstlisting}
+\begin{pspicture}(-0.5,-0.75)(11,11)
+ \psaxes{->}(11,11)
+ \psMatrixPlot[dotsize=1.1cm,dotstyle=square*,linecolor=magenta]%
+ {10}{10}{matrix.dat}
+ \psMatrixPlot[dotsize=.5cm,dotstyle=o,ChangeOrder]{10}{10}{matrix.dat}
+\end{pspicture}
+\end{lstlisting}
+
+\begin{LTXexample}[pos=t,preset=\centering]
+\begin{pspicture}(-0.5,-0.75)(11,11)
+ \psaxes{->}(11,11)
+ \psMatrixPlot[dotscale=3,dotstyle=*,linecolor=blue]{10}{8}{matrix.dat}
+\end{pspicture}
+\end{LTXexample}
+\end{center}
+\egroup
+
+
+%--------------------------------------------------------------------------------------
+\subsection{PostScript}
+%--------------------------------------------------------------------------------------
+
+PostScript uses the stack system and the LIFO system, "'Last In, First Out"`.
+
+\newlength{\Li}\settowidth{\Li}{Function}
+\begin{table}[htbp]
+ \begin{center}{\ttfamily
+ \begin{tabular}{|l|r@{ $\rightarrow$ }l|}\hline
+ \multirow{2}{\Li}{\normalfont Function}&\multicolumn{2}{c|}{\normalfont Meaning}\\
+ &\normalfont on stack before & \normalfont after\\\hline\hline
+ add&$x\quad y$&$x+y$\\\hline
+ sub&$x\quad y$&$x-y$\\\hline
+ mul&$x\quad y$&$x\times y$\\\hline
+ div&$x\quad y$&$x\div y$\\\hline
+ sqrt&$x$&$\sqrt{x}$\\\hline
+ abs&$x$&$|x|$\\\hline
+ neg&$x$&$-x$\\\hline
+ cos&$x$&$\cos(x)$ ($x$ in degrees)\\\hline
+ sin&$x$&$\sin(x)$ ($x$ in degrees)\\\hline
+ tan&$x$&$\tan(x)$ ($x$ in degrees)\\\hline
+ atan&$y\quad x$&$\angle{(\vec{Ox};\vec{OM})}$ (in degrees of $M(x,y)$)\\\hline
+ ln&$x$&$\ln(x)$\\\hline
+ log&$x$&$\log(x)$\\\hline
+ array&$n$&\normalfont$v$ (of dimension $n$)\\\hline
+ aload&$v$&$x_1\quad x_2\quad \cdots\quad x_n\quad v$\\\hline
+ astore&$x_1\quad x_2\quad \cdots\quad x_n\quad v$&$v$\\\hline
+ pop&$x$&\\\hline
+ dup&$x\quad x$&\\\hline
+ roll&$x_1\quad x_2\quad \cdots\quad x_n\quad n p$&\\\hline
+ \end{tabular}}
+ \caption{Some primitive PostScript macros}\label{tab:primpost}
+ \end{center}
+\end{table}
+
%--------------------------------------------------------------------------------------
-\subsection{\CMD{resetOptions}}
+\section{\CMD{resetOptions}}
%--------------------------------------------------------------------------------------
-Sometimes it is difficult to know what options which are changed inside a long document
+Sometimes it is difficult to know what options, which are changed inside a long document,
are different to the default one. With this
macro all options depending to \verb+pst-plot+ can be reset. This depends to all
options of the packages \verb+pstricks+, \verb+pst-plot+ and \verb+pst-node+.
@@ -4906,20 +6260,22 @@ options of the packages \verb+pstricks+, \verb+pst-plot+ and \verb+pst-node+.
{Denis Girou | }
{Peter Hutnick | }
{Christophe Jorssen | }
+{Uwe Kern | }
{Manuel Luque | }
{Jens-Uwe Morawski |}
{Tobias N\"ahring |}
{Rolf Niepraschk |}
-{Dominique Rodriguez |}
{Arnaud Schmittbuhl |}
{Timothy Van Zandt}
\nocite{*}
+\bgroup
+\raggedright
\bibliographystyle{plain}
-\bibliography{pstricks}
-
+\bibliography{pstricks-add-doc}
+\egroup
%--------------------------------------------------------------------------------------
\section{Change log}
@@ -4931,3 +6287,5 @@ See file Changes
%\section{The code}
%\lstinputlisting{pstricks-add.tex}
+
+
diff --git a/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro b/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
index 21547282722..df844e2828e 100644
--- a/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
+++ b/Master/texmf-dist/dvips/pstricks-add/pstricks-add.pro
@@ -1,16 +1,20 @@
%!
% PostScript prologue for pstricks-add.tex.
-% Version 0.01, 2005/09/27
+% Version 0.08, 2006/06/17
% For distribution, see pstricks.tex.
%
% HISTORY
+% 2006/06/17 : - changes to the code (hv)
+% 2006/04/21 : - Improved parser -> generic with derivative and translator into ps (dr)
+% 2006/01/16 : - EXP -> Exp to prevent missmatch with pst-math (hv)
% 2005/09/28 : - rename it to pstricks-add.pro
-% - agg support for Gouraud shading
+% - add support for Gouraud shading (hv)
% 2005/05/20 : small (unimportant) changes (hv)
-% 2005/02/25 : white space removal from expression
-% 2004/12/16 : addition of SUM and IFTE
+% 2005/02/25 : white space removal from expression (dr)
+% 2004/12/16 : addition of Sum and IfTE (dr)
% 2004/11/14 : correction of a priority problem
% ^ before unary - (new rule FS)
+%
/tx@addDict 410 dict def tx@addDict begin
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Pi and Euler are defined in pstricks.pro
@@ -32,584 +36,21 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% parser
%% str -> [ LIFO vector ]
-/AlgParser { InitParser SetExpr LexStr 0 exch AnalyzeListOfE ExpressionVector /ExpressionVector [] def} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-/SetExpr { RemoveWS /ExpressionString exch def } def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-/InitParser {
- /ExpressionVector [] def /AddVector [] def
- /AddVectorfree [] def /MulVector [] def
- /MulVectorfree [] def /PowVector [] def
- /PowVectorfree [] def /OpParVector [] def
- /ClParVector [] def /ParVectorFree [] def
- %%/CompVector [] def /CompVectorFree [] def
- /BraVector [] def /SemVector [] def
- /ComVector [] def /ExpressionVector [] def
- /LoopLevel -1 def /LoopContext [] def %%% NEW for SUM function
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-/FLbreak { tst not {/L exch def /F exch def 2 copy L eq exch F eq and /tst exch def} {pop pop} ifelse} def
-/Negbreak { tst not { dup 0 lt /tst exch def } if } def
-/STOP { tst {TOUF} if} def
-/tst false def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% analyze Expression List
-%% first last
-/AnalyzeListOfE {
- exch SemVector {
- exch 1 index 1 sub AnalyzeExpr 1 add
- } forall%%last_char
- exch AnalyzeExpr
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% analyze Expr
-%% first last
-/AnalyzeExpr {
- FindFirstAdd%% first last pos+
- 2 copy abs 1 sub ne
- { 3 -1 roll 1 index abs 1 sub AnalyzeExpr dup abs 1 add 3 -1 roll AnalyzeTerm EvalAdd }
- { pop AnalyzeTerm } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% analyze Term
-%% first last
-/AnalyzeTerm {%%19 28 FLbreak STOP
- FindFirstMul%% first last pos*
- 2 copy abs 1 sub ne
- { 3 -1 roll 1 index abs 1 sub AnalyzeTerm dup abs 1 add 3 -1 roll AnalyzeSignedFactor EvalMul }%%% NEW 2004/11/14
- { pop AnalyzeSignedFactor } ifelse%%% NEW 2004/11/14
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% NEW 2004/11/14
-%% analyze Signed Factor
-%% first last ->
-/AnalyzeSignedFactor {
- ExpressionString 2 index get
- dup 45 eq%% a - sign
- { pop exch 1 add exch AnalyzeSignedFactor EvalNeg }
- { 43 eq%%a + sign
- { exch 1 add exch AnalyzeSignedFactor }
- { AnalyzeFactor } ifelse } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% analyze Factor
-%% first last ->
-/AnalyzeFactor {
- FindFirstPow%% first last pos*
- 2 copy abs 1 sub ne
-% { 3 -1 roll 1 index abs 1 sub AnalyzeFactor dup abs 1 add 3 -1 roll AnalyzePower EvalPow }
- { 3 -1 roll 1 index abs 1 sub AnalyzeFactor dup abs 1 add 3 -1 roll AnalyzeSignedFactor EvalPow }% NEW 2004/11/14
- { pop AnalyzePower } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% analyze Power
-%% first last ->
-/compteur 0 def
-/AnalyzePower {
- ExpressionString 2 index get
- dup 40 eq%% an open parenthesis
- { pop 1 index UnfreePar 1 sub exch 1 add exch AnalyzeExpr }
- { dup 45 eq%% a - sign
- { pop exch 1 add exch AnalyzePower EvalNeg }
- { dup 43 eq%%a + sign
- { pop exch 1 add exch AnalyzePower }
- { dup 46 eq 1 index 48 ge 2 index 57 le and or%%a digit or a dot
- { pop AnalyzeNumber }
- { pop AnalyzeLiteral } ifelse } ifelse } ifelse } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% analyze parameters list
-%% first last
-/AnalyzeParam {
- { FindFirstCom%% first last pos,
- 3 -1 roll 1 index 1 sub AnalyzeExpr
- 2 copy 1 sub ne { 1 add exch } { pop pop exit } ifelse
- } loop
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Find the eventual addition at this level
-%% first last -> position
-/FindFirstAdd {
- 2 copy /Last exch def /First exch def false 0
- AddVector {
- AddVectorFree 2 index get
- { /pos exch def
- %% if it is in the current part of the analysed expr
- pos abs First gt pos abs Last lt and
- { true 0 1 ClParVector length
- dup 0 eq%% no parenthesis
- { pop pop pop pop exch not exch exit }
- { 1 sub
- { ParVectorFree 1 index get
- { OpParVector 1 index get pos abs lt%% in this parenthesis level
- ClParVector 2 index get pos abs gt and
- { pop pop false exit } if%%then exit loop
- } if
- pop } for
- { pop pop true dup exit } if } ifelse } if
- } { pop } ifelse
- 1 add
- } forall
- pop
- { pos UnfreeAdd} %% find one mul
- { Last 1 add } ifelse
-} def
-%% {
-%% 2 copy /Last exch def /First exch def false 0
-%% AddVector {
-%% AddVectorFree 2 index get
-%% { /pos exch def
-%% true 0 1 ClParVector length 1 sub
-%% { ParVectorFree 1 index get
-%% { OpParVector 1 index get pos abs le
-%% ClParVector 2 index get pos abs ge and
-%% pos abs First lt pos abs Last gt or or
-%% { pop pop false exit } if
-%% } if
-%% pop
-%% } for
-%% { pop pop true dup exit } if
-%% }
-%% { pop } ifelse
-%% 1 add
-%% } forall
-%% pop
-%% { pos UnfreeAdd}%% find one add
-%% { Last 1 add } ifelse
-%% } def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Find the eventual multiplication at this level
-%% first last -> first last position
-/FindFirstMul {
- 2 copy /Last exch def /First exch def false 0
- MulVector {
- MulVectorFree 2 index get
- { /pos exch def
- %% if it is in the current part of the analysed expr
- pos abs First gt pos abs Last lt and
- { true 0 1 ClParVector length
- dup 0 eq%% no parenthesis
- { pop pop pop pop exch not exch exit }
- { 1 sub
- { ParVectorFree 1 index get
- { OpParVector 1 index get pos abs lt%% in this parenthesis level
- ClParVector 2 index get pos abs gt and
- { pop pop false exit } if%%then exit loop
- } if
- pop } for
- { pop pop true dup exit } if } ifelse } if
- } { pop } ifelse
- 1 add
- } forall
- pop
- { pos UnfreeMul} %% find one mul
- { Last 1 add } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Find the eventual power at this level
-%% first last -> first last position
-/FindFirstPow {
- 2 copy /Last exch def /First exch def false 0
- PowVector {
- PowVectorFree 2 index get
- { /pos exch def
- %% if it is in the current part of the analysed expr
- pos First gt pos Last lt and
- { true 0 1 ClParVector length
- dup 0 eq%% no parenthesis
- { pop pop pop pop exch not exch exit }
- { 1 sub
- { ParVectorFree 1 index get
- { OpParVector 1 index get pos abs lt%% in this parenthesis level
- ClParVector 2 index get pos abs gt and
- { pop pop false exit } if%%then exit loop
- } if
- pop } for
- { pop pop true dup exit } if } ifelse } if
- } { pop } ifelse
- 1 add
- } forall
- pop
- { pos UnfreePow} %% find one ^
- { Last 1 add } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Find the eventual comma at this level
-%% first last -> first last position
-/FindFirstCom {
- 2 copy /Last exch def /First exch def false 0
- ComVector {
- ComVectorFree 2 index get
- { /pos exch def
- %% if it is in the current part of the analysed expr
- pos First gt pos Last lt and
- { true 0 1 ClParVector length
- dup 0 eq%% no parenthesisSTOP
- { pop pop pop pop exch not exch exit }
- { 1 sub
- { ParVectorFree 1 index get
- { OpParVector 1 index get pos abs lt%% in this parenthesis level
- ClParVector 2 index get pos abs gt and
- { pop pop false exit } if%%then exit loop
- } if
- pop } for
- { pop pop true dup exit } if } ifelse } if
- } { pop } ifelse
- 1 add
- } forall
- pop
- { pos UnfreeCom} %% find one comma
- { Last 1 add } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Find the first opened parenthesis (only for func call)
-%% first last -> first last position
-/FindFirstPar {
- 2 copy /Last exch def /First exch def false 0
- OpParVector {
- ParVectorFree 2 index get
- { /pos exch def
- pos First gt pos Last lt and
- { exch not exch exit } if
- } { pop } ifelse
- 1 add
- } forall
- pop
- { pos dup UnfreePar }%% find one par
- { Last 1 add } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Find the first opening bracket
-%% first last -> first last position
-/FindFirstBra {
- 2 copy /Last exch def /First exch def
- BraVector {
- /pos exch def
- pos First gt pos Last lt and
- { exit } if
- } forall
- pos dup UnfreePar%% finding it is mandatory
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Read the number and push it in the vector
-%% first last ->
-/AnalyzeNumber {
- 1 index sub 1 add ExpressionString 3 1 roll getinterval cvr /n exch def
- /ExpressionVector ExpressionVector aload length n exch 1 add array astore def
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Read the literal and push it in the vector
-%% first last ->
-/AnalyzeLiteral {
- ExpressionString 1 index get dup 41 eq %%close par at the end => function call
- { pop FindFirstPar%%first last parpos
- ExpressionString 3 index dup 3 index exch sub getinterval
- dup (SUM) eq { sumation }
- { dup (IFTE) eq { condition }
- { 1 index 1 add 3 index 1 sub AnalyzeParam
- dup cvn /n exch def TrigoFunc
- /ExpressionVector ExpressionVector aload length
- /tx@addDict cvx /begin cvx n cvx /end cvx 5 -1 roll 4 add array astore def
- %%n cvx exch 1 add array astore def
- pop pop pop } ifelse } ifelse }
- { 93 eq%%close bracket => vector element
- { FindFirstBra%%first last brapos
- ExpressionString 3 index dup 3 index exch sub getinterval cvn /n exch def
- /ExpressionVector ExpressionVector aload length n cvx exch 1 add array astore def
- 2 copy 1 add exch 1 sub AnalyzeExpr
- /ExpressionVector ExpressionVector aload length /cvi cvx exch /get cvx exch 2 add array astore def
- pop pop pop
- }
- { 1 index sub 1 add ExpressionString 3 1 roll getinterval cvn /n exch def
- /ExpressionVector ExpressionVector aload length n cvx exch 1 add array astore def } ifelse } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% push add in the vector
-%% kind ->
-%% if kind>0 then add else sub
-/EvalAdd {
- /ExpressionVector ExpressionVector aload length dup 3 add -1 roll
- 0 gt { /add } { /sub } ifelse cvx exch 1 add array astore def
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% push mul in the vector
-%% ->
-/EvalMul {
- /ExpressionVector ExpressionVector aload length dup 3 add -1 roll
- 0 gt { /mul } { /div } ifelse cvx exch 1 add array astore def
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% push exp in the vector
-%% ->
-/EvalPow {
- pop /ExpressionVector ExpressionVector aload length
- /tx@addDict cvx exch /begin cvx exch /EXP cvx exch /end cvx exch 4 add array astore def
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% push neg in the vector
-%% ->
-/EvalNeg {
- /ExpressionVector ExpressionVector aload length /neg cvx exch 1 add array astore def
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Lexical Analyzis of the string
-%% ->
-/LexStr {
- /freepar 0 def /lastpar 0 def /lastchar 0 def
- 0 ExpressionString
- { dup 40 eq 1 index 91 eq or %% open parenthesis
- { /OpParVector OpParVector aload length dup 3 add index exch 1 add array astore def
- /ClParVector ClParVector aload length -1 exch 1 add array astore def
- /lastpar freepar def /freepar freepar 1 add def /NoPar false def} if
- dup 41 eq 1 index 93 eq or %% close parenthesis
- { ClParVector lastpar 3 index put lastpar
- dup 0 eq
- { pop }
- { { 1 sub dup ClParVector exch get -1 eq { /lastpar exch def exit } { dup 0 eq { pop exit} if } ifelse } loop }
- ifelse } if
- dup 42 eq %% * operator
- %%{ /MulVector MulVector aload length dup 3 add index exch 1 add array astore def } if
- { /MulVector 2 index MulVector aload length 1 add array astore def } if
- dup 43 eq %% + operator
- { %%test if it is a real operator and not the unary operator
- lastchar dup 40 ne %% open parenthesis
- 1 index 59 ne and %% ;
- 1 index 42 ne and %% *
- 1 index 43 ne and %% +
- 1 index 44 ne and %% ,
- 1 index 45 ne and %% -
- 1 index 47 ne and %% /
- 1 index 0 ne and %% first char
- 1 index 94 ne and %% ^%%2004/11/14
- exch 124 ne and %% |
- %%{/AddVector AddVector aload length dup 3 add index exch 1 add array astore def } if}
- {/AddVector 2 index AddVector aload length 1 add array astore def } if}
- if
- dup 44 eq %% , separator
- { /ComVector ComVector aload length dup 3 add index exch 1 add array astore def }
- if
- dup 45 eq %% - operator
- { %%test if it is a real operator and not the unary operator
- lastchar dup 40 ne %% open parenthesis
- 1 index 59 ne and %% ;
- 1 index 42 ne and %% *
- 1 index 43 ne and %% +
- 1 index 44 ne and %% ,
- 1 index 45 ne and %% -
- 1 index 47 ne and %% /
- 1 index 0 ne and %% first char
- 1 index 94 ne and %% ^%%2004/11/14
- exch 124 ne and %% |
- %%{/AddVector AddVector aload length dup 3 add index neg exch 1 add array astore def } if}
- {/AddVector 2 index neg AddVector aload length 1 add array astore def } if}
- if
- dup 47 eq %% / operator
- %%{ /MulVector MulVector aload length dup 3 add index neg exch 1 add array astore def }
- { /MulVector 2 index neg MulVector aload length 1 add array astore def }
- if
- dup 59 eq 1 index 124 eq or%% ; separator |
- { /SemVector SemVector aload length dup 3 add index exch 1 add array astore def }
- if
- dup 91 eq %% open bracket
- { /BraVector BraVector aload length dup 3 add index exch 1 add array astore def }
- if
- dup 94 eq %% ^ operator
- %%{ /PowVector PowVector aload length dup 3 add index exch 1 add array astore def }
- { /PowVector 2 index PowVector aload length 1 add array astore def }%%2004/11/14
- if
- /lastchar exch def 1 add
- } forall
- /AddVectorFree AddVector CreateFree def
- /MulVectorFree MulVector CreateFree def
- /ParVectorFree OpParVector CreateFree def
- /PowVectorFree PowVector CreateFree def
- /ComVectorFree ComVector CreateFree def
- 1 sub
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Create Free vector
-%% ->
-/CreateFree {
- dup length array exch
- { pop true exch } forall astore
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Unfree parenthesis
-%% pos ->
-/UnfreePar {
- /pos exch def ParVectorFree 0
- OpParVector { pos eq { exit } if 1 add } forall
- false put
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Unfree mul
-%% pos ->
-/UnfreeMul {
- MulVectorFree 0
- MulVector { pos eq { exit } if 1 add } forall
- false put
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Unfree add
-%% pos ->
-/UnfreeAdd {
- AddVectorFree 0
- AddVector { pos eq { exit } if 1 add } forall
- false put
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Unfree exp
-%% pos ->
-/UnfreePow {
- PowVectorFree 0
- PowVector { pos eq { exit } if 1 add } forall
- false put
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Unfree com
-%% pos ->
-/UnfreeCom {
- ComVectorFree 0
- ComVector { pos eq { exit } if 1 add } forall
- false put
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Convert to radians if trigo function call
-%% (name) ->
-/TrigoFunc {
- dup (cos) eq 1 index (sin) eq or exch (tan) eq or
- { /ExpressionVector ExpressionVector aload length 3.14159265359 /div cvx 180 /mul cvx 5 -1 roll 4 add
- array astore def
- } if
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% the condition function
-%% ->
-/condition {
- %% manage the condition
- 1 index 1 add 3 index 1 sub FindFirstCom
- %% find the test char <,>,=,!
- 4 index 1 index 1 sub FindTestChar
- 4 index 2 index 1 sub AnalyzeExpr 3 1 roll
- 1 add 1 index 1 sub AnalyzeExpr exch
- /ExpressionVector ExpressionVector aload length dup 1 add array exch 3 add -1 roll cvx exch astore def
- %% manage the then clause
- MngClause
- %% manage the else clause
- MngClause
- /ExpressionVector ExpressionVector aload length 1 add /ifelse cvx exch array astore def
- mark 8 1 roll cleartomark
-} def
-/FindTestChar {
- 1 exch
- { dup ExpressionString exch get
- dup 60 eq { pop /lt exit } if%%<
- dup 61 eq { pop /eq exit } if%%=
- dup 62 eq { pop /gt exit } if%%>
- pop pop } for
-} def
-/MngClause {
- 3 1 roll FindFirstCom 4 -1 roll 1 add 1 index 1 sub
- /ExpressionVector ExpressionVector exch [] def 3 1 roll AnalyzeExpr
- /ExpressionVector exch aload length 1 add ExpressionVector cvx exch array astore def
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% the sumation function
-%% ->
-/sumation {
- /LoopLevel LoopLevel 1 add def
- %% create the accumulator
- /ExpressionVector ExpressionVector aload length 1 add 0 exch array astore def
- %% read the variable name
- 1 index 1 add 3 index 1 sub FindFirstCom
- ExpressionString 4 -1 roll 2 index 1 index sub getinterval cvn
- /tempvar exch def
- %% read the initial value
- GetNextNumber
- /ExpressionVector ExpressionVector aload length 1 add temp exch array astore def
- %% read the increment value
- GetNextNumber
- /ExpressionVector ExpressionVector aload length 1 add temp exch array astore def
- %% read the limit value
- GetNextNumber
- /ExpressionVector ExpressionVector aload length 1 add temp exch array astore def
- /LoopContext LoopContext aload length 1 add ExpressionVector exch array astore def
- /ExpressionVector [ tempvar /exch cvx /def cvx ] def
- 1 add exch AnalyzeExpr
- %% add each term of the sum
- /ExpressionVector ExpressionVector aload length 1 add /add cvx exch array astore def
- /ExpressionVector LoopContext LoopLevel get aload length 2 add
- ExpressionVector cvx exch /for cvx exch array astore def pop pop pop pop } def
-/GetNextNumber {
- exch FindFirstCom ExpressionString 4 -1 roll 1 add 2 index 1 index sub getinterval cvi
- /temp exch def } def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% METHODS FUNC
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% MISC FUNC
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-/RemoveWS {%
- dup length
- 0 2 index { 32 ne { 1 add } if } forall
- 2 copy ne
- { exch pop string 0 2 index
- { dup 32 ne { 2 index 2 index 3 -1 roll put 1 add } { pop } ifelse } forall
- pop exch pop } { pop pop } ifelse
-} def
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% NEW FUNC
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Make a discrete sum
-%% var n begin end expr ->
-/SUM {} def
-%% function arcsine in radians
-%% x -> theta
-/asin {%
- dup abs 1 gt { EQDFasinrangeerror } if
- dup abs 1 eq
- { PIdiv2 exch -1 eq { neg } if }
- { .1 %% asin(x)
- { dup dup PI div 180 mul sin 3 index sub exch PI div 180 mul cos div
- dup abs 1e-6 lt { sub exit } if sub
- } loop
- exch pop } ifelse
-} def
-%% function arccosine in radians
-%% x -> theta
-/acos {%
- dup abs 1 gt { EQDFacosrangeerror } if
- dup abs 1 eq
- { -1 eq { PI } { 0 } ifelse }
- { 1.5 %% asin(x)
- { dup dup PI div 180 mul cos 3 index sub exch PI div 180 mul sin neg div
- dup abs 1e-6 lt { sub exit } if sub
- } loop
- exch pop } ifelse
-} def
-%% factorial function
-%% n -> n!
-/fact { 1 exch 2 exch 1 exch { mul } for } def
-
-%end
-
-%% modified exponential funtion for 0
-%% x n -> x^n
-/EXP { dup 0 eq { pop pop 1 } { exp } ifelse } def
-%%
+/AlgParser { tx@AlgToPs begin AlgToPs end } def
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/GTriangle {
gsave
/mtrx CM def
- /colorA ED /colorB ED /colorC ED % save the colors
- /xA ED /yA ED % save the origin
+ /colorA ED /colorB ED /colorC ED % save the colors
+ /yA ED /xA ED % save the origin
xA yA translate
- rotate % \psk@gangle
- /yB ED /xB ED /yC ED /xC ED % save other coordinates
+ rotate % \psk@gangle
+ /yB ED /xB ED /yC ED /xC ED % save other coordinates
/ds [ % save data in a array
- 0 0 0 colorA aload pop % fd x y xr xg xb
+ 0 0 0 colorA aload pop % fd x y xr xg xb
0 xB xA sub yB yA sub colorB aload pop
0 xC xA sub yC yA sub colorC aload pop
-% 1 xC xB add yB colorA aload pop % for use with 4 points ABCD
+% 1 xC xB add yB colorA aload pop % for use with 4 points ABCD
] def
newpath
<<
@@ -788,5 +229,733 @@ end
userdict /shfill { Emulate_shfill begin xshfill end } bind put } if
end
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/tx@CoreAnalyzerDict 100 dict def tx@CoreAnalyzerDict begin
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% PS ANALYZER FOR ALGEBRAIC EXPRESSION V1.12
+% E->T|E+T
+% T->FS|T*FS
+% FS -> F | +FS | -FS
+% F->P|F^SF
+% P->(E)|literal
+% literal->number|var|var[E]|func(params)
+% params->E|E,param
+% number->TOBEFINISHED
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% E expression, T term, SF signed factor, F factor, P power
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% parser
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% str
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% C->E<condition_operators>E
+%% STR index -> STR index+lenExpr
+/AnalyzeCond { AnalyzeExpr ReadCondOp AnalyzeExpr EvalCondOp } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% analyze Expression List (separator , or | )
+%% STR index -> STR index+lenExpr
+%% /AnalyzeListOfE {
+%% { NextNonBlankChar pop AnalyzeExpr%%dup Strlen eq { exit } if NextNonBlankChar
+%% NextNonBlankChar dup 0 eq { pop exit } if
+%% dup 44 ne 1 index 124 ne and { dup 41 ne { PROBLEMCONTACTBILLOU } { pop exit } ifelse } if
+%% pop NextNonBlankChar dup 0 eq { exit } if 124 ne { PROBLEMCONTACTBILLOU } if 1 add NextNonBlankChar 0 eq {toto} if } loop
+%% AnalyzeListOfEPostHook
+%% } def
+/AnalyzeListOfE {
+ /NotFirst false def
+ { NextNonBlankChar pop AnalyzeExpr
+ NotFirst { EvalListOfExpr } { /NotFirst true def } ifelse
+ dup Strlen eq { exit } if NextNonBlankChar
+ dup 44 ne 1 index 124 ne and
+ { dup 41 ne { PROBLEMCONTACTBILLOU } { pop exit } ifelse }
+ if pop 1 add } loop
+ AnalyzeListOfEPostHook
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% E->T|E+T
+%% STR index -> STR index+lenExpr
+/AnalyzeExpr {
+ AnalyzePreHook AnalyzeTerm IsEndingExpr
+ { dup 0 ne { 32 eq { NextNonBlankChar } if } { pop } ifelse }
+ { { RollOp 1 add NextNonBlankChar pop AnalyzeTerm PreEvalHook EvalAddSub IsEndingExpr { pop exit } if } loop }
+ ifelse
+ AnalyzePostHook
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% T->FS|T*FS
+%% STR index
+/AnalyzeTerm {
+ AnalyzePreHook AnalyzeSignedFactor IsEndingTerm
+ { dup 0 ne { 32 eq { NextNonBlankChar } if } { pop } ifelse }
+ { { RollOp 1 add NextNonBlankChar pop AnalyzeSignedFactor PreEvalHook EvalMulDiv IsEndingTerm { pop exit } if} loop }
+ ifelse
+ AnalyzePostHook
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% FS -> F | +FS | -FS
+%% STR index
+/AnalyzeSignedFactor {
+ AnalyzePreHook 2 copy get dup IsUnaryOp
+ { RollOp 1 add NextNonBlankChar pop AnalyzeSignedFactor EvalUnaryOp }
+ { pop AnalyzeFactor }
+ ifelse AnalyzePostHook
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% F->P|F^P
+%% STR index
+/AnalyzeFactor {
+ AnalyzePreHook AnalyzePower IsEndingFactor
+ { dup 0 ne { 32 eq { NextNonBlankChar } if } { pop } ifelse }
+ { { RollOp 1 add NextNonBlankChar pop AnalyzePower PreEvalHook EvalPower IsEndingFactor { pop exit } if} loop }
+ ifelse AnalyzePostHook
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% P->(E)|literal
+%% STR index
+/AnalyzePower {
+ %% depending of first char either a number, or a literal
+ 2 copy get dup 40 eq%%an open par
+ { pop 1 add NextNonBlankChar pop AnalyzeExpr 1 add NextNonBlankChar pop }
+ { AnalyzeLiteral }
+ ifelse
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% STR index STR[index] -> STR index
+/AnalyzeLiteral { IsNumber { EvalNumber } { EvalLiteral } ifelse } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% recognize + or -
+%% chr -> T/F
+/IsUnaryOp { dup 43 eq exch 45 eq or } bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% a number can contain only : 0123456789.
+%% chr -> T/F
+/IsNumber { dup 48 ge exch dup 57 le 3 -1 roll and exch 46 eq or } bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% STR index -> STR index number
+%% a number can be of the form [0-9]*.[0-9]*\([eE][+-]?[0-9]+\)?
+%% STR index -> STR index' number
+/ReadNumber {
+ exch dup 3 -1 roll dup 3 1 roll
+ %%read mantissa
+ { 1 add 2 copy dup Strlen eq { pop pop 0 exit } if get dup IsNumber not { exit } if pop } loop
+ dup 101 eq exch 69 eq or
+ %%% there is a "e" or "E" -> read exponant
+ { 1 add 2 copy get dup IsUnaryOp
+ { pop 1 add 2 copy get } if
+ { IsNumber not { exit } if 1 add 2 copy get } loop }
+ if
+ dup 4 1 roll
+ 3 -1 roll exch 1 index sub getinterval
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% a number can contain only : 0123456789.
+%% chr -> T/F
+/IsCondOp { dup 30 eq exch dup 60 ge exch 62 le and or } bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% STR index -> STR index number
+%% a number can be of the form [0-9]*.[0-9]*\([eE][+-]?[0-9]+\)?
+%% STR index -> STR index' number
+/ReadCondOp {
+ NextNonBlankChar 1 index 4 1 roll
+ { IsCondOp not { exit } if 1 add 2 copy get } loop
+ 2 copy 5 -1 roll
+ exch 1 index sub getinterval 3 1 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% a literal can contain only : 0123456789.
+%% chr -> T/F
+/IsLiteral {%
+ dup 48 ge exch dup 57 le 3 -1 roll and exch
+ dup 65 ge exch dup 90 le 3 -1 roll and 3 -1 roll or exch
+ dup 97 ge exch 122 le and or } bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% a literal can be of the form [a-zA-Z][a-zA-Z0-9]*\(\((Expression)\)|\(\[Expression\]\)\)?
+%% STR index -> literal STR index' nextchr
+/ReadLiteral {
+ exch dup 3 -1 roll dup 3 1 roll
+ %%read literal core
+ { 2 copy dup Strlen eq { pop pop 0 exit } if get dup IsLiteral not { exit } if pop 1 add } loop
+ 4 1 roll dup 5 1 roll 3 -1 roll exch 1 index sub getinterval 4 1 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% expr is ended by end of str or a clpar
+%% STR index -> STR index STR[index] T/F
+/IsEndingExpr {%
+ 2 copy dup Strlen eq
+ %% if end of str is reached -> end !
+ { pop pop 0 true }
+ %% ending chr -> clpar, comma, |, <, >, =, !,
+ {get dup dup 41 eq
+ exch dup 124 eq
+ exch dup 93 eq
+ exch dup 44 eq
+ exch dup 30 eq
+ exch dup 60 ge exch 62 le and or or or or or}
+ ifelse } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% expr is ended by end of str or a +-
+%% STR index -> STR index STR[index] T/F
+/IsEndingTerm { IsEndingExpr { true } { dup dup 43 eq exch 45 eq or } ifelse } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% expr is ended by end of str or */
+%% STR index -> STR index STR[index] T/F
+/IsEndingFactor { IsEndingTerm { true } { dup dup 42 eq exch 47 eq or } ifelse } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% expr is ended by end of str or ^
+%% STR index -> STR index STR[index] T/F
+/IsEndingPower { IsEndingFactor { true } { dup 94 eq } ifelse } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% STR index -> STR index STR[index]
+/NextNonBlankChar { { dup Strlen eq { 0 exit } if 2 copy get dup neBlkChar { exit } if pop 1 add } loop } bind def
+/neBlkChar { dup 32 ne exch dup 10 ne exch 9 ne and and } bind def
+%%%%%%%%%%%%%%%%%%%%%%%%
+%% DEBUG
+/BRK {false} def
+/BRKtrue {/BRK true def} def
+/BRKStop {BRK {BRKtoto} if } def
+/BRKEvalStop {BRK exch if } def
+/BRKBRK2true {BRK {BRK2true} if } def
+/BRK2 {false} def
+/BRK2true {/BRK2 true def} def
+/BRK2Stop {BRK2 {BRK2toto} if } def/BRK {false} def
+end
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/tx@AlgToPs 12 dict def tx@AlgToPs begin
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% algExpr -> PSVector
+/AlgToPs { tx@CoreAnalyzerDict begin InitParser AnalyzeListOfE pop pop EndingSequence end } def
+/EndingSequence { ExpressionVector aload length /end cvx exch 1 add array astore } def
+/InitParser { /ExpressionVector [ /tx@AddMathFunc cvx /begin cvx ] def dup length /Strlen exch def 0 } def
+/Strlen 0 def
+/EvalListOfExpr {} def%
+/EvalNumber {%
+ ReadNumber cvr /ExpressionVector ExpressionVector aload length dup 3 add -1 roll cvx
+ exch 1 add array astore def NextNonBlankChar pop } def
+/EvalAddSub {%
+ /ExpressionVector ExpressionVector aload length dup 5 add -1 roll
+ 43 eq { /add } { /sub } ifelse cvx exch 1 add array astore def
+} def
+/EvalMulDiv {%
+ /ExpressionVector ExpressionVector aload length dup 5 add -1 roll
+ 42 eq { /mul } { /div } ifelse cvx exch 1 add array astore def
+} def
+/EvalPower {%
+ /ExpressionVector ExpressionVector aload length dup 5 add -1 roll
+ pop /exp cvx exch 1 add array astore def
+} def
+/EvalLiteral {%
+ ReadLiteral
+ dup 40 eq%%% there is an open par -> function call
+ { pop 2 index
+ dup (Sum) eq { EvalSum }
+ { dup (IfTE) eq { EvalCond }
+ { dup (Derive) eq { pop EvalDerive }
+ { pop 1 add NextNonBlankChar pop AnalyzeListOfE 2 index TrigoFunc
+ /ExpressionVector ExpressionVector aload length dup 5 add -1 roll cvn cvx
+ exch 1 add array astore def 1 add NextNonBlankChar pop } ifelse } ifelse} ifelse }
+ { /ExpressionVector ExpressionVector aload length dup 6 add -1 roll cvn cvx exch 1 add array astore def
+ dup 91 eq%%% there is an open bracket -> vector element
+ { pop 1 add NextNonBlankChar pop AnalyzeExpr
+ /ExpressionVector ExpressionVector aload length /cvi cvx exch /get cvx exch 2 add array astore def 1 add }
+ { pop NextNonBlankChar pop }
+ ifelse}
+ ifelse
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% the derive function : Derive(n,f(x))
+%% firstparindex lastparindex ->
+/EvalDerive {
+ %% manage the function descripiton
+ 1 add ReadNumber 3 1 roll NextNonBlankChar
+ 44 ne { ANALYZER_ERROR_missing_second_comma_in_Sum } if
+ 1 add NextNonBlankChar pop
+ 3 -1 roll cvi
+ dup 0 eq
+ { pop AnalyzeExpr 3 -1 roll pop 1 add }
+ { 1 sub 3 1 roll (x) exch tx@Derive begin DeriveIndexed end 4 -1 roll
+ { (x) tx@Derive begin Derive end } repeat
+ ExpressionVector exch /ExpressionVector [] def
+ AlgToPs aload length
+ /ExpressionVector 1 index 3 add -1 roll aload length dup 3 add -1 roll /l2 exch def /l1 exch def
+ l1 l2 add 1 add l2 neg roll l1 l2 add array astore def 3 -1 roll pop 1 add
+ 1 index length /Strlen exch def } ifelse
+} def
+/EvalSum {%
+ pop 1 add NextNonBlankChar pop
+ %% read the variable name
+ ReadLiteral pop NextNonBlankChar
+ 44 ne { ANALYZER_ERROR_missing_first_comma_in_Sum } if
+ %% read the initial value
+ 1 add NextNonBlankChar pop ReadNumber cvi 3 1 roll
+ 2 copy get 44 ne { ANALYZER_ERROR_missing_second_comma_in_Sum } if
+ %% read the increment value
+ 1 add NextNonBlankChar pop ReadNumber cvi 3 1 roll
+ 2 copy get 44 ne { ANALYZER_ERROR_missing_second_comma_in_Sum } if
+ %% read the limit value
+ 1 add NextNonBlankChar pop ReadNumber cvi 3 1 roll
+ 2 copy get 44 ne { ANALYZER_ERROR_missing_second_comma_in_Sum } if
+ /ExpressionVector ExpressionVector aload length dup 7 add -3 roll 0 4 1 roll
+ 5 -1 roll 4 add array astore def
+ %% keep ExpressionVector for later and create a new one for internal Sum computation
+ ExpressionVector 3 1 roll /ExpressionVector [ 6 -1 roll cvn /exch cvx /def cvx ] def
+ 1 add NextNonBlankChar pop AnalyzeExpr
+ %% add each term
+ /ExpressionVector ExpressionVector aload length 1 add /add cvx exch array astore def
+ /ExpressionVector 4 -1 roll aload length ExpressionVector cvx /for cvx 3 -1 roll 2 add
+ array astore def 3 -1 roll pop 1 add
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Convert to radians if trigo function call
+%% (name) ->
+/TrigoFunc {
+ dup (cos) eq 1 index (sin) eq or exch (tan) eq or
+ { /ExpressionVector ExpressionVector aload length 3.14159265359 /div cvx 180 /mul cvx 5 -1 roll 4 add
+ array astore def
+ } if
+} def
+/EvalCond {%
+ pop 1 add AnalyzeCond NextNonBlankChar
+ 44 ne { ANALYZER_ERROR_missing_first_comma_in_IfTE } if
+ ExpressionVector 3 1 roll /ExpressionVector [] def
+ 1 add AnalyzeExpr ExpressionVector 3 1 roll /ExpressionVector [] def
+ NextNonBlankChar 44 ne { ANALYZER_ERROR_missing_second_comma_in_IfTE } if
+ 1 add AnalyzeExpr
+ NextNonBlankChar 41 ne { ANALYZER_ERROR_missing_ending parenthesis_in_IfTE } if
+ ExpressionVector
+ /ExpressionVector 6 -1 roll aload length dup
+ 6 add -1 roll cvx exch dup 4 add -1 roll cvx /ifelse cvx 3 -1 roll 3 add array astore def
+ 1 add 3 -1 roll pop
+} def
+%% CondOp STR index
+/EvalCondOp {%
+ 3 -1 roll
+ dup (=) eq { /eq } {%
+ dup (<) eq { /lt } {%
+ dup (>) eq { /gt } {%
+ dup (>=) eq { /ge } {%
+ dup (<=) eq { /ge } {%
+ dup (!=) eq { /ne } { ERROR_non_valid_conditional_operator }
+ ifelse } ifelse } ifelse } ifelse } ifelse } ifelse
+ cvx exch pop
+ /ExpressionVector ExpressionVector aload length dup 3 add -1 roll exch 1 add array astore def } def
+/EvalUnaryOp {
+ 3 -1 roll 45 eq { /ExpressionVector ExpressionVector aload length /neg cvx exch 1 add array astore def } if
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% H O O K S
+/AnalyzePreHook {} bind def
+/PreEvalHook {} bind def
+/AnalyzeListOfEPostHook {} bind def
+/AnalyzePostHook {} def
+/RollOp { 3 1 roll } bind def
+end%%%tx@CoreAnalyzerDict
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/tx@Derive 41 dict def tx@Derive begin
+%%increase ^^ for each function added
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% algExpr variable -> PSVector
+/Derive {%
+ 10240 string 3 1 roll 0 3 1 roll
+ /Variable exch def
+ tx@CoreAnalyzerDict begin InitParser AnalyzeListOfE end
+} def
+/Strlen 0 def
+/InitParser { dup length /Strlen exch def 0 } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% algExpr variable index -> PSVector
+/DeriveIndexed {%
+ 3 1 roll 10240 string 3 1 roll 0 3 1 roll
+ /Variable exch def
+ tx@CoreAnalyzerDict begin InitParser pop 4 -1 roll AnalyzeExpr 4 -2 roll pop pop 4 -2 roll exch pop end
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (u,v)'=-(u',v')
+/EvalListOfExpr {%
+ 4 2 roll 2 copy 9 -1 roll dup length 4 1 roll putinterval add AddPipe
+ 2 copy 7 -1 roll dup length 4 1 roll putinterval add
+ 6 -2 roll pop pop
+ 2 copy pop 0 6 2 roll GetIntervalNewStr 5 1 roll 2 copy 0 exch getinterval 6 1 roll } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (-u)'=-(u')
+/EvalUnaryOp {
+ 4 -2 roll 4 index (0) eq
+ { (0) StrConcat 7 -1 roll pop }
+ { 7 -1 roll 45 eq
+ { AddSub AddOpPar true } { false } ifelse
+ 3 1 roll 5 index StrConcat 3 -1 roll { AddClPar } if } ifelse
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ 7 -2 roll pop pop 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (number)'=0
+/EvalNumber { ReadNumber (0) 6 2 roll } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (u+v)'=u'+v'
+/EvalAddSub {%
+ 7 index dup (0) eq
+ { pop true }%% du=0 nothing added
+ { dup length exch 5 index 5 index 3 -1 roll putinterval 4 -1 roll add 3 1 roll false }
+ ifelse
+ 5 index dup (0) eq
+ { pop { (0) } { 4 -2 roll 2 copy pop 0 6 2 roll GetIntervalNewStr } ifelse }%%dv=0
+ { exch
+ { 5 -2 roll 7 index 45 eq { AddSub } if false } %%nothing yet added
+ { 5 -2 roll 7 index 43 eq%%something yet added
+ { AddAdd false } { AddSub AddOpPar true } ifelse }
+ ifelse 11 1 roll
+ 3 -1 roll StrConcat 10 -1 roll { AddClPar } if
+ 2 copy pop 0 6 2 roll GetIntervalNewStr }
+ ifelse
+ mark 11 -5 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (u*v)' or (u/v)'
+/EvalMulDiv { 6 index 42 eq {EvalMul} {EvalDiv} ifelse } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (u*v)'=u'*v+u*v'
+/EvalMul {%
+ 4 -2 roll 7 index dup (0) eq
+ { pop false }%%du=0
+ { (1) eq%%du=1
+ { false }
+ { AddOpPar 7 index StrConcat AddClPar AddMul AddOpPar true } ifelse
+ 3 1 roll 6 index StrConcat 3 -1 roll { AddClPar } if
+ true }%%du!=0
+ ifelse
+ 5 1 roll 5 index (0) eq
+ { 5 -1 roll not { (0) StrConcat } if }%%dv=0
+ { 5 -1 roll { AddAdd } if
+ 4 index (1) eq
+ { 8 index StrConcat }
+ { AddOpPar 8 index StrConcat AddClPar AddMul AddOpPar 4 index StrConcat AddClPar }
+ ifelse
+ }%%dv!=0
+ ifelse
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ mark 11 -5 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (u/v)'=(u'*v-u*v')/v^2
+/EvalDiv {%
+ 4 -2 roll
+ 4 index (0) eq%%dv=0 -> u'/v
+ { 7 index (0) eq { (0) StrConcat } { AddOpPar 7 index StrConcat AddClPar AddDiv 5 index StrConcat } ifelse }
+ { 7 index dup (0) eq
+ { pop }%%du=0
+ { (1) eq%%du=1
+ { false }
+ { AddOpPar 7 index StrConcat AddClPar AddMul AddOpPar true } ifelse
+ 3 1 roll 6 index StrConcat 3 -1 roll { AddClPar } if}%%du!=0
+ ifelse
+ AddSub
+ 4 index (1) eq
+ { 8 index StrConcat }
+ { AddOpPar 8 index StrConcat AddClPar AddMul AddOpPar 4 index StrConcat AddClPar }
+ ifelse
+ %}%%dv!=0
+ 2 copy GetIntervalNewStr 3 1 roll pop 0 AddOpPar 3 -1 roll StrConcat AddClPar
+ AddDiv AddOpPar 5 index StrConcat AddClPar 2 copy (^2) putinterval 2 add }
+ ifelse
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ mark 11 -5 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% str1 index str2 -> str1 index
+/StrConcat { dup length 4 2 roll 2 copy 6 -1 roll putinterval 3 -1 roll add } bind def
+/GetIntervalNewStr { 0 exch getinterval dup length string copy } bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (u^v)'=(u^v)'=u'vu^(v-1)+v'u^(v)ln(u)
+/EvalPower {%
+ 4 -2 roll 7 index (0) eq
+ {%%if du=0 then (u^v)'=v'ln(u)u^v
+ 4 index (0) eq
+ { (0) StrConcat }
+ { tutu 4 index (1) ne { AddOpPar 4 index StrConcat (\)*) StrConcat } if
+ (ln\() StrConcat 8 index StrConcat (\)*\() StrConcat
+ 8 index StrConcat (\)^\() StrConcat 5 index StrConcat AddClPar } ifelse
+ }
+ {%%du!=0
+ 4 index (0) eq
+ {%%if dv=0 then (u^v)'=vu'u^(v-1)
+ 5 index dup IsStrNumber
+ { dup (0) eq
+ { StrConcat }
+ { dup dup (1) eq exch (1.0) eq or
+ { StrConcat }
+ { StrConcat (*\() StrConcat 8 index StrConcat (\)) StrConcat
+ 5 index dup dup (2) eq exch (2.0) eq or
+ { pop } { cvr 1 sub 20 string cvs 3 1 roll (^) StrConcat 3 -1 roll StrConcat } ifelse } ifelse } ifelse }
+ { pop AddOpPar 5 index StrConcat (\)*\() StrConcat 8 index StrConcat (\)^\() StrConcat
+ 5 index StrConcat (-1\)) StrConcat } ifelse
+ }
+ {%%if dv!=0 and du!=0 then (u^v)'=u'vu^(v-1)+v'u^(v)ln(u)
+ 7 index (1) ne { AddOpPar 7 index StrConcat (\)*) StrConcat } if
+ AddOpPar 5 index StrConcat (\)*\() StrConcat
+ 8 index StrConcat (\)^\() StrConcat
+ 5 index StrConcat (-1\)+\() StrConcat
+ 4 index (1) ne { 4 index StrConcat (\)*\() StrConcat } if
+ 8 index StrConcat (\)^\() StrConcat
+ 5 index StrConcat (\)*ln\() StrConcat
+ 8 index StrConcat AddClPar
+ } ifelse
+ } ifelse
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ mark 11 -5 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% str -> true/false
+/IsStrNumber {%
+ true exch
+ { dup 48 lt exch dup 57 gt 3 -1 roll or
+ exch dup 46 ne%%.
+ exch dup 43 ne%%+
+ exch 45 ne%%-
+ and and and { pop false } if } forall
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% literal switch -> func call, vector, variables
+/EvalLiteral {%
+ ReadLiteral dup 40 eq%%% there is an open par -> function call
+ { pop (EvalFunc_ ) 9 4 index StrConcat 0 exch getinterval cvn cvx exec }
+ { dup 91 eq%%% there is an open bracket -> vector element
+ { ERROR_vector_not_yet_implemented }
+ { pop EvalVariable }
+ ifelse }
+ ifelse
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% first last parpos Expr[first:parpos-1] ->
+/EvalVariable { 2 index Variable eq { (1) } { (0) } ifelse 4 -1 roll exch 6 2 roll } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% (f(u))'=u'f'(u)
+/EvalFunc {
+ 4 2 roll 4 index (1) ne
+ { AddOpPar 4 index StrConcat (\)*) StrConcat } if
+ (Eval ) 4 8 index StrConcat 0 exch getinterval cvn cvx exec
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ mark 9 -3 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Func derivative -> Eval<func>
+/EvalFunc_sin {%
+ PreCommonFunc
+ { (cos\() StrConcat 5 index StrConcat AddClPar } if
+ PostCommonFunc } def
+/EvalFunc_cos {%
+ PreCommonFunc
+ { (\(-sin\() StrConcat 5 index StrConcat (\)\)) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_tan {%
+ PreCommonFunc
+ { dup 0 eq { (1) StrConcat } { 1 sub } ifelse (/cos\() StrConcat 5 index StrConcat (\)^2) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_asin {%
+ PreCommonFunc
+ { (1/sqrt\(1-\() StrConcat 5 index StrConcat (\)^2\)\)) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_acos {%
+ PreCommonFunc
+ { (-1/sqrt\(1-\() StrConcat 5 index StrConcat (\)^2\)\)) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_atg {%
+ PreCommonFunc
+ { (1/\(1+\() StrConcat 5 index StrConcat (\)^2\)\)) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_ln {%
+ PreCommonFunc
+ { dup 0 eq { (1) StrConcat } { 1 sub } ifelse (/\() StrConcat 5 index StrConcat AddClPar } if
+ PostCommonFunc } def
+/EvalFunc_exp {%
+ PreCommonFunc
+ { (exp\() StrConcat 5 index StrConcat AddClPar } if
+ PostCommonFunc } def
+/EvalFunc_sqrt {%
+ PreCommonFunc
+ { dup 0 eq { (1) StrConcat } { 1 sub } ifelse (/\(2*sqrt\() StrConcat 5 index StrConcat (\)\)) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_Fact {%
+ PreCommonFunc { ERROR_no_variable_expression_in_Fact } if
+ PostCommonFunc } def
+/EvalFunc_sh {%
+ PreCommonFunc
+ { (ch\() StrConcat 5 index StrConcat AddClPar } if
+ PostCommonFunc } def
+/EvalFunc_ch {%
+ PreCommonFunc
+ { (sh\() StrConcat 5 index StrConcat AddClPar } if
+ PostCommonFunc } def
+/EvalFunc_th {%
+ PreCommonFunc
+ { dup 0 eq { (1) StrConcat } { 1 sub } ifelse (/ch\() StrConcat 5 index StrConcat (\)^2) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_Argsh {%
+ PreCommonFunc
+ { (1/sqrt\(1+\() StrConcat 5 index StrConcat (\)^2\)\)) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_Argch {%
+ PreCommonFunc
+ { (1/sqrt\(\() StrConcat 5 index StrConcat (\)^2-1\)\)) StrConcat } if
+ PostCommonFunc } def
+/EvalFunc_Argth {%
+ PreCommonFunc
+ { (1/\(1-\() StrConcat 5 index StrConcat (\)^2\)\)) StrConcat } if
+ PostCommonFunc } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+/PreCommonFunc {
+ 1 add NextNonBlankChar pop 3 -1 roll 5 1 roll AnalyzeExpr 1 add NextNonBlankChar pop
+ 4 2 roll 4 index (0) eq
+ { (0) StrConcat false }
+ { 4 index (1) ne { AddOpPar 4 index StrConcat (\)*) StrConcat } if true } ifelse
+} def
+/PostCommonFunc {
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ mark 9 -3 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+/EvalFunc_Derive {%
+ 1 add ReadNumber cvi 1 add dup cvr log 1 add cvi string cvs
+ 4 -1 roll pop 5 1 roll 1 add NextNonBlankChar pop AnalyzeExpr 1 add
+ 4 -2 roll (Derive\() StrConcat 7 -1 roll StrConcat (,) StrConcat 6 -1 roll StrConcat AddClPar
+ 2 copy pop 0 6 2 roll GetIntervalNewStr 6 -1 roll pop 2 index 6 index dup 4 index exch sub getinterval
+ exch 6 2 roll } def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% literal switch -> func call, vector, variables
+/EvalFunc_Sum {%
+ 1 add NextNonBlankChar pop
+ %% read the variable name
+ ReadLiteral pop 3 -1 roll pop NextNonBlankChar
+ 44 ne { ANALYZER_ERROR_missing_first_comma_in_Sum } if
+ %% read the initial value
+ 1 add NextNonBlankChar pop ReadNumber pop
+ 2 copy get 44 ne { ANALYZER_ERROR_missing_second_comma_in_Sum } if
+ %% read the increment value
+ 1 add NextNonBlankChar pop ReadNumber pop
+ 2 copy get 44 ne { ANALYZER_ERROR_missing_third_comma_in_Sum } if
+ %% read the limit value
+ 1 add NextNonBlankChar pop ReadNumber pop
+ 2 copy get 44 ne { ANALYZER_ERROR_missing_fourth_comma_in_Sum } if
+ 1 add NextNonBlankChar pop dup 6 1 roll 3 -1 roll pop AnalyzeExpr 1 add NextNonBlankChar pop
+ 4 -2 roll 3 index 8 index dup 9 index exch sub getinterval StrConcat
+ 4 index StrConcat AddClPar
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ mark 9 -3 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% literal switch -> func call, vector, variables
+/EvalFunc_IfTE {%
+ 3 -1 roll pop 1 add NextNonBlankChar pop SkipCond
+ NextNonBlankChar
+ 44 ne { ANALYZER_ERROR_missing_first_comma_in_IfTE } if
+ 1 add NextNonBlankChar pop dup 5 1 roll
+ AnalyzeExpr NextNonBlankChar
+ 44 ne { ANALYZER_ERROR_missing_second_comma_in_IfTE } if
+ 1 add NextNonBlankChar pop
+ AnalyzeExpr 1 add NextNonBlankChar pop
+ 4 -2 roll 3 index 10 index dup 11 index exch sub getinterval StrConcat
+ 6 index StrConcat (,) StrConcat 4 index StrConcat AddClPar
+ 2 copy pop 0 6 2 roll GetIntervalNewStr
+ mark 11 -5 roll cleartomark 2 index 6 index dup 4 index exch sub getinterval exch 6 2 roll
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% advance in str until a comma is found (no error detection!)
+%% str index -> str index'
+/SkipCond { { 1 add 2 copy get 44 eq {exit } if } loop } bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Convert to radians if trigo function call
+%% (name) ->
+/TrigoFunc {
+ dup (cos) eq 1 index (sin) eq or exch (tan) eq or
+ { /ExpressionVector ExpressionVector aload length 3.14159265359 /div cvx 180 /mul cvx 5 -1 roll 4 add
+ array astore def
+ } if
+} def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% No derivative for condition....
+/EvalCondOp { 3 -1 roll pop } bind def
+/PutIntervalOneAdd {putinterval 1 add} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add open parenthesis in string at the given index
+%% str index -> str index+1
+/AddOpPar {2 copy (\() PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add close parenthesis in string at the given index
+%% str index -> str index+1
+/AddClPar {2 copy (\)) PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add 0 in string at the given index
+%% str index -> str index+1
+/AddZero {2 copy (0) PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add open parenthesis in string at the given index
+%% str index -> str index+1
+/AddMul {2 copy (*) PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add open parenthesis in string at the given index
+%% str index -> str index+1
+/AddDiv {2 copy (/) PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add a plus sign in string at the given index
+%% str index -> str index+1
+/AddAdd {2 copy (+) PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add a minus sign in string at the given index
+%% str index -> str index+1
+/AddSub {2 copy (-) PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Add a pipe sign in string at the given index
+%% str index -> str index+1
+/AddPipe {2 copy (|) PutIntervalOneAdd} bind def
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% H O O K S
+/AnalyzePreHook { dup 5 1 roll } bind def
+/PreEvalHook {} def
+/AnalyzePostHook { 7 -1 roll pop } bind def
+/AnalyzeListOfEPostHook { 6 -1 roll mark 6 1 roll cleartomark } bind def
+/RollOp { 5 1 roll } bind def
+end%%%tx@CoreAnalyzerDict
+/tx@AddMathFunc 12 dict def tx@AddMathFunc begin
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% NEW FUNC
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% function arcsine in radians asin(x)=atan(x/sqrt(1-x^2))
+%% x -> theta
+/asin {%
+ dup abs 1 gt { EQDFasinrangeerror } if
+ dup dup dup mul 1 exch sub sqrt atan exch 0 lt { 360 sub } if 90 div 1.57079632680 mul
+} def
+%% function arccosine in radians acos(x)=atan(sqrt(1-x^2)/x)
+%% x -> theta
+/acos {%
+ dup abs 1 gt { EQDFacosrangeerror } if
+ dup dup mul 1 exch sub sqrt exch atan 90 div 1.57079632680 mul
+} def
+%% function arctangent in radians
+%% x -> theta
+/atg { 1 atan dup 90 gt { 360 sub } if 90 div 1.57079632680 mul } bind def
+%% HYPERBOLIC FUNCTIONS
+/sh { dup Ex exch neg Ex sub 2 div } def
+/ch { dup Ex exch neg Ex add 2 div } def
+/th { dup sh exch ch div } def
+/Argsh { dup dup mul 1 add sqrt add ln } def
+/Argch { dup dup mul 1 sub sqrt add ln } def
+/Argth { dup 1 add exch 1 exch sub div ln 2 div } def
+%% modified exponential funtion for 0
+%% x n -> x^n
+/Exp { dup 0 eq { pop pop 1 } { exp } ifelse } bind def
+%% modified exponential funtion for 0
+%% x -> e^x
+/Ex { 2.71828182846 exch exp } bind def
+%%
+%% factorial function
+%% n -> n!
+/Fact { 1 exch 2 exch 1 exch { mul } for } bind def
+/fact { Fact } bind def
+/PI 3.14159265358 def
+end
+% END pstricks-add.pro
-% END pst-eqdf.pro
diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
index f4fb97aa343..d698ac218b2 100644
--- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
+++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
@@ -5,7 +5,8 @@
%%
%% Package `pstricks-add.tex'
%%
-%% Herbert Voss <voss _at_ pstricks.de>
+%% Dominique Rodriguez <Dominique.Rodriguez _at_ waika9.fr>
+%% Herbert Voss <Herbert.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
@@ -25,9 +26,9 @@
\ifx\MultidoLoaded\endinput\else\input multido \fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
%
-\def\fileversion{2.70}
-\def\filedate{2005/10/18}
-\message{`pstricks-add' v\fileversion, \filedate\space (hv)}
+\def\fileversion{2.75}
+\def\filedate{2006/06/17}
+\message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
\SpecialCoor
@@ -37,7 +38,6 @@
\pstheader{pstricks-add.pro}%
%\pstheader{shfill_emulate.pro}%
%
-%
%-------------------------------- pstricks ------------------------------------
%
%%%%%%% \begin{pspicture} %%%%%%%%%%%%%%%%%%%
@@ -53,6 +53,15 @@
%\psset{dy=0}%
\newcount\@zero\@zero=0\relax
%
+\def\PiFour{12.566371}
+\def\PiTwo{6.283185}
+\def\Pi{3.14159265}
+\def\PiH{1.570796327}
+\newdimen\RadUnit
+\newdimen\RadUnitInv
+\RadUnit=1.047198cm % this is pi/3
+\RadUnitInv=0.95493cm % this is 3/pi
+%
\def\pst@getdimdim#1 #2 #3\@nil{%
\def\pst@tempA{#2}%
\ifx\pst@tempA\@empty
@@ -127,7 +136,7 @@
%
%--------------------------------------- small stuff -------------------------------
\def\defineTColor{\@ifnextchar[{\defineTColor@i}{\defineTColor@i[]}}
-\def\defineTColor@i[#1]#2#3{% transparency "Colors"
+\def\defineTColor@i[#1]#2#3{% transparency "colors"
\def\pst@tempA{#1}%
\newpsstyle{#2}{%
fillstyle=vlines,hatchwidth=0.1\pslinewidth,
@@ -155,8 +164,9 @@
%%% par la rotation de centre (x,y) %%%
%%% et d'angle a. %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\def\psrotate{\pst@object{psrotate}} % idea from Jean-C�e Charpentier
+\def\psrotate{\pst@object{psrotate}} % idea from Jean-C�e Charpentier
\def\psrotate@i(#1,#2)#3#4{%
+ \pst@killglue
\begin@SpecialObj%
\addto@pscode{%
#1 \pst@number\psxunit mul #2 \pst@number\psyunit mul translate
@@ -173,7 +183,7 @@
\define@key[psset]{}{dash}{% defined in pstricks.tex
\pst@expandafter\psset@@dash{#1}\@nil% Error handling for empty argument.
}
-\define@key[psset]{}{maxdashes}{\def\psk@maxdashes{#1}}
+\define@key[psset]{pstricks-add}{maxdashes}{\def\psk@maxdashes{#1}}
%\psset{maxdashes=11}
\def\psset@@dash#1\@nil{%
\def\psk@dash{}%
@@ -193,8 +203,8 @@
\next##2\relax%
\fi\fi%
\else% 04-08-07
- \@pstrickserr{Number of dashes > \psk@maxdashes. Increasing
-`maxdashes' might work.}\@ehpa% 04-08-07
+ \@pstrickserr{Number of dashes > \psk@maxdashes. Increasing
+ 'maxdashes' might work.}\@ehpa% 04-08-07
\fi% 04-08-07
}%
\expandafter\next#1 \relax}
@@ -238,7 +248,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
-\define@key[psset]{}{intSeparator}{\def\psk@intSeparator{#1}}
+\define@key[psset]{pstricks-add}{intSeparator}{\def\psk@intSeparator{#1}}
%\psset{intSeparator={,}}
%
\def\psFormatInt{\def\pst@par{}\pst@object{psFormatInt}}
@@ -274,8 +284,8 @@
}\ignorespaces}
%
\newdimen\pst@braceWidth
-\define@key[psset]{}{braceWidth}{\pssetlength\pst@braceWidth{#1}}
-\define@key[psset]{}{bracePos}{\def\psk@bracePos{#1}}
+\define@key[psset]{pstricks-add}{braceWidth}{\pssetlength\pst@braceWidth{#1}}
+\define@key[psset]{pstricks-add}{bracePos}{\def\psk@bracePos{#1}}
%\psset{braceWidth=10pt,bracePos=0.5}
%
\def\@@rput@iv(#1){\pst@killglue\pst@makebox{\@@rput@v{#1}}}
@@ -297,7 +307,7 @@
\ignorespaces%
}
%
-\def\psbrace{\def\pst@par{}\pst@object{psbrace}}
+\def\psbrace{\pst@object{psbrace}}
\def\psbrace@i(#1)(#2)#3{%
\addbefore@par{ArrowInside=-,linearc=2mm,linewidth=1pt,%
nodesepA=0pt,nodesepB=0pt,bracePos=0.5}% the default
@@ -337,13 +347,12 @@
% -------------- the arrow part -------------
% the original table
% \def\pst@arrowtable{,<->,<<->>,>-<,>>-<<,(-),[-],)-(,]-[,|>-<|}
-\edef\pst@arrowtable{\pst@arrowtable,H-H,h-h}
%
% HookLeft/RightArrow
\newdimen\pshooklength
\newdimen\pshookwidth
-\define@key[psset]{}{hooklength}{\pssetlength\pshooklength{#1}}
-\define@key[psset]{}{hookwidth}{\pssetlength\pshookwidth{#1}}
+\define@key[psset]{pstricks-add}{hooklength}{\pssetlength\pshooklength{#1}}
+\define@key[psset]{pstricks-add}{hookwidth}{\pssetlength\pshookwidth{#1}}
%\psset{hooklength=3mm,hookwidth=1mm}
%
\edef\pst@arrowtable{\pst@arrowtable,H-H,h-h} % add new arrow
@@ -378,10 +387,8 @@
0 \psk@arrowlength \psk@arrowsize \tx@Rhook
}
% New parameter "arrowfill", with default as "true"
-\newif\ifpsArrowFill
-\define@key[psset]{}{ArrowFill}{\@nameuse{psArrowFill#1}}
-%\psset{ArrowFill=true}
-
+\define@boolkey[psset]{pstricks-add}[ps]{ArrowFill}[true]{}
+%
% Modification of the PostScript macro Arrow to choose to fill or not the arrow
% (it require to restore the current linewidth, despite of the scaling)
\pst@def{Arrow}<{%
@@ -398,9 +405,9 @@
0 h a sub moveto
}>
%
-\define@key[psset]{}{nArrowsA}{\def\psk@nArrowsA{#1}}
-\define@key[psset]{}{nArrowsB}{\def\psk@nArrowsB{#1}}
-\define@key[psset]{}{nArrows}{\def\psk@nArrowsA{#1}\def\psk@nArrowsB{#1}}
+\define@key[psset]{pstricks-add}{nArrowsA}{\def\psk@nArrowsA{#1}}
+\define@key[psset]{pstricks-add}{nArrowsB}{\def\psk@nArrowsB{#1}}
+\define@key[psset]{pstricks-add}{nArrows}{\def\psk@nArrowsA{#1}\def\psk@nArrowsB{#1}}
%\psset{nArrows=2}
%
\@namedef{psas@>>}{%
@@ -429,9 +436,10 @@
%
% DG addition begin - Dec. 18/19, 1997 and Oct. 11, 2002
% Adapted from \psset@arrows
-\define@key[psset]{}{ArrowInside}{%
+ \def\psk@ArrowInside{}
+ \define@key[psset]{pstricks-add}{ArrowInside}{%
\def\pst@tempA{#1}%
- \ifx\pst@tempA\@empty\def\psk@ArrowInside{}%
+ \ifx\pst@tempA\@empty \def\psk@ArrowInside{} %
\else%
\begingroup%
\pst@activearrows%
@@ -454,36 +462,36 @@
%\psset{ArrowInside={}}
% Modified version of \pst@addarrowdef
\def\pst@addarrowdef{%
- \addto@pscode{%
- /ArrowA {
- \ifx\psk@arrowA\@empty
- \pst@oplineto
- \else
- \pst@arrowdef{A}
- moveto
- \fi
- } def
- /ArrowB {
- \ifx\psk@arrowB\@empty \else \pst@arrowdef{B} \fi
- } def
+ \addto@pscode{%
+ /ArrowA {
+ \ifx\psk@arrowA\@empty
+ \pst@oplineto
+ \else
+ \pst@arrowdef{A}
+ moveto
+ \fi
+ } def
+ /ArrowB {
+ \ifx\psk@arrowB\@empty \else \pst@arrowdef{B} \fi
+ } def
% DG addition
- /ArrowInside {
- \ifx\psk@ArrowInside\@empty \else \pst@arrowdefA{Inside} \fi
- } def
- }%
+ /ArrowInside {
+ \ifx\psk@ArrowInside\@empty \else \pst@arrowdefA{Inside} \fi
+ } def
+ }%
}
% Adapted from \pst@arrowdef
\def\pst@arrowdefA#1{%
- \ifnum\pst@repeatarrowsflag>\z@
- /Arrow#1c [ 6 2 roll ] cvx def Arrow#1c
- \fi
+ \ifnum\pst@repeatarrowsflag>\z@
+ /Arrow#1c [ 6 2 roll ] cvx def Arrow#1c
+ \fi
\tx@BeginArrow
\psk@arrowscale
\@nameuse{psas@\@nameuse{psk@Arrow#1}}
\tx@EndArrow%
}
% ArrowInsidePos parameter (default value 0.5)
-\define@key[psset]{}{ArrowInsidePos}{\pst@checknum{#1}\psk@ArrowInsidePos}%
+\define@key[psset]{pstricks-add}{ArrowInsidePos}{\pst@checknum{#1}\psk@ArrowInsidePos}%
%\psset{ArrowInsidePos=0.5}
%
% Modified version of \begin@ClosedObj
@@ -495,20 +503,33 @@
\solid@star
\ifpsdoubleline \pst@setdoublesep \fi
\pst@addarrowdef% DG addition
- \init@pscode
+ \init@pscode%
}
%
% Redefinition of the PostScript /Line macro to print the intermediate
% arrow on each segment of the line
%
-\define@key[psset]{}{ArrowInsideNo}{\pst@checknum{#1}\psk@ArrowInsideNo}% hv 20031001
-\define@key[psset]{}{ArrowInsideOffset}{\pst@checknum{#1}\psk@ArrowInsideOffset}% hv 20031001
+\define@key[psset]{pstricks-add}{ArrowInsideNo}{\pst@checknum{#1}\psk@ArrowInsideNo}% hv 20031001
+\define@key[psset]{pstricks-add}{ArrowInsideOffset}{\pst@checknum{#1}\psk@ArrowInsideOffset}% hv 20031001
%\psset{ArrowInsideNo=1,ArrowInsideOffset=0}
%
+\def\arrowType@H{H}
\pst@def{Line}<{%
NArray n 0 eq not { n 1 eq { 0 0 /n 2 def } if
(\psk@ArrowInside) length 0 gt {
- 2 copy /y1 ED /x1 ED ArrowA x1 y1
+ \ifx\psk@arrowA\arrowType@H % do we have a Hook arrow at the beginning?
+ \pst@number\pshooklength % yes
+ \else
+ \psk@arrowsize\space CLW mul add dup \psk@arrowlength\space mul exch \psk@arrowinset mul neg add
+ \fi
+ /arrowlength exch def
+ 4 copy % copy all four values for the arrow line
+ /y1 ED /x1 ED /y2 ED /x2 ED % save them
+ /Alpha y2 y1 sub x2 x1 sub atan def % the gradient of the line
+% 2 copy /y1 ED /x1 ED ArrowA x1 y1
+ ArrowA % draw arrowA
+ x1 Alpha cos arrowlength mul add % dx add
+ y1 Alpha sin arrowlength mul add % dy add, to get the current point at the end of the arrow tip
/n n 1 sub def
n {
4 copy
@@ -805,11 +826,11 @@
%
%\def\psDashColorI{black}
%\def\psDashColorII{red}
-\define@key[psset]{}{dashColorI}{\pst@getcolor{#1}\psDashColorI}
-\define@key[psset]{}{dashColorII}{\pst@getcolor{#1}\psDashColorII}
-\define@key[psset]{}{dashNo}{\def\psk@dashNo{#1}}
+\define@key[psset]{pstricks-add}{dashColorI}{\pst@getcolor{#1}\psDashColorI}
+\define@key[psset]{pstricks-add}{dashColorII}{\pst@getcolor{#1}\psDashColorII}
+\define@key[psset]{pstricks-add}{dashNo}{\def\psk@dashNo{#1}}
%
-\define@key[psset]{}{linecap}{\def\psk@linecap{#1}}
+\define@key[psset]{pstricks-add}{linecap}{\def\psk@linecap{#1}}
%\psset{dashColorI=black,dashColorII=red,dashNo=0.2,linecap=0}
%
\pst@def{LineII}<{%
@@ -863,61 +884,8 @@
\end@OpenObj%
}
%
-\newdimen\pswBegin\newdimen\pswEnd
-\define@key[psset]{}{wBegin}{\pssetlength\pswBegin{#1}}
-\define@key[psset]{}{wEnd}{\pssetlength\pswEnd{#1}}
-%\psset{wBegin=\pslinewidth, wEnd=\pslinewidth}
-%
-\pst@def{LineIII}<{%
- NArray
- /n n 1 sub def
- /YA ED /XA ED
- /bA2 \pst@number\pswBegin\space 2.0 div def
- /bB2 \pst@number\pswEnd\space 2.0 div def
- /xStep bB2 bA2 sub n div def
- 0 setlinecap
- n {
- XA YA moveto
- /YB ED /XB ED
- /Alpha YB YA sub XB XA sub atan def
- /Alphasin Alpha sin def
- /Alphacos Alpha cos def
- \pst@usecolor\pslinecolor
- 0.01 SLW
- /bB2 bA2 xStep add def
- XA Alphasin bA2 mul sub
- YA Alphacos bA2 mul add lineto
- XB Alphasin bB2 mul sub
- YB Alphacos bB2 mul add lineto
- XB Alphasin bB2 mul add
- YB Alphacos bB2 mul sub lineto
- XA Alphasin bA2 mul add
- YA Alphacos bA2 mul sub lineto
- XA YA lineto fill
- /XA XB def /YA YB def
- /bA2 bB2 def
- } repeat
-}>
-%
-\def\pslineIII{\pst@object{pslineIII}}
-\def\pslineIII@i{%
- \pst@getarrows{%
- \begin@OpenObj
- \pst@getcoors[\pslineIII@ii%
- }%
-}
-\def\pslineIII@ii{%
- \addto@pscode{%
- \pst@cp
- \ifshowpoints true \else false \fi
- \tx@LineIII
- }%
- \end@OpenObj%
-}
-%
-\define@key[psset]{}{randomPoints}{\def\psk@randomPoints{#1}}
-\newif\ifPst@randomColor
-\define@key[psset]{}{color}[true]{\@nameuse{Pst@randomColor#1}}
+\define@key[psset]{pstricks-add}{randomPoints}{\def\psk@randomPoints{#1}}
+\define@boolkey[psset]{pstricks-add}[Pst@]{color}[true]{}
%\psset{randomPoints=1000,color=false}
%
\def\psRandom{\pst@object{psRandom}}% hv 2004-11-12
@@ -941,7 +909,7 @@
\psk@dotsize % defines /DS ... def
\@nameuse{psds@\psk@dotstyle}
\psk@randomPoints {
- \ifPst@randomColor getRandReal getRandReal getRandReal setrgbcolor \fi
+ \ifPst@color getRandReal getRandReal getRandReal setrgbcolor \fi
getRandReal dx mul xMin add
getRandReal dy mul yMin add
Dot
@@ -953,6 +921,7 @@
\ignorespaces
}
%
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%% %%%%%%%%%%
%%%%%%%%%%% pst-node %%%%%%%%%%
@@ -1027,7 +996,7 @@
\def\pclineII{\pst@object{pclineII}}%
\def\pclineII@i{\pc@object\nclineII@ii}%
%
-\define@key[psset]{}{lineAngle}{\psset{armB=0.5}\def\psk@lineAngle{#1}}%
+\define@key[psset]{pstricks-add}{lineAngle}{\psset{armB=0.5}\def\psk@lineAngle{#1}}%
%\psset{lineAngle=0}%
%
\pst@def{NCDiag}<{
@@ -1103,7 +1072,7 @@
\def\ncbarr@i#1#2{
\begingroup
\use@par%
- \setLNode(#1)(#2){0.5}{barr@tempNode}%
+ \psLNode(#1)(#2){0.5}{barr@tempNode}%
\pst@dimm=\psk@angleA pt
\pst@dimn=180pt
% be sure, that angleA is 0 or 180. if not, we set it to 0
@@ -1117,7 +1086,7 @@
% #1-------#4----------------#2
% where #1#4= #3 * #1#2
%
-\def\setLNode(#1)(#2)#3#4{%
+\def\psLNode(#1)(#2)#3#4{%
\pst@getcoor{#1}\pst@tempA%
\pst@getcoor{#2}\pst@tempB%
\pnode(!%
@@ -1131,7 +1100,7 @@
}
%
% build the linear combination #2*#1+#4*#3=#5
-\def\setLCNode(#1)#2(#3)#4#5{%
+\def\psLCNode(#1)#2(#3)#4#5{%
\pst@getcoor{#1}\pst@tempA%
\pst@getcoor{#3}\pst@tempB%
\pnode(!%
@@ -1143,8 +1112,8 @@
YA #2\space mul YB #4\space mul add){#5}%
}
%
-\newif\ifPst@trueAngle
-\define@key[psset]{}{trueAngle}[true]{\@nameuse{Pst@trueAngle#1}}
+%
+\define@boolkey[psset]{pstricks-add}[Pst@]{trueAngle}[true]{}
%\psset{trueAngle=false}
%
\def\psRelNode{\pst@object{psRelNode}}
@@ -1252,7 +1221,7 @@
} ifelse ){#5}%
}
%
-\def\psLNode(#1)(#2)#3#4{%
+\def\psLDNode(#1)(#2)#3#4{%
% #1: node A #2: node B #3: dimen measured from A #4: node name
\pst@getcoor{#1}\pst@tempA%
\pst@getcoor{#2}\pst@tempB%
@@ -1271,7 +1240,7 @@
\def\nlput{\pst@object{nlput}}
\def\nlput@i(#1)(#2)#3#4{%
\begin@SpecialObj
- \psLNode(A)(B){#3}{@temp@lnput}
+ \psLDNode(A)(B){#3}{@temp@lnput}
\pcline[linestyle=none](#1)(@temp@lnput)%
\ncput[npos=1]{#4}%
\end@SpecialObj
@@ -1282,60 +1251,67 @@
%%%%%%%%%%% %%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-\newif\ifPst@plot@comma
-\define@key[psset]{}{comma}[true]{\@nameuse{Pst@plot@comma#1}}
+\define@key[psset]{pstricks-add}{labelFontSize}{\def\psk@labelFontSize{#1}}%
+\psset{labelFontSize={}}
+\def\pshlabel#1{\psk@labelFontSize$#1$}%
+\def\psvlabel#1{\psk@labelFontSize$#1$}
+%
+\define@boolkey[psset]{pstricks-add}[Pst@]{comma}[true]{}
%
-\newif\ifPst@plot@xAxis
-\newif\ifPst@plot@yAxis
-\newif\ifPst@plot@xyAxes
-\define@key[psset]{}{xAxis}[true]{\@nameuse{Pst@plot@xAxis#1}}
-\define@key[psset]{}{yAxis}[true]{\@nameuse{Pst@plot@yAxis#1}}
-\define@key[psset]{}{xyAxes}[true]{\@nameuse{Pst@plot@xAxis#1}\@nameuse{Pst@plot@yAxis#1}}%
+\define@boolkey[psset]{pstricks-add}[Pst@]{xAxis}[true]{}
+\define@boolkey[psset]{pstricks-add}[Pst@]{yAxis}[true]{}
+%\define@boolkey[psset]{pstricks-add}[Pst@]{xAxis}[true]{\@nameuse{Pst@xAxis#1}}
+%\define@boolkey[psset]{pstricks-add}[Pst@]{yAxis}[true]{\@nameuse{Pst@yAxis#1}}
+\define@boolkey[psset]{pstricks-add}[Pst@]{xyAxes}[true]{%
+ \@nameuse{Pst@xAxis#1}\@nameuse{Pst@yAxis#1}}%
%\psset{xyAxes=true}%
%
-\define@key[psset]{}{xyDecimals}{\def\psk@xDecimals{#1}\def\psk@yDecimals{#1}}
-\define@key[psset]{}{xDecimals}{\def\psk@xDecimals{#1}}
-\define@key[psset]{}{yDecimals}{\def\psk@yDecimals{#1}}
+\define@key[psset]{pstricks-add}{xyDecimals}{\def\psk@xDecimals{#1}\def\psk@yDecimals{#1}}
+\define@key[psset]{pstricks-add}{xDecimals}{\def\psk@xDecimals{#1}}
+\define@key[psset]{pstricks-add}{yDecimals}{\def\psk@yDecimals{#1}}
%\psset{xyDecimals={}}%
%
-\define@key[psset]{}{xlogBase}{\def\psk@xlogBase{#1}}
-\define@key[psset]{}{ylogBase}{\def\psk@ylogBase{#1}}
-\define@key[psset]{}{xylogBase}{\def\psk@xlogBase{#1}\def\psk@ylogBase{#1}}%
+\define@key[psset]{pstricks-add}{xlogBase}{\def\psk@xlogBase{#1}}
+\define@key[psset]{pstricks-add}{ylogBase}{\def\psk@ylogBase{#1}}
+\define@key[psset]{pstricks-add}{xylogBase}{\def\psk@xlogBase{#1}\def\psk@ylogBase{#1}}%
%\psset{xylogBase={}}%
%
-\newif\ifPst@trigLabels
-\define@key[psset]{pstricks-add}{trigLabels}[true]{%
- \@nameuse{Pst@trigLabels#1}%
+\define@key[psset]{pstricks-add}{trigLabelBase}{\pst@getint{#1}{\psk@trigLabelBase}}
+\psset{trigLabelBase=0}
+
+\define@boolkey[psset]{pstricks-add}[Pst@]{trigLabels}[true]{%
\ifPst@trigLabels
\def\pst@@@hlabel##1{\pshlabel{##1}}
- \def\pshlabel##1{$%
- \ifnum##1=0 0\else% % ##1=0, print 0 and return
- \def\pst@sign{\ifnum##1<0 -\fi}
- \pst@abs{##1}\pst@cnta
- \pst@mod{\pst@cnta}{2}\pst@cntc % pst@cntc-> 0 or 1 (fraction or not)
- \ifnum1>\pst@cntc % 0: ##1\pi 1: ##1/2 \pi
- \pst@cntb=\pst@cnta \divide\pst@cntb by 2 % ##1/2
- \pst@sign\ifnum\pst@cntb>1 \the\pst@cntb\fi\pi % n*pi
- \else\pst@sign\frac{\ifnum\pst@cnta>1 \the\pst@cnta \fi\pi}{2}\fi
- \fi$}% n/2*pi
+ \def\pshlabel##1{%
+ \ifnum\psk@trigLabelBase<2
+ \def\de@nominator{\@ne}\else\def\de@nominator{\psk@trigLabelBase}\fi
+ \pst@mod{##1}{\de@nominator}\@tempa
+ \ifnum\@ne>\@tempa
+ \count1=##1 \divide\count1 by \de@nominator
+ \psk@labelFontSize
+ \ifnum\count1=\@ne
+ $\pi$\else$\the\count1\pi$\fi
+ \else\ifnum\@tempa=\@ne
+ $\frac{\pi}{\de@nominator}$\else$\frac{##1}{\de@nominator}\pi$\fi\fi%
+ }
\else
\def\pst@@@hlabel##1{%
\edef\@xyDecimals{\psk@xDecimals}%
\ifnum\psk@ticks<\tw@ % ticks=all|x
\ifx\psk@xlogBase\@empty
- \pshlabel{\expandafter\@LabelComma##1..\@nil\psk@xlabelFactor}%
+ \pshlabel{\psk@labelFontSize\expandafter\@LabelComma##1..\@nil\psk@xlabelFactor}%
\else%
- \pshlabel{\psk@xlogBase\textsuperscript{\expandafter\@stripDecimals##1..\@nil }}
+ \pshlabel{\psk@labelFontSize\psk@xlogBase\textsuperscript{\expandafter\@stripDecimals##1..\@nil }}
\fi%
\fi%
}
- \def\pshlabel##1{$##1$}%
+ \def\pshlabel##1{\psk@labelFontSize$##1$}%
\fi
}
-%\psset[pstricks-add]{trigLabels=false}
+\psset{trigLabels=false}
%
%logLines=all|x|y|none (0,1,2,3)
-\define@key[psset]{}{logLines}{\pst@expandafter\psset@@logLines{#1}\@nil\psk@logLines}
+\define@key[psset]{pstricks-add}{logLines}{\pst@expandafter\psset@@logLines{#1}\@nil\psk@logLines}
\def\psset@@logLines#1#2\@nil#3{%
\ifx#1a\let#3\z@\else
\ifx#1x\let#3\@ne\else
@@ -1348,8 +1324,8 @@
% Define "ticklines" parameter (ticklines=all|x|y|none with default=none)
%\def\psset@ticklines#1{\pst@expandafter\psset@@ticklines{#1}\@nil\psk@ticklines}
%\psset@ticklines{none}
-\define@key[psset]{}{ylabelFactor}{\def\psk@ylabelFactor{#1}}
-\define@key[psset]{}{xlabelFactor}{\def\psk@xlabelFactor{#1}}
+\define@key[psset]{pstricks-add}{ylabelFactor}{\def\psk@ylabelFactor{#1}}
+\define@key[psset]{pstricks-add}{xlabelFactor}{\def\psk@xlabelFactor{#1}}
%\psset{xlabelFactor=\relax,ylabelFactor=\relax}%
% The parameter styles for the tick lines
% (default=arrows=-,linestyle=dotted,dotsep=5pt)
@@ -1371,7 +1347,7 @@
\ifodd\psk@ticks % ticks=all||y (0,2)
\else
\ifx\psk@ylogBase\@empty
-% \ifPst@plot@comma
+% \ifPst@comma
\psvlabel{\expandafter\@LabelComma#1..\@nil\psk@ylabelFactor}%
% \else\psvlabel{#1\psk@ylabelFactor}\fi%
\else%
@@ -1400,12 +1376,12 @@
\def\@tempa{#1}% write only if not empty
\ifx\@tempa\@empty% write nothing
\else
- \ifPst@plot@comma{,}\else.\fi%
+ \ifPst@comma{,}\else.\fi%
#1%
\fi%
\else% write only \xy@decimals
\ifnum\@xyDecimals>\@zero
- \ifPst@plot@comma{,}\else.\fi
+ \ifPst@comma{,}\else.\fi
\@Reset@digitcounter
\@process@digits#1*;
\fi%
@@ -1433,8 +1409,8 @@
%
\def\psxs@axes{{%
- \ifPst@plot@xAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}\fi%
- \ifPst@plot@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}\fi%
+ \ifPst@xAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{}\fi%
+ \ifPst@yAxis\psxs@@axes\pst@dima\pst@dimb\pst@dimc\pst@dimd{exch}\fi%
}}
\def\psaxes{\pst@object{psaxes}}
\def\psaxes@i{\pst@getarrows\psaxes@ii}
@@ -1455,27 +1431,7 @@
% If minimum values are negative in log mode, we modify Ox
% (respectively Oy) if this was not done by the user
% X axis labels (\psk@log = 0 or 1)
- \ifx\psk@xlogBase\@empty\else%
- \ifx\psk@Ox\@empty\else% we do nothing ... hv
- \ifdim\psk@Ox pt=\z@
- \ifdim#3pt<\z@
- \pssetxlength\pst@dimg{#1}% o-x
- \psset{Ox=#1}%
- \fi
- \fi%
- \fi%
- \fi%
-% Y axis labels (\psk@log = 0 or 2)
- \ifx\psk@ylogBase\@empty\else%
- \ifx\psk@Ox\@empty\else
- \ifdim#4pt<\z@
- \ifdim\psk@Oy pt=\z@
- \pssetylength\pst@dimh{#2}% o-y
- \psset{Oy=#2}%
- \fi
- \fi
- \fi
- \fi
+%
% Whole thing will be translated to origin:
\advance\pst@dima-\pst@dimg% Dist. from bl-x to o-x
\advance\pst@dimb-\pst@dimh% Dist. from bl-y to o-y
@@ -1483,29 +1439,29 @@
\advance\pst@dimd-\pst@dimh% Dist. from ur-y to o-y
% Make lines/arrows or frame:
\@nameuse{psxs@\psk@axesstyle}% \psxs@axes or \psxs@frame
- \ifPst@plot@yAxis%
+ \ifPst@yAxis%
\begingroup%
\ifdim\pst@dima=\z@\else\showoriginfalse\fi%
\ifnum\psk@dy=\z@%
\pst@dimg=\psk@Dy\psyunit%
\edef\psk@dy{\number\pst@dimg}%
\fi%
- \ifPst@plot@xAxis\else\showorigintrue\fi%
+ \ifPst@xAxis\else\showorigintrue\fi%
\pst@vlabels{\pst@dimd}{\psk@arrowB}{#3}{#5}%
- \ifPst@plot@xAxis\showoriginfalse\fi%
+ \ifPst@xAxis\showoriginfalse\fi%
\pst@vlabels{\pst@dimb}{\psk@arrowA}{#3}{#5}%
\endgroup%
\fi%
- \ifPst@plot@xAxis%
+ \ifPst@xAxis%
\begingroup%
\ifdim\pst@dimb=\z@\else\showoriginfalse\fi%
\ifnum\psk@dx=\z@%
\pst@dimg=\psk@Dx\psxunit%
\edef\psk@dx{\number\pst@dimg}%
\fi%
- \ifPst@plot@yAxis\else\showorigintrue\fi%
+ \ifPst@yAxis\else\showorigintrue\fi%
\pst@hlabels{\pst@dimc}{\psk@arrowB}{#4}{#6}%
- \ifPst@plot@yAxis\showoriginfalse\fi%
+ \ifPst@yAxis\showoriginfalse\fi%
\pst@hlabels{\pst@dima}{\psk@arrowA}{#4}{#6}%
\endgroup%
\fi%
@@ -1555,8 +1511,8 @@
\fi%
}
\define@key[psset]{}{ticksize}{\set@xticksize{#1}\set@yticksize{#1}}
-\define@key[psset]{}{xticksize}{\set@xticksize{#1}}
-\define@key[psset]{}{yticksize}{\set@yticksize{#1}}% overwrites the definition in pstricks
+\define@key[psset]{pstricks-add}{xticksize}{\set@xticksize{#1}}
+\define@key[psset]{pstricks-add}{yticksize}{\set@yticksize{#1}}% overwrites the definition in pstricks
%\psset{ticksize=-4pt 4pt}
%
% full= 0, top=1, bottom=-1
@@ -1576,59 +1532,61 @@
%\psset{tickstyle=full}%
%
%
-\define@key[psset]{}{subticks}{\def\psk@xsubticks{#1}\def\psk@ysubticks{#1}}
-\define@key[psset]{}{xsubticks}{\def\psk@xsubticks{#1}}
-\define@key[psset]{}{ysubticks}{\def\psk@ysubticks{#1}}
+\define@key[psset]{pstricks-add}{subticks}{\def\psk@xsubticks{#1}\def\psk@ysubticks{#1}}
+\define@key[psset]{pstricks-add}{xsubticks}{\def\psk@xsubticks{#1}}
+\define@key[psset]{pstricks-add}{ysubticks}{\def\psk@ysubticks{#1}}
%
-\define@key[psset]{}{subticksize}{\def\psk@xsubticksize{#1}\def\psk@ysubticksize{#1}}
-\define@key[psset]{}{xsubticksize}{\def\psk@xsubticksize{#1}}
-\define@key[psset]{}{ysubticksize}{\def\psk@ysubticksize{#1}}
+\define@key[psset]{pstricks-add}{subticksize}{\def\psk@xsubticksize{#1}\def\psk@ysubticksize{#1}}
+\define@key[psset]{pstricks-add}{xsubticksize}{\def\psk@xsubticksize{#1}}
+\define@key[psset]{pstricks-add}{ysubticksize}{\def\psk@ysubticksize{#1}}
%
-\define@key[psset]{}{tickwidth}{%
+\define@key[psset]{pstricks-add}{tickwidth}{%
\pst@getlength{#1}\psk@xtickwidth%
\pst@getlength{#1}\psk@ytickwidth}
-\define@key[psset]{}{xtickwidth}{\pst@getlength{#1}\psk@xtickwidth}
-\define@key[psset]{}{ytickwidth}{\pst@getlength{#1}\psk@ytickwidth}
-\define@key[psset]{}{subtickwidth}{%
+\define@key[psset]{pstricks-add}{xtickwidth}{\pst@getlength{#1}\psk@xtickwidth}
+\define@key[psset]{pstricks-add}{ytickwidth}{\pst@getlength{#1}\psk@ytickwidth}
+\define@key[psset]{pstricks-add}{subtickwidth}{%
\pst@getlength{#1}\psk@xsubtickwidth%
\pst@getlength{#1}\psk@ysubtickwidth}
-\define@key[psset]{}{xsubtickwidth}{\pst@getlength{#1}\psk@xsubtickwidth}
-\define@key[psset]{}{ysubtickwidth}{\pst@getlength{#1}\psk@ysubtickwidth}
-%
-\define@key[psset]{}{tickcolor}{\def\psk@xtickcolor{#1}\def\psk@ytickcolor{#1}}
-\define@key[psset]{}{xtickcolor}{\def\psk@xtickcolor{#1}}
-\define@key[psset]{}{ytickcolor}{\def\psk@ytickcolor{#1}}
-\define@key[psset]{}{subtickcolor}{\def\psk@xsubtickcolor{#1}\edef\psk@ysubtickcolor{#1}}
-\define@key[psset]{}{xsubtickcolor}{\def\psk@xsubtickcolor{#1}}
-\define@key[psset]{}{ysubtickcolor}{\def\psk@ysubtickcolor{#1}}
-%
-\define@key[psset]{}{xticklinestyle}{%
+\define@key[psset]{pstricks-add}{xsubtickwidth}{\pst@getlength{#1}\psk@xsubtickwidth}
+\define@key[psset]{pstricks-add}{ysubtickwidth}{\pst@getlength{#1}\psk@ysubtickwidth}
+%
+\define@key[psset]{pstricks-add}{tickcolor}{\def\psk@xtickcolor{#1}\def\psk@ytickcolor{#1}}
+\define@key[psset]{pstricks-add}{xtickcolor}{\def\psk@xtickcolor{#1}}
+\define@key[psset]{pstricks-add}{ytickcolor}{\def\psk@ytickcolor{#1}}
+\define@key[psset]{pstricks-add}{subtickcolor}{%
+ \pst@getcolor{#1}\psk@xsubtickcolor%
+ \pst@getcolor{#1}\psk@ysubtickcolor}
+\define@key[psset]{pstricks-add}{xsubtickcolor}{\pst@getcolor{#1}\psk@xsubtickcolor}
+\define@key[psset]{pstricks-add}{ysubtickcolor}{\pst@getcolor{#1}\psk@ysubtickcolor}
+%
+\define@key[psset]{pstricks-add}{xticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\def\psxticklinestyle{#1}}}
-\define@key[psset]{}{xsubticklinestyle}{%
+\define@key[psset]{pstricks-add}{xsubticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\def\psxsubticklinestyle{#1}}}
-\define@key[psset]{}{yticklinestyle}{%
+\define@key[psset]{pstricks-add}{yticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\def\psyticklinestyle{#1}}}
-\define@key[psset]{}{ysubticklinestyle}{%
+\define@key[psset]{pstricks-add}{ysubticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\def\psysubticklinestyle{#1}}}
-\define@key[psset]{}{ticklinestyle}{%
+\define@key[psset]{pstricks-add}{ticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\def\psxticklinestyle{#1}\def\psyticklinestyle{#1}}}
-\define@key[psset]{}{subticklinestyle}{%
+\define@key[psset]{pstricks-add}{subticklinestyle}{%
\@ifundefined{psls@#1}%
{\@pstrickserr{Line style `#1' not defined}\@eha}%
{\def\psxsubticklinestyle{#1}\def\psysubticklinestyle{#1}}}
%
-\define@key[psset]{}{ticklinestyle}{\psset{xticklinestyle=#1,yticklinestyle=#1}}
-\define@key[psset]{}{subticklinestyle}{\psset{xsubticklinestyle=#1,ysubticklinestyle=#1}}
+\define@key[psset]{pstricks-add}{ticklinestyle}{\psset{xticklinestyle=#1,yticklinestyle=#1}}
+\define@key[psset]{pstricks-add}{subticklinestyle}{\psset{xsubticklinestyle=#1,ysubticklinestyle=#1}}
%\psset{subticksize=0.75,subticks=1,tickcolor=black,ticklinestyle=solid,%
% subticklinestyle=solid,%
% subtickcolor=gray,%
@@ -1848,8 +1806,8 @@
\divide\pst@cnta\psk@dx\relax% % Number of ticks/labels
\ifnum\pst@cnta=\z@\else%
\pst@dimb=\psk@dx sp% % Space between ticks.
-% \ifPst@plot@yAxis\else\showorigintrue\fi%
- \ifnum\psk@labels<\tw@ \ifPst@plot@xAxis\pst@@hlabels\fi\fi%
+% \ifPst@yAxis\else\showorigintrue\fi%
+ \ifnum\psk@labels<\tw@ \ifPst@xAxis\pst@@hlabels\fi\fi%
\showoriginfalse%
\fi%
\fi%
@@ -1878,8 +1836,8 @@
\divide\pst@cnta\psk@dy\relax % % Number of ticks/labels
\ifnum\pst@cnta=\z@\else%
\pst@dima=\psk@dy sp% % Space between ticks.
-% \ifPst@plot@xAxis\else\showorigintrue\fi%
- \ifodd\number\psk@labels\else\ifPst@plot@yAxis\pst@@vlabels\fi\fi%
+% \ifPst@xAxis\else\showorigintrue\fi%
+ \ifodd\number\psk@labels\else\ifPst@yAxis\pst@@vlabels\fi\fi%
\showoriginfalse%
\fi%
\fi%
@@ -1913,19 +1871,19 @@
\vss%
}}
%
-\define@key[psset]{}{nStep}{\def\psk@nStep{#1}}
-\define@key[psset]{}{nStart}{\def\psk@nStart{#1}}
-\define@key[psset]{}{nEnd}{\def\psk@nEnd{#1}}
-\define@key[psset]{}{xStep}{\def\psk@xStep{#1}}
-\define@key[psset]{}{yStep}{\def\psk@yStep{#1}}
+\define@key[psset]{pstricks-add}{nStep}{\def\psk@nStep{#1}}
+\define@key[psset]{pstricks-add}{nStart}{\def\psk@nStart{#1}}
+\define@key[psset]{pstricks-add}{nEnd}{\def\psk@nEnd{#1}}
+\define@key[psset]{pstricks-add}{xStep}{\def\psk@xStep{#1}}
+\define@key[psset]{pstricks-add}{yStep}{\def\psk@yStep{#1}}
%
-\define@key[psset]{}{xStart}{\def\psk@xStart{#1}}
-\define@key[psset]{}{xEnd}{\def\psk@xEnd{#1}}
-\define@key[psset]{}{yStart}{\def\psk@yStart{#1}}
-\define@key[psset]{}{yEnd}{\def\psk@yEnd{#1}}
+\define@key[psset]{pstricks-add}{xStart}{\def\psk@xStart{#1}}
+\define@key[psset]{pstricks-add}{xEnd}{\def\psk@xEnd{#1}}
+\define@key[psset]{pstricks-add}{yStart}{\def\psk@yStart{#1}}
+\define@key[psset]{pstricks-add}{yEnd}{\def\psk@yEnd{#1}}
%
-\define@key[psset]{}{plotNo}{\def\psk@plotNo{#1}}
-\define@key[psset]{}{plotNoMax}{\def\psk@plotNoMax{#1}}
+\define@key[psset]{pstricks-add}{plotNo}{\def\psk@plotNo{#1}}
+\define@key[psset]{pstricks-add}{plotNoMax}{\def\psk@plotNoMax{#1}}
%
%\psset{nStep=1, nStart=0, nEnd={},%
% xStep=0, yStep=0, xStart={}, xEnd={}, yStart={}, yEnd={}, comma=false,%
@@ -1959,8 +1917,7 @@
\@nameuse{endplot@\psplotstyle}%
}
%
-\newif\ifPst@ChangeOrder
-\define@key[psset]{}{ChangeOrder}[true]{\@nameuse{Pst@ChangeOrder#1}}
+\define@boolkey[psset]{pstricks-add}[Pst@]{ChangeOrder}[true]{}
\pst@def{PreparePoints}<{%
counttomark /m exch def
\ifPst@ChangeOrder
@@ -2033,34 +1990,33 @@
}>
%
%
-\define@key[psset]{}{xAxisLabel}{\def\psk@xAxisLabel{#1}}
-\define@key[psset]{}{yAxisLabel}{\def\psk@yAxisLabel{#1}}
+\define@key[psset]{pstricks-add}{xAxisLabel}{\def\psk@xAxisLabel{#1}}
+\define@key[psset]{pstricks-add}{yAxisLabel}{\def\psk@yAxisLabel{#1}}
%\psset{xAxisLabel=x,yAxisLabel=y}
-\define@key[psset]{}{xAxisLabelPos}{\def\psk@xAxisLabelPos{#1}}
-\define@key[psset]{}{yAxisLabelPos}{\def\psk@yAxisLabelPos{#1}}
+\define@key[psset]{pstricks-add}{xAxisLabelPos}{\def\psk@xAxisLabelPos{#1}}
+\define@key[psset]{pstricks-add}{yAxisLabelPos}{\def\psk@yAxisLabelPos{#1}}
%\psset{yAxisLabelPos={},xAxisLabelPos={}}
%
\newdimen\psk@llx
\newdimen\psk@lly
\newdimen\psk@urx
\newdimen\psk@ury
-\define@key[psset]{}{llx}{\pssetxlength\psk@llx{#1}}
-\define@key[psset]{}{lly}{\pssetylength\psk@lly{#1}}
-\define@key[psset]{}{urx}{\pssetxlength\psk@urx{#1}}
-\define@key[psset]{}{ury}{\pssetylength\psk@ury{#1}}
+\define@key[psset]{pstricks-add}{llx}{\pssetxlength\psk@llx{#1}}
+\define@key[psset]{pstricks-add}{lly}{\pssetylength\psk@lly{#1}}
+\define@key[psset]{pstricks-add}{urx}{\pssetxlength\psk@urx{#1}}
+\define@key[psset]{pstricks-add}{ury}{\pssetylength\psk@ury{#1}}
%\psset{llx=\z@, lly=\z@, urx=\z@, ury=\z@}% prevents rounding errors
\newif\ifPst@plot@box
-\define@key[psset]{}{box}[true]{\@nameuse{Pst@plot@box#1}}
+\define@key[psset]{pstricks-add}{box}[true]{\@nameuse{Pst@plot@box#1}}
%
\newdimen\pst@xunit
\newdimen\pst@yunit
%
\def\psgraph{\def\pst@par{}\pst@object{psgraph}}
\def\psgraph@i{\pst@getarrows\psgraph@ii}
-\def\psgraph@ii(#1){\@ifnextchar({\psgraph@iii(#1)}{\psgraph@iv(0,0)(#1)}}
-\def\psgraph@iii(#1)(#2){\@ifnextchar(%
- {\psgraph@v(#1)(#2)}%
- {\psgraph@iv(#1)(#2)}}
+\def\psgraph@ii(#1,#2){\@ifnextchar({\psgraph@iii(#1,#2)}{\psgraph@iv(0,0)(#1,#2)}}
+\def\psgraph@iii(#1,#2)(#3,#4){\@ifnextchar({\psgraph@v(#1,#2)(#3,#4)}{\psgraph@iv(#1,#2)(#3,#4)}}
+%
\def\psgraph@iv(#1,#2)(#3,#4)#5#6{% no special origin defined
% minX | minY | maxX | maxY | Length x-axis | length y-axis%
\pst@killglue
@@ -2157,7 +2113,7 @@
\endgroup
\def\readdata{\@ifnextchar[{\readdata@i}{\readdata@i[]}}
-\def\readdata@i[#1]#2#3{{%
+\def\readdata@i[#1]#2#3{%
\def\pst@tempA{#1}%
\ifx\pst@tempA\@empty\else\psset{#1}\fi
\openin1=#3
@@ -2181,19 +2137,33 @@
\endgroup%
\global\let#2\pst@tempg%
\global\let\pst@tempg\relax%
-}\ignorespaces}
+\ignorespaces}
%
% D.G. addition - Jun. 9, 1998 - Polar plots using the \psplot macro
% Code added according the way suggested by Ulrich Dirr <udirr@das-team.com>
-
% For polar plots
-\newif\ifpolarplot
-\define@key[psset]{}{polarplot}[true]{\@nameuse{polarplot#1}}
+\define@boolkey[psset]{pstricks-add}[Pst@]{polarplot}[true]{}
%\psset{polarplot=false}
%
-\newif\ifPst@algebraic%
-\define@key[psset]{}{algebraic}[true]{\@nameuse{Pst@algebraic#1}}%
+\define@boolkey[psset]{pstricks-add}[Pst@]{algebraic}[true]{}%
%\psset{dimen=middle}% remark of ML
+\define@key[psset]{pstricks-add}{method}{\def\psk@method{#1}}% adams - rk4
+\define@key[psset]{pstricks-add}{whichabs}{\def\psk@whichabs{#1}}%
+\define@key[psset]{pstricks-add}{whichord}{\def\psk@whichord{#1}}%
+\define@key[psset]{pstricks-add}{plotfuncx}{\def\psk@plotfuncx{#1}}%
+\define@key[psset]{pstricks-add}{plotfuncy}{\def\psk@plotfuncy{#1}}%
+\define@key[psset]{pstricks-add}{expression}{\def\psk@expression{#1}}%
+\define@boolkey[psset]{pstricks-add}[Pst@]{buildvector}[true]{}%
+\def\@rkiv{rk4}% Runge-Kutta 4 method
+\def\@adams{adams}% Adams method
+\def\@default{default}% Adams method
+%
+\define@boolkey[psset]{pstricks-add}[Pst@]{VarStep}[true]{}
+\define@key[psset]{pstricks-add}{PlotDerivative}{\def\psk@PlotDerivative{#1}}%
+\define@key[psset]{pstricks-add}{VarStepEpsilon}{\def\psk@VarStepEpsilon{#1}}%
+\define@key[psset]{pstricks-add}{varsteptol}{\def\psk@varsteptol{#1}}% adams - rk4
+\define@key[psset]{pstricks-add}{adamsorder}{\def\psk@adamsorder{#1}}% adams - rk4
+%\define@key[psset]{pstricks-add}{varstepincrease}{\def\psk@varstepincrease{#1}}% varrk4
%
\def\psplot@i#1#2#3{%
\pst@killglue
@@ -2201,13 +2171,34 @@
\use@par
\@nameuse{beginplot@\psplotstyle}%
% D.G. modification begin - Jun. 9, 1998
- \ifpolarplot
+ \ifPst@polarplot
\addto@pscode{%
\psplot@init
/x #1 def
/x1 #2 def
/dx x1 x sub \psk@plotpoints div def
- /F@pstplot \ifPst@algebraic (#3) tx@addDict begin AlgParser end cvx \else { #3 } \fi def
+ /F@pstplot \ifPst@algebraic (#3)
+ \ifx\psk@PlotDerivative\@none\else
+ \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat
+ \fi\space
+ tx@AlgToPs begin AlgToPs end cvx
+ \else { #3 } \fi def
+ \ifPst@VarStep
+ /StillZero 0 def /LastNonZeroStep dx def
+ /F2@pstplot tx@Derive begin (#3) (x) Derive (x) Derive end
+ \ifx\psk@PlotDerivative\@none\else
+ \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat
+ \fi\space
+ tx@AlgToPs begin AlgToPs end cvx def
+ %% computation of the tolerance defined by plotpoints
+ /epsilon12 \ifx\psk@VarStepEpsilon\@default tx@Derive begin F2@pstplot end dx 3 exp abs mul abs
+ \else\psk@VarStepEpsilon\space 12 mul \fi def
+ /ComputeStep {
+ dup 1e-4 lt
+ { pop StillZero 2 ge { LastNonZeroStep 2 mul } { LastNonZeroStep } ifelse /StillZero StillZero 1 add def }
+ { epsilon12 exch div 1 3 div exp /StillZero 0 def }
+ ifelse } bind def
+ \fi
/xy {% Adapted from \parametricplot@i
F@pstplot x \ifPst@algebraic RadtoDeg \fi PtoC
% #3 dup x cos mul exch x sin mul
@@ -2221,7 +2212,28 @@
/x #1 def
/x1 #2 def
/dx x1 x sub \psk@plotpoints div def
- /F@pstplot \ifPst@algebraic (#3) tx@addDict begin AlgParser end cvx \else { #3 } \fi def
+ /F@pstplot \ifPst@algebraic (#3)
+ \ifx\psk@PlotDerivative\@none\else
+ \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat
+ \fi\space
+ tx@AlgToPs begin AlgToPs end cvx
+ \else { #3 } \fi def
+ \ifPst@VarStep
+ /StillZero 0 def /LastNonZeroStep dx def
+ /F2@pstplot tx@Derive begin (#3) (x) Derive (x) Derive end
+ \ifx\psk@PlotDerivative\@none\else
+ \psk@PlotDerivative\space { (x) tx@Derive begin Derive end } repeat
+ \fi\space
+ tx@AlgToPs begin AlgToPs end cvx def
+ %% computation of the tolerance defined by plotpoints
+ /epsilon12 \ifx\psk@VarStepEpsilon\@default tx@Derive begin F2@pstplot end dx 3 exp abs mul abs
+ \else\psk@VarStepEpsilon\space 12 mul \fi def
+ /ComputeStep {
+ dup 1e-4 lt
+ { pop StillZero 2 ge { LastNonZeroStep 2 mul } { LastNonZeroStep } ifelse /StillZero StillZero 1 add def }
+ { epsilon12 exch div 1 3 div exp /StillZero 0 def }
+ ifelse } bind def
+ \fi
/xy {
x \pst@number\psxunit mul F@pstplot \pst@number\psyunit mul
% \ifPst@algebraic F@pstplot \else #3 \fi \pst@number\psyunit mul
@@ -2237,6 +2249,59 @@
\fi
\endgroup
\ignorespaces}
+%
+\def\psplot@ii{%
+ \ifPst@VarStep
+ \addto@pscode{%
+ mark xy \@nameuse{beginqp@\psplotstyle}
+ { F2@pstplot abs ComputeStep
+ x 2 copy add dup x1 gt {pop x1} if /x exch def F2@pstplot abs ComputeStep
+ /x 3 -1 roll def 2 copy gt { exch } if pop
+ /x x 3 -1 roll add dup x1 gt {pop x1} if def
+ xy \@nameuse{doqp@\psplotstyle}
+ x x1 eq { exit } if} loop}%
+ \else\pst@killglue%
+ \addto@pscode{%
+ xy \@nameuse{beginqp@\psplotstyle}
+ \ifx\psk@method\@varrkiv\else\psk@plotpoints 1 sub \fi {
+ /x x dx add \ifx\psk@method\@varrkiv dup x1 gt { pop x1 } if \fi def
+ xy \@nameuse{doqp@\psplotstyle}
+ \ifx\psk@method\@varrkiv x x1 eq { exit } if \fi
+ } \ifx\psk@method\@varrkiv loop\else repeat\fi
+ /x x1 def
+ xy \@nameuse{doqp@\psplotstyle}}%
+ \fi%
+ \@nameuse{endqp@\psplotstyle}}
+\def\psplot@iii{%
+ \ifPst@VarStep
+ \addto@pscode{%
+ /n 2 def
+ mark
+ { xy n 2 roll F2@pstplot abs
+ ComputeStep x 2 copy add dup x1 gt {pop x1} if
+ /x exch def F2@pstplot abs ComputeStep
+ /x 3 -1 roll def 2 copy gt { exch } if pop
+ /x x 3 -1 roll dup /LastNonZeroStep exch def add dup x1 gt {pop x1} if def /n n 2 add def
+ x x1 eq { exit } if } loop
+ xy n 2 roll}%
+ \else\pst@killglue%
+ \addto@pscode{%
+ mark
+ /n 2 def
+ \ifx\psk@method\@varrkiv\else\psk@plotpoints\fi {
+ xy
+ n 2 roll
+ /n n 2 add def
+ /x x dx add \ifx\psk@method\@varrkiv dup x1 gt { pop x1 } if \fi def
+ \ifx\psk@method\@varrkiv x x1 eq { exit } if \fi
+ } \ifx\psk@method\@varrkiv loop\else repeat\fi
+ /x x1 def
+ xy
+ n 2 roll}%
+ \fi%
+ \@nameuse{endplot@\psplotstyle}}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\parametricplot@i#1#2#3{%
\pst@killglue%
\begingroup
@@ -2247,7 +2312,30 @@
/t #1 def
/t1 #2 def
/dt t1 t sub \psk@plotpoints div def
- \ifPst@algebraic/F@pstplot (#3) tx@addDict begin AlgParser end cvx def \fi
+ /F@pstplot \ifPst@algebraic (#3)
+ \ifx\psk@PlotDerivative\@none\else
+ \psk@PlotDerivative\space { (t) tx@Derive begin Derive end } repeat
+ \fi\space
+ tx@AlgToPs begin AlgToPs end cvx
+ \else { #3 } \fi def
+ \ifPst@VarStep
+ /StillZero 0 def /LastNonZeroStep dt def
+ /F2@pstplot tx@Derive begin (#3) (t) Derive (t) Derive end
+ \ifx\psk@PlotDerivative\@none\else
+ \psk@PlotDerivative\space { (t) tx@Derive begin Derive end } repeat
+ \fi\space
+ tx@AlgToPs begin AlgToPs end cvx def
+ %% computation of the tolerance defined by plotpoints
+ /epsilon12 \ifx\psk@VarStepEpsilon\@default
+ tx@Derive begin F2@pstplot end Pyth
+ dt 3 exp abs mul
+ \else\psk@VarStepEpsilon\space 12 mul \fi def
+ /ComputeStep {
+ dup 1e-4 lt
+ { pop StillZero 2 ge { LastNonZeroStep 2 mul } { LastNonZeroStep } ifelse /StillZero StillZero 1 add def }
+ { epsilon12 exch div 1 3 div exp /StillZero 0 def }
+ ifelse } bind def
+ \fi
/xy {
\ifPst@algebraic F@pstplot \else #3 \fi
\pst@number\psyunit mul exch
@@ -2263,8 +2351,56 @@
\fi
\endgroup
\ignorespaces}
+\def\parametricplot@ii{%
+ \ifPst@VarStep
+ \addto@pscode{%
+ mark xy \@nameuse{beginqp@\psplotstyle}
+ { F2@pstplot Pyth ComputeStep
+ t 2 copy add dup t1 gt {pop t1} if /t exch def F2@pstplot Pyth ComputeStep
+ /t 3 -1 roll def 2 copy gt { exch } if pop
+ /t t 3 -1 roll add dup t1 gt {pop t1} if def
+ xy \@nameuse{doqp@\psplotstyle}
+ t t1 eq { exit } if } loop}%
+ \else\pst@killglue%
+ \addto@pscode{%
+ xy \@nameuse{beginqp@\psplotstyle}
+ \psk@plotpoints 1 sub {
+ /t t dt add def
+ xy \@nameuse{doqp@\psplotstyle}
+ } repeat
+ /t t1 def
+ xy \@nameuse{doqp@\psplotstyle}}%
+ \fi%
+ \@nameuse{endqp@\psplotstyle}}
+\def\parametricplot@iii{%
+ \ifPst@VarStep
+ \addto@pscode{%
+ /n 2 def
+ mark
+ { xy n 2 roll F2@pstplot Pyth
+ ComputeStep t 2 copy add dup t1 gt {pop t1} if
+ /t exch def F2@pstplot Pyth ComputeStep
+ /t 3 -1 roll def 2 copy gt { exch } if pop
+ /t t 3 -1 roll dup /LastNonZeroStep exch def add dup t1 gt {pop t1} if def /n n 2 add def
+ t t1 eq { exit } if } loop
+ xy n 2 roll}%
+ \else\pst@killglue%
+ \addto@pscode{%
+ mark
+ /n 2 def
+ \psk@plotpoints {
+ xy
+ n 2 roll
+ /n n 2 add def
+ /t t dt add def
+ } repeat
+ /t t1 def
+ xy
+ n 2 roll}%
+ \fi%
+ \@nameuse{endplot@\psplotstyle}}
%
-\define@key[psset]{}{barwidth}{\pst@getlength{#1}\psk@barwidth}
+\define@key[psset]{pstricks-add}{barwidth}{\pst@getlength{#1}\psk@barwidth}
%\psset{barwidth=0.25cm}
%
\def\psbar@ii{\addto@pscode{false \tx@NArray \psbar@iii}}
@@ -2284,7 +2420,69 @@
\end@SpecialObj%
}
%
-\define@key[psset]{}{Derive}{\def\psk@Derive{#1}}%
+\define@key[psset]{pstricks-add}{StepType}{\pst@expandafter\psset@@StepType{#1}\@nil}%
+\def\psset@@StepType#1#2\@nil{%
+ \ifx#1u\let\psk@StepType\@ne
+ \else\ifx#1l\let\psk@StepType\z@\else\let\psk@StepType\tw@\fi\fi}
+\psset{StepType=lower} % alternative StepType=upper StepType=Riemann
+%
+\def\psStep{\pst@object{psStep}}
+\def\psStep@i(#1,#2)#3#4{%
+ \begin@ClosedObj%
+ \addto@pscode{
+ \ifPst@algebraic /Func (#4) tx@addDict begin AlgParser end cvx def \fi
+ /x #1 def
+ /dx #2 #1 sub #3 div def
+ /scx { \pst@number\psxunit mul } def
+ /scy { \pst@number\psyunit mul } def
+ \ifcase\psk@StepType % 0->lower
+ x scx 0 moveto
+ #3 {
+ \ifPst@algebraic Func \else #4 \fi scy dup x scx exch lineto
+ /x x dx add def
+ x scx exch lineto x scx 0 lineto
+ } repeat
+ \or % 1-> upper
+ x scx 0 moveto
+ #3 {
+ /x x dx add def
+ \ifPst@algebraic Func \else #4 \fi scy dup x dx sub scx exch lineto
+ x scx exch lineto x scx 0 lineto
+ } repeat
+ \or % 2-> Riemann
+ /eps3 100 def
+ /xMinMax [] def
+ /AMax [] def
+ /AMin [] def
+ /dt dx eps3 div def
+ #3 {
+ /Max \ifPst@algebraic Func \else #4 \fi def
+ /Min Max def
+ /t x def % save x value
+ eps3 {
+ \ifPst@algebraic Func \else #4 \fi
+ dup
+ Max lt { /Max exch def } { dup Min gt { /Min exch def }{ pop } ifelse } ifelse
+ /x x dt add def
+ } repeat
+ /x t def % restore
+ x scx Min scy Max scy xMinMax aload length 3 add array astore /xMinMax exch def
+ /x x dx add def
+ } repeat
+ /dx dx scx def
+ xMinMax aload length 3 div cvi {
+ /yMax ED /yMin ED /x ED
+ x yMin moveto dx 0 rlineto x dx add yMax lineto
+ dx neg 0 rlineto x yMin lineto } repeat
+ \fi
+ }%
+ \psk@fillstyle
+ \pst@stroke
+ \end@ClosedObj%
+}
+%
+\define@key[psset]{pstricks-add}{Derive}{\def\psk@Derive{#1}}%
+\def\@NOTEMPTY{NOT@EMPTY}%%dr 0606
%
%% #1 : x value
%% #2 : delta x
@@ -2294,18 +2492,28 @@
\begin@OpenObj%
% \let\pst@linetype\pst@arrowtype%
% \pst@addarrowdef%
+ \ifx\psk@Derive\@empty\ifPst@algebraic\psset{Derive=NOT@EMPTY}\fi\fi%%dr 0606
\addto@pscode{
gsave % save current state
/F@pstplot \ifPst@algebraic (#3) tx@addDict begin AlgParser end cvx \else { #3 } \fi def % define function
- \ifx\psk@Derive\@empty\else
+ \ifx\psk@Derive\@empty\else
+ \ifx\psk@Derive\@NOTEMPTY\else%%dr 0606
/FDer@pstplot % do we have a derivation defined?
\ifPst@algebraic (\psk@Derive) tx@addDict begin AlgParser end cvx \else { \psk@Derive } \fi def % define derivation
+ \fi%%dr 0606
\fi
+ /@parametric false def %%dr 0606
% first we calculate the origin
#1 dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
- { /y ED /x ED } % if yes, then we have 2 values
- { \ifpolarplot x \ifPst@algebraic RadtoDeg \fi PtoC /y ED /x ED \else /y ED \fi } ifelse
+ %%{ /y ED /x ED } % if yes, then we have 2 values
+ { /y ED /x ED /@parametric true def } % if yes, then we have 2 values%%dr 0606
+ { \ifPst@polarplot x \ifPst@algebraic RadtoDeg \fi PtoC /y ED /x ED \else /y ED \fi } ifelse
cleartomark
+ \ifx\psk@Derive\@NOTEMPTY%%begin dr 0606
+ %% algebraic we can use the derivative machine
+ /FDer@pstplot (#3) @parametric { (t) } { (x) } ifelse
+ tx@Derive begin Derive end tx@addDict begin AlgParser end cvx def
+ \fi%%end dr 0606
x \pst@number\psxunit mul y \pst@number\psyunit mul
translate % define the temporary origin
% now we calculate the slope of the tangent
@@ -2313,24 +2521,24 @@
#1 abs 1.0e-6 lt % no, we choose secant for the tangent
{ #1 0.0005 add dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
{ /y2 ED /x2 ED } % we have 2 values
- { \ifpolarplot dup x \ifPst@algebraic RadtoDeg \fi
+ { \ifPst@polarplot dup x \ifPst@algebraic RadtoDeg \fi
cos mul /x2 ED x \ifPst@algebraic RadtoDeg \fi sin mul \else /x2 x def \fi /y2 ED } ifelse
cleartomark % delete the mark
#1 0.0005 sub dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
{ /y1 ED /x1 ED }
- { \ifpolarplot dup x \ifPst@algebraic RadtoDeg \fi
+ { \ifPst@polarplot dup x \ifPst@algebraic RadtoDeg \fi
cos mul /x1 ED x \ifPst@algebraic RadtoDeg \fi sin mul \else /x1 x def \fi /y1 ED } ifelse
cleartomark
y2 y1 sub x2 x1 sub } % dy dx
{ % > 1.0e-06
#1 1.0005 mul dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
{ /y2 ED /x2 ED } % we have 2 values
- { \ifpolarplot dup x \ifPst@algebraic RadtoDeg \fi
+ { \ifPst@polarplot dup x \ifPst@algebraic RadtoDeg \fi
cos mul /x2 ED x \ifPst@algebraic RadtoDeg \fi sin mul \else /x2 x def \fi /y2 ED } ifelse
cleartomark
#1 .9995 mul dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
{ /y1 ED /x1 ED } % we have 2 values
- { \ifpolarplot dup x \ifPst@algebraic RadtoDeg \fi
+ { \ifPst@polarplot dup x \ifPst@algebraic RadtoDeg \fi
cos mul /x1 ED x \ifPst@algebraic RadtoDeg \fi sin mul \else /x1 x def \fi /y1 ED } ifelse
cleartomark
y2 y1 sub \pst@number\psyunit mul x2 x1 sub \pst@number\psxunit mul } ifelse
@@ -2338,7 +2546,7 @@
\else % there is a derivation defined
#1 dup /x ED /t ED tx@addDict begin mark FDer@pstplot end counttomark 1 gt % test, if we have parametricplot
{ /y ED /x ED }
- { \ifpolarplot /Fphi ED % the value F'(phi)
+ { \ifPst@polarplot /Fphi ED % the value F'(phi)
tx@addDict begin F@pstplot end x \ifPst@algebraic RadtoDeg \fi PtoC /y0 ED /x0 ED % the x y values
x \ifPst@algebraic RadtoDeg \fi sin Fphi mul x0 add /y ED
x \ifPst@algebraic RadtoDeg \fi cos Fphi mul y0 sub /x ED
@@ -2364,7 +2572,7 @@
\psk@dotsize
\@nameuse{psds@\psk@dotstyle}%
0 0 Dot
- \fi
+ \fi
grestore % restore old graphics state
}%
\use@pscode % part of \end@OpenObj
@@ -2372,21 +2580,12 @@
\ignorespaces% % part of \end@OpenObj
}%
%
-\define@key[psset]{}{method}{\def\psk@method{#1}}% adams - rk4
-\define@key[psset]{}{whichabs}{\def\psk@whichabs{#1}}%
-\define@key[psset]{}{whichord}{\def\psk@whichord{#1}}%
-\define@key[psset]{}{plotfuncx}{\def\psk@plotfuncx{#1}}%
-\define@key[psset]{}{plotfuncy}{\def\psk@plotfuncy{#1}}%
-\define@key[psset]{}{expression}{\def\psk@expression{#1}}%
-\newif\ifPst@buildvector%
-\define@key[psset]{}{buildvector}[true]{\@nameuse{Pst@buildvector#1}}%
-\def\@rkiv{rk4}% Runge-Kutta 4 method
-\def\@adams{adams}% Adams method
-%
+\def\@varrkiv{varrkiv}% Runge-Kutta 4 with an adaptive step method
%% #1-#2 x range
%% #3 initial value of y (which is a vector) y(0) y'(0) y''(0) ...
%% #4 value of the derivative (y and t can be used)
-\def\psplotDiffEqn{\def\pst@par{}\pst@object{psplotDiffEqn}}% initial code by Dominique 2005-05-21
+%
+\def\psplotDiffEqn{\pst@object{psplotDiffEqn}}% initial code by Dominique 2005-05-21
\def\psplotDiffEqn@i#1#2#3#4{%
\pst@killglue%
\begingroup%
@@ -2397,91 +2596,156 @@
/x1 #2 def % last value
/y [ #3 ] def % values for t=0
/ylength y length def % number of elements in #3
- /addvect {
- 1 1 ylength {
- /i exch def
- ylength i sub 2 add -1 roll add ylength 2 mul i sub 1 roll
- } for
+ /addvect {
+ 1 1 ylength {
+ /i exch def
+ ylength i sub 2 add -1 roll add ylength 2 mul i sub 1 roll
+ } for
} def
/dx x1 x sub \psk@plotpoints\space div def
- /mulvect {
- ylength exch
- 1 index {
- dup 4 -1 roll mul 2 index 2 add 1 roll
- } repeat
+ /mulvect {
+ ylength exch
+ 1 index {
+ dup 4 -1 roll mul 2 index 2 add 1 roll
+ } repeat
pop pop } def
/divvect { ylength exch 1 index { dup 4 -1 roll exch div 2 index 2 add 1 roll } repeat pop pop } def
/k0 0 def /k1 0 def /k2 0 def /k3 0 def
\ifPst@algebraic /F@pstplot (#4) tx@addDict begin AlgParser end cvx def \fi
- /Func {
- \ifPst@algebraic F@pstplot ylength array astore
+ /Func {
+ \ifPst@algebraic F@pstplot ylength array astore
\else
\ifPst@buildvector\else y aload pop \fi #4
\ifPst@buildvector\else ylength array astore \fi
\fi
} def
- \ifx\psk@method\@adams /F1 0 def /F2 0 def /F3 0 def /F4 0 def /F5 0 def /F6 0 def /INIT 0 def \fi
- \ifx\psk@method\@empty\else %% RUNGE-KUTTA & ADAMS methods
- /RK {
- /k0 Func { dx mul } forall ylength array astore def %% y
- dup aload pop k0 { 2 div } forall addvect ylength array astore /y exch def %
- x dup dx 2 div add /x exch def %% y x
- /k1 Func { dx mul } forall ylength array astore def %% y x
- exch dup aload pop k1 { 2 div } forall addvect y astore pop %% x y
- /k2 Func { dx mul } forall ylength array astore def %% x y
- dup aload pop k2 aload pop addvect y astore pop exch dup dx add /x exch def %% y x
- /k3 Func { dx mul } forall ylength array astore def %% y x
- /x exch def %% y
- dup aload pop k0 aload pop k1 aload pop k2 aload pop addvect
- 2 mulvect addvect k3 aload pop addvect
- 6 divvect addvect y astore pop
- } def
- \ifx\psk@method\@adams
- /ADAMS {
- %% ORDRE 4
- %% F4 aload pop 55 mulvect
- %% F3 aload pop -59 mulvect addvect
- %% F2 aload pop 37 mulvect addvect
- %% F1 aload pop -9 mulvect addvect
- %% dx mulvect 24 divvect
- %% ORDRE 5
- %% F5 aload pop 1901 mulvect
- %% F4 aload pop -2774 mulvect addvect
- %% F3 aload pop 2616 mulvect addvect
- %% F2 aload pop -1274 mulvect addvect
- %% F1 aload pop 251 mulvect addvect
- %% dx mulvect 720 divvect
- %% ORDRE 6
- F6 aload pop 4277 mulvect
- F5 aload pop -7923 mulvect addvect
- F4 aload pop 9982 mulvect addvect
- F3 aload pop -7298 mulvect addvect
- F2 aload pop 2877 mulvect addvect
- F1 aload pop -475 mulvect addvect
- dx mulvect 1440 divvect
- y aload pop addvect ylength array astore /y exch def } def
- \fi
+ \ifx\psk@method\@adams /F1 0 def /F2 0 def /F3 0 def /F4 0 def /F5 0 def /F6 0 def /INIT 1 def \fi
+ \ifx\psk@method\@empty\else
+ \ifx\psk@method\@varrkiv %% RUNGE-KUTTA method with var step algorithm
+ /VarStep false def /VarStepRatio 1 def
+ /RK {
+ /k0 Func { dx mul } forall ylength array astore def %% y
+ dup aload pop k0 { 2 div } forall addvect ylength array astore /y exch def %
+ x dup dx 2 div add /x exch def %% y x
+ /k1 Func { dx mul } forall ylength array astore def %% y x
+ exch dup aload pop k1 { 2 div } forall addvect y astore pop %% x y
+ /k2 Func { dx mul } forall ylength array astore def %% x y
+ dup aload pop k2 aload pop addvect y astore pop exch dup dx add /x exch def %% y x
+ /k3 Func { dx mul } forall ylength array astore def %% y x
+ /x exch def %% y
+ dup aload pop k0 aload pop k1 aload pop k2 aload pop addvect
+ 2 mulvect addvect k3 aload pop addvect
+ 6 divvect addvect y astore
+ } def
+ /VARRK {
+ VarStep
+ %{ /dx dx \psk@varstepincrease\space mul def /VarStep false def } if
+ { /dx dx VarStepRatio mul def /VarStep false def } if
+ x dx add x1 gt { /dx x1 x sub def } if
+ %{ /dx dx \psk@varstepdecrease\space div def } ifelse
+ %% we compute y(x+dx) from y(x) using RK4
+ RK %% y(x) y(x+dx)
+ exch /y exch def /dx dx 2 div def
+ { %% we compute y(x+dx/2) from y(x) using RK4
+ y RK %% y(x+dx) y(x+dx/2)
+ %% then y(x+dx) from y(x+dx/2) using RK4
+ /y exch def y RK %% y(x+dx) y(x) y(x+dx/2) y(x+dx)
+ dup aload pop 4 ylength add -1 roll
+ { -1 mul } forall addvect 0 ylength { exch abs 2 copy lt { exch } if pop } repeat
+ 0 3 -1 roll {abs 2 copy lt { exch } if pop } forall
+ dup 1e-6 lt { pop } { div } ifelse
+ /dx dx 2 mul def
+ dup \psk@varsteptol\space lt
+ %{ \psk@varsteptol\space div .1 lt { /VarStep true def } if pop exit } if
+ %pop /dx dx 4 div def exch /y exch def } loop
+ { .001 div dup .1 lt
+ { dup 1e-6 lt { pop 3 } { log neg } ifelse /VarStepRatio exch def /VarStep true def }
+ { pop } ifelse pop exit } if
+ pop /dx dx 4 div def exch /y exch def } loop
+ } def
+ \else %% RUNGE-KUTTA & ADAMS methods
+ /RK {
+ /k0 Func { dx mul } forall ylength array astore def %% y
+ dup aload pop k0 { 2 div } forall addvect ylength array astore /y exch def %
+ x dup dx 2 div add /x exch def %% y x
+ /k1 Func { dx mul } forall ylength array astore def %% y x
+ exch dup aload pop k1 { 2 div } forall addvect y astore pop %% x y
+ /k2 Func { dx mul } forall ylength array astore def %% x y
+ dup aload pop k2 aload pop addvect y astore pop exch dup dx add /x exch def %% y x
+ /k3 Func { dx mul } forall ylength array astore def %% y x
+ /x exch def %% y
+ dup aload pop k0 aload pop k1 aload pop k2 aload pop addvect
+ 2 mulvect addvect k3 aload pop addvect
+ 6 divvect addvect y astore pop
+ } def
+ \ifx\psk@method\@adams
+ /ADAMS {
+ \ifcase\psk@adamsorder
+ \errmessage{pstricks-add error: no order 0th for adams method (see user's manual)}
+ \or\errmessage{pstricks-add error: no order 1st for adams method (see user's manual)}
+ \or\errmessage{pstricks-add error: no order 2nd for adams method (see user's manual)}
+ \or\errmessage{pstricks-add error: no order 3rd for adams method (see user's manual)}
+ \or
+ %% ORDRE 4
+ F4 aload pop 55 mulvect
+ F3 aload pop -59 mulvect addvect
+ F2 aload pop 37 mulvect addvect
+ F1 aload pop -9 mulvect addvect
+ dx mulvect 24 divvect
+ \or
+ %% ORDRE 5
+ F5 aload pop 1901 mulvect
+ F4 aload pop -2774 mulvect addvect
+ F3 aload pop 2616 mulvect addvect
+ F2 aload pop -1274 mulvect addvect
+ F1 aload pop 251 mulvect addvect
+ dx mulvect 720 divvect
+ \or
+ %% ORDRE 6
+ F6 aload pop 4277 mulvect
+ F5 aload pop -7923 mulvect addvect
+ F4 aload pop 9982 mulvect addvect
+ F3 aload pop -7298 mulvect addvect
+ F2 aload pop 2877 mulvect addvect
+ F1 aload pop -475 mulvect addvect
+ dx mulvect 1440 divvect
+ \fi
+ y aload pop addvect ylength array astore /y exch def } def
+ \fi
+ \fi
\fi
/xy {
\ifx\psk@plotfuncx\@empty
\ifx\psk@whichabs\@empty x \else y \psk@whichabs\space get \fi
- \else \psk@plotfuncx\space \fi
+ \else \psk@plotfuncx\space \fi
\pst@number\psxunit mul y
\ifx\psk@method\@empty %% EULER method
/y Func { dx mul } forall y aload pop addvect ylength array astore def
\else%
- \ifx\psk@method\@rkiv %% RUNGE-KUTTA method
+ \ifx\psk@method\@varrkiv %% RUNGE-KUTTA method
+ VARRK
+ \else\ifx\psk@method\@rkiv %% RUNGE-KUTTA method
RK
- \else %% ADAMS method
- /F1 F2 def /F2 F3 def /F3 F4 def /F4 F5 def /F5 F6 def /F6 Func def
- INIT 5 lt
- { RK /INIT INIT 1 add def }
- { ADAMS } ifelse
- \fi
+ \else
+ /F1 F2 def /F2 F3 def /F3 F4 def /F4 %% ADAMS method
+ \ifcase\psk@adamsorder\or\or\or\or
+ %% ORDRE 4
+ Func def
+ \or
+ %% ORDRE 5
+ F5 def /F5 Func def
+ \or
+ %% ORDRE 6
+ F5 def /F5 F6 def /F6 Func def
+ \fi
+ INIT \psk@adamsorder\space lt
+ { RK /INIT INIT 1 add def }
+ { ADAMS } ifelse
+ \fi\fi
\fi
- \ifx\psk@plotfuncy\@empty
+ \ifx\psk@plotfuncy\@empty
\ifx\psk@whichord\@empty 0 \else \psk@whichord\space \fi get %
- \else \psk@plotfuncy\space \fi
+ \else \psk@plotfuncy\space \fi
\pst@number\psyunit mul
} def
}%
@@ -2493,9 +2757,10 @@
\ignorespaces%
}
%
+%
\def\psGTriangle{\pst@object{psGTriangle}}
\def\psGTriangle@i(#1)(#2)(#3)#4#5#6{{%
- \def\solid@star{}
+ \def\solid@star{}%
\begin@ClosedObj
\pst@getcoor{#1}\pst@tempA% A: "rgb xr xg xb" or "gray xg"
\pst@getcoor{#2}\pst@tempB% B
@@ -2520,10 +2785,63 @@
\end@ClosedObj%
}}
%
+\define@key[psset]{pstricks-add}{dicescale}{\def\psk@dicescale{#1}}
+\def\psdice{\pst@object{psdice}}
+\def\psdice@i#1{{%
+ \pst@killglue
+ \psset{framearc=0.3,linewidth=1pt,dicescale=1.0}%
+ \use@par%
+ \psscalebox{\psk@dicescale}{%
+ \psframe(-0.5,-0.5)(0.5,0.5)%
+ \ifcase#1%
+ \or\qdisk(0,0){3pt}%
+ \or\qdisk(-0.3,-0.3){3pt}\qdisk(0.3,0.3){3pt}%
+ \or\psdice@i{1}\psdice@i{2}%
+ \or\qdisk(-0.3,0.3){3pt}\qdisk(-0.3,-0.3){3pt}%
+ \qdisk(0.3,0.3){3pt}\qdisk(0.3,-0.3){3pt}%
+ \or\psdice@i{1}\psdice@i{4}%
+ \or\psdice@i{4}\qdisk(-0.3,0){3pt}\qdisk(0.3,0){3pt}%
+ \fi}%
+ \ignorespaces%
+}}
+%
+% the datafile must be a matrix with
+% /dotmatrix [
+% .....
+% .....
+% ] def
+%
+\def\psMatrixPlot{\pst@object{psMatrixPlot}}
+\def\psMatrixPlot@i#1#2#3{%
+ \pst@killglue
+ \begingroup
+ \begin@SpecialObj%
+ \addto@pscode{
+ (#3) run % load the data file
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle} %
+ /n 0 def % index for element
+ 1 1 #1 { % the y loop (outer one)
+ /y exch def % save y
+ 1 1 #2 { % the x loop (inner one)
+ /x exch def % save x
+ dotmatrix n get % get value from matrix
+ dup 0 gt { % test if > 0
+ x \pst@number\psxunit mul
+ \ifPst@ChangeOrder #1 y sub 1 add \else y \fi \pst@number\psyunit mul Dot%
+ } { pop } ifelse
+ /n n 1 add def
+ } for
+ } for
+ }%
+ \end@SpecialObj%
+ \endgroup%
+ \ignorespaces%
+}
+%
\def\resetOptions{%
\@zero=0%
-% \def\pshlabel##1{$##1$}%
-% \def\psvlabel##1{$##1$}%
+ \def\pst@linetype{0}%
\psset{%
%%%% pstricks %%%%%%%%
unit=1cm,%
@@ -2550,7 +2868,7 @@
ArrowFill=true,%
ArrowInside={},ArrowInsidePos=0.5,%
ArrowInsideNo=1,ArrowInsideOffset=0,%
- liftpen=0, linetype=0,%
+ liftpen=0, linetype=0,%
gangle=0,%
curvature=1 .1 0,%
dotsize=2pt 2,%
@@ -2567,9 +2885,13 @@
arcsep=0,radius=.25cm,%
ref=c,rot=0,labelsep=5pt,refangle=0,%
intSeparator={,},%
+ dicescale=1.0,%
%%%%%%%%% pst-plot %%%%%%%%%%%%%
+ labelFontSize={},%
+ StepType=lower, % alternative SumType=upper
plotstyle=line,plotpoints=50,%
- ticksize=-4pt 4pt,tickstyle=full,ticks=all,%
+ ticksize=-4pt 4pt,
+ tickstyle=full, ticks=all,%
subticksize=0.75,subticks=1,tickcolor=black,%
ticklinestyle=solid,subticklinestyle=solid,%
subtickcolor=gray,%
@@ -2582,11 +2904,9 @@
braceWidth=0.35,bracePos=0.5,%
arrowscale=1,%
dashColorI=black,dashColorII=red,dashNo=0.2,linecap=0,%
- wBegin=\pslinewidth, wEnd=\pslinewidth,%
xyAxes=true,%
- trigLabels=false,%
+ trigLabels=false,trigLabelBase=0,%
xDecimals={},yDecimals={},%
-% xLabel={},yLabel={},%
xlogBase={},ylogBase={},%
logLines=none,%
ignoreLines=0,%
@@ -2599,8 +2919,10 @@
randomPoints=1000,color=false,%
method={},whichabs={},whichord={},%
plotfuncx={},plotfuncy={},buildvector=false,algebraic=false,
- Derive={},%
-%%%%%%%%% pst-node %%%%%%%%%%
+ Derive={},adamsorder=4,%
+ VarStep=false, PlotDerivative=none, VarStepEpsilon=default,%
+ varsteptol=.001,%
+ %%%%%%%%% pst-node %%%%%%%%%%
lineAngle=0,%
nodealign=false,%
href=0,%
@@ -2620,11 +2942,10 @@
shortput=none,%
colsep=1.5cm,%
rowsep=1.5cm,%
-% shortput=tablr,%%
mcol=c,%
mnode=R,%
- emnode=none}
-}
+ emnode=none
+}}
%
\resetOptions
%
@@ -2632,3 +2953,4 @@
%
%% END: pstricks-add.tex
\endinput
+
diff --git a/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty b/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty
index 7be339274d0..3c9e52ce789 100644
--- a/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty
+++ b/Master/texmf-dist/tex/latex/pstricks-add/pstricks-add.sty
@@ -4,6 +4,7 @@
\input{pstricks-add.tex}
\ProvidesFile{pstricks-add.tex}
[\filedate\space v\fileversion\space `PSTricks-add' (hv)]
+\IfFileExists{pstricks-add.pro}{\@addtofilelist{pstricks-add.pro}}{}%
\InputIfFileExists{pstricks-add.cfg}{%
\PackageInfo{pstricks-add}{Local config file pstricks-add.cfg used}
}{}
diff --git a/Master/texmf-dist/tpm/pstricks-add.tpm b/Master/texmf-dist/tpm/pstricks-add.tpm
index dbb3e49ab31..4fef559965a 100644
--- a/Master/texmf-dist/tpm/pstricks-add.tpm
+++ b/Master/texmf-dist/tpm/pstricks-add.tpm
@@ -3,7 +3,7 @@
<rdf:Description about="http://texlive.dante.de/texlive/Package/pstricks-add.zip">
<TPM:Name>pstricks-add</TPM:Name>
<TPM:Type>Package</TPM:Type>
- <TPM:Date>2006/01/09 00:56:57</TPM:Date>
+ <TPM:Date>2006/06/17 12:21:15</TPM:Date>
<TPM:Version>1.0</TPM:Version>
<TPM:Creator>rahtz</TPM:Creator>
<TPM:Title>
@@ -23,13 +23,13 @@ pst-plot, pst-node, pst-tree and pst-grad.
<TPM:Author>Herbert Voss</TPM:Author>
<TPM:Size>1906625</TPM:Size>
<TPM:Build/>
- <TPM:RunFiles size="114631">
+ <TPM:RunFiles size="138951">
texmf-dist/dvips/pstricks-add/pstricks-add.pro
texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
texmf-dist/tex/latex/pstricks-add/pstricks-add.sty
texmf-dist/tpm/pstricks-add.tpm
</TPM:RunFiles>
- <TPM:DocFiles size="1791994">
+ <TPM:DocFiles size="1868740">
texmf-dist/doc/generic/pstricks-add/Changes
texmf-dist/doc/generic/pstricks-add/README
texmf-dist/doc/generic/pstricks-add/examples/12-1.txt
@@ -47,10 +47,10 @@ texmf-dist/doc/generic/pstricks-add/examples/dataII.dat
texmf-dist/doc/generic/pstricks-add/examples/dataMul.dat
texmf-dist/doc/generic/pstricks-add/examples/doppellog.pdf
texmf-dist/doc/generic/pstricks-add/examples/doppellog.tex
+texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib
texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.ltx
texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
-texmf-dist/doc/generic/pstricks-add/pstricks.bib
</TPM:DocFiles>
<TPM:Provides>Package/pstricks-add</TPM:Provides>
</rdf:Description>
diff --git a/Master/texmf/lists/pstricks-add b/Master/texmf/lists/pstricks-add
index 30b1b888f52..fdc6f727f7a 100644
--- a/Master/texmf/lists/pstricks-add
+++ b/Master/texmf/lists/pstricks-add
@@ -15,10 +15,10 @@ texmf-dist/doc/generic/pstricks-add/examples/dataII.dat
texmf-dist/doc/generic/pstricks-add/examples/dataMul.dat
texmf-dist/doc/generic/pstricks-add/examples/doppellog.pdf
texmf-dist/doc/generic/pstricks-add/examples/doppellog.tex
+texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.bib
texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.ltx
texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdf
texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
-texmf-dist/doc/generic/pstricks-add/pstricks.bib
texmf-dist/dvips/pstricks-add/pstricks-add.pro
texmf-dist/tex/generic/pstricks-add/pstricks-add.tex