summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-17 22:38:58 +0000
committerKarl Berry <karl@freefriends.org>2009-05-17 22:38:58 +0000
commit249444f732b68d762005367d91ff6f4717d86301 (patch)
treeac74b8881616adaa082721c36f816f8f05b34825
parent3ae3e7426f883c549a427ed3940e3beb8a40ea78 (diff)
pstricks-add 3.32 (13may09)
git-svn-id: svn://tug.org/texlive/trunk@13185 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/Changes7
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.pdfbin2127836 -> 2136440 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex41
-rw-r--r--Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex103
4 files changed, 118 insertions, 33 deletions
diff --git a/Master/texmf-dist/doc/generic/pstricks-add/Changes b/Master/texmf-dist/doc/generic/pstricks-add/Changes
index 9b52ca56881..428a54f158f 100644
--- a/Master/texmf-dist/doc/generic/pstricks-add/Changes
+++ b/Master/texmf-dist/doc/generic/pstricks-add/Changes
@@ -1,4 +1,4 @@
-%% $Id: Changes 114 2009-04-24 19:25:37Z herbert $
+%% $Id: Changes 115 2009-04-29 08:19:40Z herbert $
%%
pstricks-add.pro -----------
v 0.22 2009-03-17 - add LineByHand stuff
@@ -36,7 +36,10 @@ pstricks-add.sty ----------- (hv)
pstricks-add.tex ----------- (Dominik Rodriguez/hv)
- v 3.31 2009-04-24 - added \pstFPDiv for division int(#1=#2/#3)
+ v 3.32 2009-05-11 - added psTangentLine for a curve of three points
+ Tnormal option is valid
+ - load pst-math for equation solver
+ v 3.31 2009-04-29 - added \pstFPDiv for division int(#1=#2/#3)
- added axes style "polar" \psaxes[axesstyle=polar](5,5)
- fix trailing space with yAxisLabel
- added option decimalSeparator to allow special symbols
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 954c14cf845..ac831dfc841 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 b1408858a32..353adf55ae6 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
@@ -5135,6 +5135,7 @@ as for the x-axis.
\end{psgraph}
\end{center}
+\resetOptions
\begin{lstlisting}
\readdata{\data}{demo1.data}
\pstScalePoints(1,0.000001){}{}% (x,y){additional x operator}{y op}
@@ -5175,6 +5176,7 @@ In the following example, the y unit gets the same value as the one for the x-ax
\listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\end{psgraph}
\end{center}
+\resetOptions
\begin{lstlisting}
\readdata{\data}{demo1.data}
@@ -5201,6 +5203,7 @@ In the following example, the y unit gets the same value as the one for the x-ax
%-----------------------------------------------------------------------------
+\resetOptions
\begin{center}
\readdata{\data}{demo1.data}
\pstScalePoints(1,0.2){}{log}
@@ -5210,6 +5213,9 @@ In the following example, the y unit gets the same value as the one for the x-ax
\endpsgraph
\end{center}
+
+
+
\begin{lstlisting}
\readdata{\data}{demo1.data}
\pstScalePoints(1,0.2){}{log}
@@ -5221,17 +5227,21 @@ In the following example, the y unit gets the same value as the one for the x-ax
%-----------------------------------------------------------------------------
+\resetOptions
\begin{LTXexample}[pos=t,preset=\centering]
\readdata{\data}{demo0.data}
\psset{lly=-0.75cm,ury=0.5cm}
\pstScalePoints(1,1){}{log}
\begin{psgraph}[arrows=->,Dx=0.5,ylogBase=10,Oy=-1,xsubticks=10,%
ysubticks=2](0,-3)(3,1){12cm}{4cm}
- \listplot[linecolor=red,linewidth=2pt,showpoints=true,plotstyle=LineToXAxis]{\data}
+ \psset{Oy=-2}% must be global
+ \listplot[linecolor=red,linewidth=2pt,showpoints=true,
+ plotstyle=LineToXAxis]{\data}
\end{psgraph}
\end{LTXexample}
+\resetOptions
\begin{LTXexample}[pos=t,preset=\centering]
\psset{lly=-0.75cm,ury=0.5cm}
\readdata{\data}{demo0.data}
@@ -5242,7 +5252,9 @@ In the following example, the y unit gets the same value as the one for the x-ax
\end{LTXexample}
+
%-----------------------------------------------------------------------------
+\resetOptions
\begin{center}
\readdata{\data}{demo2.data}%
\readdata{\dataII}{demo3.data}%
@@ -5270,6 +5282,7 @@ In the following example, the y unit gets the same value as the one for the x-ax
\end{lstlisting}
%-----------------------------------------------------------------------------
+\resetOptions
%\begin{LTXexample}[pos=t,preset=\centering]
\begin{center}
\readdata{\data}{demo2.data}%
@@ -5299,6 +5312,7 @@ In the following example, the y unit gets the same value as the one for the x-ax
%\newpage
An example with ticks on every side of the frame and filled areas:
+\resetOptions
\begin{center}
\def\data{0 0 1 4 1.5 1.75 2.25 4 2.75 7 3 9}
\psset{lly=-0.5cm}
@@ -5363,7 +5377,6 @@ can be outside the visible \Lenv{pspicture} environment
\medskip
\resetOptions
-
\begin{center}
\readdata{\data}{demo2.data}%
\readdata{\dataII}{demo3.data}%
@@ -5524,7 +5537,29 @@ the mathematical function in postfix or algebraic notation (with
\clearpage
%--------------------------------------------------------------------------------------
-\section{\nxLcs{psplotTangent} and option \nxLkeyword{Tnormal}}
+
+\section{Plotting tangent lines}
+There are two macros for plotting a tangent line or the tangent normal line.
+The first one is \Lcs{psTangentLine} which expects three pairs of coordinates,
+a $x$ and a $dx$ value. The second one is \Lcs{psplotTangent} which expects
+a function for the curve.
+
+\subsection{\nxLcs{psTangentLine} and option \nxLkeyword{Tnormal}}
+
+\begin{BDef}
+\Lcs{psTangentLine}\OptArgs\Largr{\coord1}\Largr{\coord2}\Largr{\coord3}\Largb{x}\Largb{dx}
+\end{BDef}
+
+\begin{LTXexample}[pos=t,preset=\centering,wide]
+\psset{unit=2}
+\begin{pspicture}[showgrid=true](1,-1)(4,1)
+ \pscurve[showpoints=true](2.1,-0.2)(2.5,0.2)(3.2,0.235)(3.8,-0.2)
+ \psTangentLine[Tnormal,arrows=->,linecolor=red](2.5,0.2)(3.2,0.235)(3.8,-0.2){3}{0.1}
+ \psTangentLine[arrows=<->,linecolor=blue](2.5,0.2)(3.2,0.235)(3.8,-0.2){3}{0.5}
+\end{pspicture}
+\end{LTXexample}
+
+\subsection{\nxLcs{psplotTangent} and option \nxLkeyword{Tnormal}}
%--------------------------------------------------------------------------------------
There is an additional option, named \Lkeyword{Derive} for an
alternative function (see following example) to calculate the
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 3fc77bf7dea..c81389f65b4 100644
--- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
+++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
@@ -29,9 +29,10 @@
\ifx\MultidoLoaded\endinput\else \input multido \fi
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
\ifx\PSTFPloaded\endinput\else \input pst-fp \fi
+\ifx\PSTmathLoaded\endinput\else \input pst-math \fi
%
-\def\fileversion{3.31}
-\def\filedate{2009/04/29}
+\def\fileversion{3.32}
+\def\filedate{2009/05/11}
\message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -40,6 +41,7 @@
%
%% prologue for postcript
\pstheader{pstricks-add.pro}%
+%\pstheader{pst-math.pro}% for equation solver
%\pstheader{pst-algparser.pro}% now done by pstricks.tex
%
%-------------------------------- pstricks ------------------------------------
@@ -1107,6 +1109,9 @@
\def\psGetNodeCenter#1{ tx@NodeDict begin /N@#1 load GetCenter end % x y on stack in system coor
\pst@number\psyunit div /#1.y ED % /#1.y in user coor
\pst@number\psxunit div /#1.x ED } % /#1.x in user coor
+\def\psGetNodeEdge#1{ tx@NodeDict begin /N@#1 load 1 GetEdge end % x y on stack in system coor
+ \pst@number\psyunit div /#1.y ED % /#1.y in user coor
+ \pst@number\psxunit div /#1.x ED } % /#1.x in user coor
%
\define@key[psset]{pstricks-add}{lineAngle}[0]{%
\ifdim#1pt=\z@\else\psset{armB=0.5}\fi
@@ -2383,6 +2388,7 @@
% xStep=0, yStep=0, xStart={}, xEnd={}, yStart={}, yEnd={}, comma=false,%
% plotNo=1,plotNoMax=1}%
%
+\iffalse
\def\pstScalePoints(#1,#2)#3#4{%
% xScale | yScale | xOperator | yOperator
% the operators can be any Postscript code
@@ -2392,16 +2398,18 @@
\def\pstYPSScale{#4 }%
\pst@def{ScalePoints}<%
/y ED /x ED
+ /yPSOp { #4 y mul #2 mul } def
+ /xPSOp { #3 x mul #1 mul } def
counttomark dup dup cvi eq not { exch pop } if
/m exch def /n m 2 div cvi def
n {
- #4\space y mul #2\space mul m 1 roll
- #3\space x mul #1\space mul m 1 roll
+ yPSOp m 1 roll xPSOp m 1 roll
/m m 2 sub
def } repeat>%
}
%\pstScalePoints(1,1){}{}% the default -> no special operators
%
+\fi
\def\listplot@ii#1{%
\@nameuse{beginplot@\psplotstyle}%
\addto@pscode{/D {} def mark}%
@@ -3154,6 +3162,41 @@
\psset[pstricks-add]{CMYK=true}
\def\@NOTEMPTY{NOT@EMPTY}%%dr 0606
%
+\def\psTangentLine{\pst@object{psTangentLine}}
+\def\psTangentLine@i(#1,#2)(#3,#4)(#5,#6)#7#8{%
+ \begin@OpenObj%
+ \addto@pscode{
+ [[#1 dup dup mul exch 1 #2]
+ [#3 dup dup mul exch 1 #4]
+ [#5 dup dup mul exch 1 #6]]
+ SolveLinEqSystem
+ /abc ED
+ abc aload pop % a b c on stack
+ exch #7 % a c b x
+ mul add exch % c+b*x a
+ #7 dup mul mul add % a*x^2+b*x+c
+ /y0 ED % save value
+ abc aload pop pop exch % b a
+ #7 mul 2 mul add % b+2*a*x0=mTan
+ \ifPST@Tnormal
+ neg 1 exch div % mOrth
+ #8 mul /dy ED % mOrth*dx
+ [
+ #7 #8 add y0 dy add \tx@ScreenCoor % x0+dx y0 +dy
+ #7 y0 \tx@ScreenCoor % x0 y0
+ \else
+ dup % mTan mTan
+ #8 mul /dy1 ED % mTan*dx
+ #8 neg mul /dy2 ED % mTan*-dx
+ [
+ #7 #8 add y0 dy1 add \tx@ScreenCoor % x0+dx y0 +dy1
+ #7 #8 sub y0 dy2 add \tx@ScreenCoor % x0-dx y0 +dy2
+ \fi
+ /Lineto /lineto load def
+ \ifshowpoints true \else false \fi
+ \tx@setlinejoin %
+ \tx@Line }%
+ \end@OpenObj\ignorespaces}
\def\psplotTangent@ii#1,#2,#3\@nil{%
\def\pst@tempLeft{#1}%
@@ -3688,7 +3731,7 @@
\define@key[psset]{pstricks-add}{chartNodeI}{\def\psk@chartNodeI{#1}}
\define@key[psset]{pstricks-add}{chartNodeO}{\def\psk@chartNodeO{#1}}
\psset[pstricks-add]{chartNodeI=0.75,chartNodeO=1.5}
-
+%
\def\psChart{\pst@object{psChart}}
\def\psChart@i#1#2#3{%
% #1:values #2:separated charts
@@ -3699,20 +3742,22 @@
\begingroup%
\def\psk@chartValues{#1}%
\def\psk@chartSepValues{#2}% only valid for a pie chart
- \pst@dimm=\z@% sum of all entries (for a pie)
- \pst@cnta=1% number of entries
- \pst@dimn=\z@% greatest entry
+ \pst@dimm=\z@\relax% sum of all entries (for a pie)
+ \pst@cnta=1\relax% number of entries
+ \pst@dimn=\z@\relax% greatest entry
\psforeach{\chart@tempA}{#1}{%
\global\advance\pst@cnta by \@ne% % no of entries
- \global\advance\pst@dimm by \chart@tempA pt% % sum of all entries
- \pst@dima=\chart@tempA pt%
- \ifdim\pst@dima>\pst@dimn \global\pst@dimn=\pst@dima\fi}%
+ \global\advance\pst@dimm by \chart@tempA\p@% % sum of all entries
+ \pst@dima=\chart@tempA\p@%
+ \ifdim\pst@dima>\pst@dimn\relax
+ \global\pst@dimn=\pst@dima\fi%
+ }%
\addbefore@par{dimen=outer}%
\begin@SpecialObj%
- \ifnum\psk@chartColor>0
+ \ifnum\psk@chartColor>0\relax
\chart@ColorStep=400\p@\else\chart@ColorStep=\p@\fi % the "numerical color"
\divide\chart@ColorStep by \pst@cnta% % step =1/no or 400/no
- \chart@ColorIndex=\psk@chartColor pt% % the start color (gray or wave)
+ \chart@ColorIndex=\psk@chartColor\p@% % the start color (gray or wave)
\@nameuse{pscs@\psk@chartStyle}%
\end@SpecialObj%
\endgroup%
@@ -3722,37 +3767,38 @@
\def\pscs@pie{%
\degrees[\pst@number\pst@dimm]% % instead of 360 degrees
\def\chart@alpha{0}%
- \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0%
- \global\chart@Toggle=1
+ \pst@dimm=\z@\pst@dimn=\z@\pst@dimo=\z@\pst@cnta=0\relax
+ \global\chart@Toggle=1\relax
\ifpsshadow% create shadow first
\psforeach{\chart@tempA}{\psk@chartValues}{%
- \global\advance\pst@dimm by \chart@tempA pt
- \global\advance\pst@dimn by \chart@alpha pt
- \global\advance\pst@cnta by \@ne
+ \global\advance\pst@dimm by \chart@tempA\p@%
+ \global\advance\pst@dimn by \chart@alpha\p@%
+ \global\advance\pst@cnta by \@ne%
\pst@dimo=0.5\pst@dimn\advance\pst@dimo by 0.5\pst@dimm% half angle of the chart
\global\@chartSepfalse%
- \psforeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta
+ \psforeach{\chart@tempC}{\psk@chartSepValues}{\ifnum\chart@tempC=\the\pst@cnta\relax
\global\@chartSeptrue\fi}%
\if@chartSep%
- \pswedge(\psk@chartSep pt;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}%
+ \pswedge(\psk@chartSep\p@;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}%
\else%
- \pswedge{\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}
+ \pswedge(0,0){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}%
\fi%
\global\let\chart@alpha\chart@tempA%
}%
\psshadowfalse%
\fi%
\def\chart@alpha{0}%
- \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0%
+ \pst@dimm=0pt\pst@dimn=0pt\pst@dimo=0pt\pst@cnta=0\relax%
\psforeach{\chart@tempA}{\psk@chartValues}{%
- \global\advance\pst@dimm by \chart@tempA pt%
- \global\advance\pst@dimn by \chart@alpha pt%
+ \global\advance\pst@dimm by \chart@tempA\p@%
+ \global\advance\pst@dimn by \chart@alpha\p@%
\def\pst@tempB{\pst@number\chart@ColorIndex}%
\psDEBUG[psChart:wave:color]{\pst@tempB}%
\global\advance\pst@cnta by \@ne%
\if@chartUserColor\else%
\def\chart@FillColor{chartFillColor\the\pst@cnta}%
- \ifnum\psk@chartColor>0 \xglobal\definecolor{\chart@FillColor}{wave}{\pst@tempB}%
+ \ifnum\psk@chartColor>0\relax%
+ \xglobal\definecolor{\chart@FillColor}{wave}{\pst@tempB}%
\else\xglobal\definecolor{\chart@FillColor}{gray}{\pst@tempB}\fi%
\fi%
\pst@dimo=0.5\pst@dimn\advance\pst@dimo by 0.5\pst@dimm% half angle of the chart
@@ -3761,15 +3807,15 @@
\global\@chartSeptrue\fi}%
\if@chartSep%
\pswedge[linecolor={chartFillColor\the\pst@cnta},fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}]%
- (\psk@chartSep pt;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}%
- \pst@dima=\pst@chartRadius\advance\pst@dima by \psk@chartSep pt%
+ (\psk@chartSep\p@;\pst@number\pst@dimo){\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}%
+ \pst@dima=\pst@chartRadius\advance\pst@dima by \psk@chartSep\p@%
\pnode(\pst@dima;\pst@number\pst@dimo){psChart\the\pst@cnta}%
\pst@dimb=\psk@chartNodeI\pst@dima%
\pst@dimc=\psk@chartNodeO\pst@dima%
\pnode(\pst@dimb;\pst@number\pst@dimo){psChartI\the\pst@cnta}%
\pnode(\pst@dimc;\pst@number\pst@dimo){psChartO\the\pst@cnta}%
\else%
- \pswedge[linecolor={chartFillColor\the\pst@cnta},fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}]%
+ \pswedge[linecolor={chartFillColor\the\pst@cnta},fillstyle=solid,fillcolor={chartFillColor\the\pst@cnta}](0,0)%
{\pst@chartRadius}{\pst@number\pst@dimn}{\pst@number\pst@dimm}%
\pnode(\pst@chartRadius;\pst@number\pst@dimo){psChart\the\pst@cnta}%
\pst@dima=\pst@chartRadius%
@@ -3979,6 +4025,7 @@
\def\resetOptions{%
\@zero=0%
\def\pst@linetype{0}%
+ \pstScalePoints(1,1){}{}%
\psset[pstricks-add]{%
hooklength=3mm, hookwidth=1mm,
ArrowFill=true,