summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pstricks-add
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-06-18 23:09:00 +0000
committerKarl Berry <karl@freefriends.org>2014-06-18 23:09:00 +0000
commit451b2f3d546ab208d12ccab29befbf4577374c2e (patch)
tree0acda79bafce79afe36258aae2e02561eeead79e /Master/texmf-dist/tex/generic/pstricks-add
parent6271138aedb2f61eee0225300db1569008084a10 (diff)
pstricks-add (13jun14)
git-svn-id: svn://tug.org/texlive/trunk@34298 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.tex160
1 files changed, 99 insertions, 61 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 f7751f1c9d1..018fa300df7 100644
--- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
+++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex
@@ -1,4 +1,4 @@
-%% $Id: pstricks-add.tex 914 2014-05-17 20:02:53Z herbert $
+%% $Id: pstricks-add.tex 924 2014-06-16 21:25:49Z herbert $
%%
%% This is file `pstricks-add.tex',
%%
@@ -30,8 +30,8 @@
\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi
\ifx\PSTmathLoaded\endinput\else \input pst-math \fi
%
-\def\fileversion{3.68}
-\def\filedate{2014/05/17}
+\def\fileversion{3.73}
+\def\filedate{2014/06/16}
\message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -1318,7 +1318,7 @@ a add
\def\psStep@i(#1,#2)#3#4{%
\begin@ClosedObj%
\addto@pscode{
- \ifPst@algebraic /Func (#4) tx@addDict begin AlgParser end cvx def \fi
+ /Func \ifPst@algebraic (#4) tx@addDict begin AlgParser end cvx \else {#4} \fi def
/x #1 def
/dx #2 #1 sub #3 div def
/scx { \pst@number\psxunit mul } def
@@ -1326,7 +1326,7 @@ a add
\ifcase\psk@StepType % 0->lower, height is always f(x)
x scx 0 moveto
#3 {
- \ifPst@algebraic Func \else #4 \fi
+ Func
scy dup x scx exch \ifPst@noVerticalLines moveto \else lineto \fi
/x x dx add def
x scx exch lineto
@@ -1336,7 +1336,7 @@ a add
x scx 0 moveto
#3 {
/x x dx add def
- \ifPst@algebraic Func \else #4 \fi scy dup x dx sub scx exch
+ Func scy dup x dx sub scx exch
\ifPst@noVerticalLines moveto \else lineto \fi
x scx exch lineto
x scx 0 \ifPst@noVerticalLines moveto \else lineto \fi
@@ -1348,11 +1348,11 @@ a add
/AMin [] def
/dt dx eps3 div def
#3 {
- /Max \ifPst@algebraic Func \else #4 \fi def
+ /Max Func def
/Min Max def
/t x def % save x value
eps3 {
- \ifPst@algebraic Func \else #4 \fi
+ Func
dup
Max lt { /Max exch def } { dup Min gt { /Min exch def }{ pop } ifelse } ifelse
/x x dt add def
@@ -1373,8 +1373,8 @@ a add
closepath
} repeat
\or % 3->inf(imum)
- #3 {
x scx 0 moveto
+ #3 {
\ifPst@algebraic Func \else #4 \fi /y0 ED % left value f(x)
/xOld x def
/x x dx add def
@@ -1383,11 +1383,11 @@ a add
scy dup xOld scx exch \ifPst@noVerticalLines moveto \else lineto \fi
x scx exch lineto
x scx 0 \ifPst@noVerticalLines moveto \else lineto \fi
- closepath
+ closepath x scx 0 moveto
} repeat
\or % 4-> sup(remum)
- #3 {
x scx 0 moveto
+ #3 {
\ifPst@algebraic Func \else #4 \fi /y0 ED % left value f(x)
/x x dx add def
\ifPst@algebraic Func \else #4 \fi /y1 ED % right value f(x+dx)
@@ -1395,7 +1395,7 @@ a add
scy dup x dx sub scx exch \ifPst@noVerticalLines moveto \else lineto \fi
x scx exch lineto
x scx 0 \ifPst@noVerticalLines moveto \else lineto \fi
- closepath
+ closepath x scx 0 moveto
} repeat
\fi
}%
@@ -1404,7 +1404,13 @@ a add
\end@ClosedObj%
}
%
-\define@key[psset]{pstricks-add}{Derive}{\def\psk@Derive{#1}}%
+\define@key[psset]{pstricks-add}{Derive}{\def\psk@Derive{#1}}
+%\define@key[psset]{pstricks-add}{Derive}{\expandafter\psk@@Derive#1,,\@nil}%
+%\def\psk@@Derive#1,#2,#3\@nil{%
+% \ifx\relax#2\relax
+% \ifPST@algebraic\def\psk@Derive{ (#1) tx@addDict begin AlgParser end cvx }\else \def\psk@Derive{ #1 }\fi
+% \else\def\psk@Derive{ (#1)(x) tx@Derive begin Derive end tx@addDict begin AlgParser end cvx } \fi
+%}
\define@boolkey[psset]{pstricks-add}[PST@]{Tnormal}[true]{}
\psset[pstricks-add]{CMYK=true}
@@ -1496,7 +1502,7 @@ a add
\pst@killglue
\expandafter\psplotTangent@x#3,,\@nil\relax
\begingroup
- \ifx\relax#1\relax\else\psset{linestyle=solid,#1}\fi%
+ \ifx\relax#1\relax\else\psset{linestyle=solid,#1}\fi
\ifx\psk@Derive\@empty\ifPst@algebraic\def\psk@Derive{NOT@EMPTY}\fi\fi %%dr 0606 hv 1003
\pst@addarrowdef
\addto@pscode{
@@ -1509,72 +1515,72 @@ a add
\fi%
/@parametric false def %%dr 0606
% first we calculate the origin
- #2 dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
+ #2 dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
{ /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
+ { \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
+% %% algebraic we can use the derivative machine
/FDer@pstplot (#4) @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
+ x \pst@number\psxunit mul y \pst@number\psyunit mul
translate % define the temporary origin
- % now we calculate the slope of the tangent
+ % now we calculate the slope of the tangent
\ifx\psk@Derive\@empty % de we have a derivation defined?
- #2 abs 1.0e-6 lt % no, we choose secant for the tangent
+ #2 abs 1.0e-6 lt % no, we choose secant for the tangent
{ #2 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
- { \ifPst@polarplot 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
#2 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 }
- { \ifPst@polarplot 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
+ cleartomark
y2 y1 sub x2 x1 sub } % dy dx
{ % > 1.0e-06
- #2 1.0005 mul dup /x ED /t ED tx@addDict begin mark F@pstplot end counttomark 1 gt % test, if we have parametricplot
+ #2 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
- { \ifPst@polarplot 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
- #2 .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
- { \ifPst@polarplot dup x \ifPst@algebraic RadtoDeg \fi
+ cleartomark
+ #2 .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
+ { \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
+ cleartomark
+ y2 y1 sub \pst@number\psyunit mul x2 x1 sub \pst@number\psxunit mul } ifelse
atan % atan(dy dx), we have the slope angle of the secant
\ifPST@Tnormal 90 add \fi
\else % there is a derivation defined
- #2 dup /x ED /t ED tx@addDict begin mark FDer@pstplot end counttomark 1 gt % test, if we have parametricplot
+ #2 dup /x ED /t ED tx@addDict begin mark FDer@pstplot end counttomark 1 gt % test, if we have parametricplot
{ /y ED /x ED }
- { \ifPst@polarplot /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
+ x \ifPst@algebraic RadtoDeg \fi sin Fphi mul x0 add /y ED
+ x \ifPst@algebraic RadtoDeg \fi cos Fphi mul y0 sub /x ED
\else /y ED /x 1 def \fi } ifelse
- cleartomark
+ cleartomark
y \pst@number\psyunit mul x \pst@number\psxunit mul Atan \ifPST@Tnormal 90 add \fi
% y ATAN1 % we have the slope angle of the tangent. ATAN is defined int the pstricks.pro, patch 6
\fi
dup % to prevent rounding errors use original value
cvi 180 mod 90 gt { 180 sub } if % -90 <= angle <= 90
rotate % rotate, depending to the origin
- /Lineto /lineto load def % the pro file needs /Lineto
+ /Lineto /lineto load def % the pro file needs /Lineto
\pst@cp % kill the currentpoint, if any
[ % start array of points
\ifPST@Tnormal
- 0 0 % moveto
- #3
- y \pst@number\psyunit mul x \pst@number\psxunit mul Atan cos div \pst@number\psxunit mul 0 % lineto
+ 0 \psk@nodesepA add 0 % moveto
+ #3 \pst@number\psxunit mul \psk@nodesepB sub 0
+% y \pst@number\psyunit mul x \pst@number\psxunit mul Atan cos div \pst@number\psxunit mul 0 % lineto
\else % points are in reverse order ...
- \ifx\pst@tempRight\@empty #3 \else \pst@tempRight\space \fi \pst@number\psxunit mul 0 % moveto
- \if@star 0
- \else
- \ifx\pst@tempRight\@empty #3 neg \else \pst@tempLeft\space \fi
+ \ifx\pst@tempRight\@empty #3 \psk@nodesepA \pst@number\psxunit div sub \else \pst@tempRight\space \fi \pst@number\psxunit mul 0 % moveto
+ \if@star 0
+ \else
+ \ifx\pst@tempRight\@empty #3 \psk@nodesepB \pst@number\psxunit div sub neg \else \pst@tempLeft\space \fi
\pst@number\psxunit mul
\fi 0 % lineto
\fi
@@ -1583,7 +1589,7 @@ a add
\tx@Line
\ifx\pslinestyle\@none\else
\pst@number\pslinewidth SLW
- \tx@setStrokeTransparency
+ \tx@setStrokeTransparency
\@nameuse{psls@\pslinestyle}
\fi
\ifshowpoints % show the points?
@@ -1594,9 +1600,32 @@ a add
grestore
\fi
}%
- \use@pscode%
- \endgroup%
- \@starfalse%
+ \use@pscode
+ %% ---- only for algebraic: 3 Nodes for Origin, Tangent-End and Normal-End --- 31.05.2014 TS
+\iffalse
+ \ifPst@algebraic
+ \pst@Verb{
+ #2 /x ED % x-Wert wird definiert
+ /Function (#4) tx@AlgToPs begin AlgToPs end cvx def
+ /mt (#4) (x) tx@Derive begin Derive end tx@addDict begin AlgParser end cvx def % mt ist die Steigung an der Stelle x = #2
+ x Function /y ED % y = f(x=#2) ist der Funktionswert an der Stelle x = #2
+ #3 mt 1 Atan cos dup mul mt 1 Atan sin \pst@number\psyunit mul \pst@number\psxunit div dup mul add sqrt div /ldt ED
+ mt 0 ge { ldt mt 1 Atan cos mul /Dx ED ldt mt 1 Atan sin mul /Dy ED }
+ {ldt mt 1 Atan cos mul neg /Dx ED ldt mt 1 Atan sin mul neg /Dy ED } ifelse
+ x Dx add /xt ED
+ y Dy add /yt ED
+ x Dy \pst@number\psyunit mul \pst@number\psxunit div add /xn ED
+ y Dx \pst@number\psxunit mul \pst@number\psyunit div sub /yn ED
+ }%
+ \pnode(! x y){OCurve}%
+ \pnode(! xt yt){ETangent}%
+ \pnode(! xn yn){ENormal}%
+ \psLNode(ENormal)(OCurve){2}{ENormalE}%
+ \psLNode(ETangent)(OCurve){2}{ETangentE}%
+ \fi
+\fi
+ \endgroup
+ \@starfalse
\ignorespaces}
%
%% #1-#2 x range
@@ -2299,8 +2328,8 @@ a add
\def\psStartPoint{\@ifnextchar[{\psStartPoint@i}{\psStartPoint@i[Vector]}}
\def\psStartPoint@i[#1](#2){%
\global\psVectorCtr=\@ne
- \gdef\psVectorName{#1}
- \pnode(#2){#10}
+ \gdef\psVectorName{#1}%
+ \pnode(#2){#10}%
\pst@getcoor{#2}\pst@tempA%
\pstVerb{tx@Dict begin
\pst@tempA
@@ -2308,29 +2337,33 @@ a add
\pst@number\psxunit div /cp.X exch def end }\ignorespaces}
%
\def\psVector{\pst@object{psVector}}
-\def\psVector@i(#1){%
- \pst@killglue%
+\def\psVector@i{%
+ \pst@killglue
\addbefore@par{arrows=->,arrowsize=6pt}%
% \addto@par{showpoints=false}%
- \pst@getcoor{#1}\pst@tempCoor%
+ \psVector@ii}
+
+\def\psVector@ii(#1){%
+ \pst@getcoor{#1}\pst@tempCoor
\begingroup
- \use@par%
+ \use@keep@par
\rput(! cp.X cp.Y ){%
- \psline(0,0)(#1)%
+ \pnode(0,0){@@@A}\pnode(#1){@@@B}
\ifPst@markAngle
\psarc[style=psMarkAngleStyle](0,0){1}{0}{!\pst@tempCoor exch atan}%
\psline[style=psMarkAngleLineStyle](1.5,0)%
\fi}%
+ \ncline[nodesep=0pt]{@@@A}{@@@B}
\pnode(! \pst@tempCoor \pst@number\psyunit div cp.Y add exch
\pst@number\psxunit div cp.X add exch ){\psVectorName\the\psVectorCtr}%
\global\advance\psVectorCtr by \@ne%
- \endgroup%
- \pst@Verb{%tx@Dict begin
+ \endgroup
+ \pst@Verb{ %tx@Dict begin
\pst@tempCoor
\pst@number\psyunit div cp.Y add /cp.Y exch def
\pst@number\psxunit div cp.X add /cp.X exch def %end
}%
- \ignorespaces}
+ \@ifnextchar(\psVector@ii\ignorespaces}
%
\define@key[psset]{pstricks-add}{basename}{\def\psk@basename{#1}}%
\psset[pstricks-add]{basename=}%
@@ -2490,11 +2523,14 @@ a add
%
\define@key[psset]{pstricks-add}{colSteps}{\def\psk@colSteps{#1 }}
\define@boolkey[psset]{pstricks-add}[Pst@]{colored}[true]{}
-\psset[pstricks-add]{colSteps=0,colored=false}% continuing colors and grayscale
+\define@key[psset]{pstricks-add}{colorOffset}[]{\def\psk@colorOffset{#1 }}
+\psset[pstricks-add]{colSteps=0,colored=false,colorOffset=}% continuing colors and grayscale
%
\def\pstContour{\pst@object{pstContour}}
\def\pstContour@i#1{%
+\addbefore@par{radius=1pt}
\begin@SpecialObj%
+ \pssetlength\pst@dimb\psk@radius
\addto@pscode{
(#1) run
/zMax 0 def /zMin 0 def % lowest and highest value
@@ -2502,6 +2538,7 @@ a add
N{ % inside contourdata
/data ED % save first inner array
data aload length 3 div round cvi { % get the records
+ \psk@colorOffset
dup zMin lt % z<zMin?
{ /zMin ED } % yes, save it
{ dup zMax gt { /zMax ED }{ pop } ifelse } ifelse
@@ -2514,6 +2551,7 @@ a add
0 1 N 1 sub { % for i=0 to N-1
contourdata exch get /data ED % get first array
data aload length 3 div round cvi {
+ \psk@colorOffset
/z ED /y ED /x ED
z zMin sub dz div % relative z (0..1)
\ifPst@colored 400 mul 380 add tx@addDict begin wavelengthToRGB
@@ -2523,7 +2561,7 @@ a add
setgray
\fi
x \pst@number\psxunit mul y \pst@number\psyunit mul
- 1 0 360 arc fill
+ \pst@number\pst@dimb 0 360 arc fill
} repeat
} for
}%