summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pstricks-add
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 /Master/texmf-dist/tex/generic/pstricks-add
parent3ae3e7426f883c549a427ed3940e3beb8a40ea78 (diff)
pstricks-add 3.32 (13may09)
git-svn-id: svn://tug.org/texlive/trunk@13185 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pstricks-add')
-rw-r--r--Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex103
1 files changed, 75 insertions, 28 deletions
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,