diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-09 01:01:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-09 01:01:02 +0000 |
commit | 4a6fbdc0e89fde6f9efcaa24de3db8e137da4404 (patch) | |
tree | efe2b5d7e2f07d6ce478982a9b1e5f43d41cb56c /Master/texmf-dist/dvips/pstricks | |
parent | 524dc4b7a5d60a1c703450ac6fd3749ffe81afa3 (diff) |
trunk/Master/texmf-dist/dvips
git-svn-id: svn://tug.org/texlive/trunk@88 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pstricks')
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/Changes | 4 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-blur.pro | 64 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-coil.pro | 33 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-dots.pro | 132 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-grad.pro | 106 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-node.pro | 210 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-slpe.pro | 150 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-text.pro | 101 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pstricks.pro | 410 |
9 files changed, 1210 insertions, 0 deletions
diff --git a/Master/texmf-dist/dvips/pstricks/Changes b/Master/texmf-dist/dvips/pstricks/Changes new file mode 100644 index 00000000000..73c4f68079d --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/Changes @@ -0,0 +1,4 @@ +---- pstricks.pro +97, patch 6 2005-05-17 (hv) added some helper stuff + RadtoDeg, DegtoRad, Pi, TwoPi, ATAN +97, patch 5 2005-03-08 (hv) bugfix for DashLine diff --git a/Master/texmf-dist/dvips/pstricks/pst-blur.pro b/Master/texmf-dist/dvips/pstricks/pst-blur.pro new file mode 100644 index 00000000000..4cc4963cd82 --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pst-blur.pro @@ -0,0 +1,64 @@ +%% +%% This is file `pst-blur.pro', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pst-blur.dtx (with options: `prolog') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% You are *not* allowed to modify this file. +%% +%% You are *not* allowed to distribute this file. +%% For distribution of the original source see the terms +%% for copying and modification in the file pst-blur.dtx. +%% +/tx@PstBlurDict 60 dict def +tx@PstBlurDict begin +/Iterate { + /SegLines ED + /ThisB ED /ThisG ED /ThisR ED + /NextB ED /NextG ED /NextR ED + /W 2.0 BlurRadius mul def + /WDec W SegLines div def + /RInc NextR ThisR sub SegLines div def + /GInc NextG ThisG sub SegLines div def + /BInc NextB ThisB sub SegLines div def + /R ThisR def + /G ThisG def + /B ThisB def + SegLines { + R G B + sqrt 3 1 roll sqrt 3 1 roll sqrt 3 1 roll + setrgbcolor + gsave W setlinewidth + stroke grestore + /W W WDec sub def + /R R RInc add def + /G G GInc add def + /B B BInc add def + } bind repeat +} def +/BlurShadow { + Shadow + /BlurSteps ED + /BlurRadius ED + dup mul /BEnd ED dup mul /GEnd ED dup mul /REnd ED + dup mul /BBeg ED dup mul /GBeg ED dup mul /RBeg ED + RBeg REnd add 0.5 mul /RMid ED + GBeg GEnd add 0.5 mul /GMid ED + BBeg BEnd add 0.5 mul /BMid ED + /OuterSteps BlurSteps 2 div cvi def + /InnerSteps BlurSteps OuterSteps sub def + 1 setlinejoin + RMid GMid BMid REnd GEnd BEnd OuterSteps Iterate + gsave RBeg sqrt GBeg sqrt BBeg sqrt setrgbcolor fill grestore + clip + 0 setlinejoin + RMid GMid BMid RBeg GBeg BBeg InnerSteps Iterate +} def +end + diff --git a/Master/texmf-dist/dvips/pstricks/pst-coil.pro b/Master/texmf-dist/dvips/pstricks/pst-coil.pro new file mode 100644 index 00000000000..4b635cea9f6 --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pst-coil.pro @@ -0,0 +1,33 @@ +%! +% PostScript prologue for pst-coil.tex. +% Version 97 patch 1, 98/06/02 +% For distribution, see pstricks.tex. +% +/tx@CoilDict 40 dict def tx@CoilDict begin +/CoilLoop { /t ED t sin AspectSin mul t 180 div AspectCos mul add t cos +lineto } def +/Coil { /Inc ED dup sin /AspectSin ED cos /AspectCos ED /ArmB ED /ArmA ED +/h ED /w ED /y1 ED /x1 ED /y0 ED /x0 ED x0 y0 translate y1 y0 sub x1 x0 +sub 2 copy Pyth /TotalLength ED Atan rotate /BeginAngle ArmA AspectCos +Div w h mul Div 360 mul def /EndAngle TotalLength ArmB sub AspectCos Div +w h mul Div 360 mul def 1 0 0 0 ArrowA ArmA 0 lineto /mtrx CM def w h +mul 2 Div w 2 Div scale BeginAngle Inc EndAngle { CoilLoop } for +EndAngle CoilLoop mtrx setmatrix TotalLength ArmB sub 0 lineto CP +% DG/SR modification begin - Jun. 2, 1998 - Patch 1 (from Michael Vulis) +% TotalLength 0 ArrowB lineto } def +TotalLength 0 ArrowB lineto +pop pop pop pop } def +% DG/SR modification end +/AltCoil { /Inc ED dup sin /AspectSin ED cos /AspectCos ED /h ED /w ED +/EndAngle ED /BeginAngle ED /mtrx CM def w h mul 2 Div w 2 Div scale +BeginAngle sin AspectSin mul BeginAngle 180 div AspectCos mul add +BeginAngle cos /lineto load stopped { moveto } if BeginAngle Inc +EndAngle { CoilLoop } for EndAngle CoilLoop mtrx setmatrix } def +/ZigZag { /ArmB ED /ArmA ED 2 div /w ED w mul /h ED /y1 ED /x1 ED /y0 ED +/x0 ED x1 y1 translate y0 y1 sub x0 x1 sub 2 copy Pyth /TotalLength ED +Atan rotate TotalLength ArmA sub ArmB sub dup h div cvi /n ED n h mul +sub 2 div dup ArmA add /ArmA ED ArmB add /ArmB ED /x ArmB h 2 div add +def mark 0 0 ArmB 0 n { x w /w w neg def /x x h add def } repeat +TotalLength ArmA sub 0 TotalLength 0 } def +end +% END pst-coil.pro diff --git a/Master/texmf-dist/dvips/pstricks/pst-dots.pro b/Master/texmf-dist/dvips/pstricks/pst-dots.pro new file mode 100644 index 00000000000..8c83b963525 --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pst-dots.pro @@ -0,0 +1,132 @@ +%!PS-Adobe-2.0 +%%Title: Dot Font for PSTricks +%%Creator: Timothy Van Zandt <tvz@Princeton.EDU> +%%Creation Date: May 7, 1993 +%% Version 97 patch 1, 99/12/16 +%% Modified by Etienne Riga <etienne.riga@skynet.be> - Dec. 16, 1999 +%% to add /Diamond, /SolidDiamond and /BoldDiamond +10 dict dup begin + /FontType 3 def + /FontMatrix [ .001 0 0 .001 0 0 ] def + /FontBBox [ 0 0 0 0 ] def + /Encoding 256 array def + 0 1 255 { Encoding exch /.notdef put } for + Encoding + dup (b) 0 get /Bullet put + dup (c) 0 get /Circle put + dup (C) 0 get /BoldCircle put + dup (u) 0 get /SolidTriangle put + dup (t) 0 get /Triangle put + dup (T) 0 get /BoldTriangle put + dup (r) 0 get /SolidSquare put + dup (s) 0 get /Square put + dup (S) 0 get /BoldSquare put + dup (q) 0 get /SolidPentagon put + dup (p) 0 get /Pentagon put + dup (P) 0 get /BoldPentagon put +% DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga + dup (l) 0 get /SolidDiamond put + dup (d) 0 get /Diamond put + (D) 0 get /BoldDiamond put +% DG/SR modification end + /Metrics 13 dict def + Metrics begin + /Bullet 1000 def + /Circle 1000 def + /BoldCircle 1000 def + /SolidTriangle 1344 def + /Triangle 1344 def + /BoldTriangle 1344 def + /SolidSquare 886 def + /Square 886 def + /BoldSquare 886 def + /SolidPentagon 1093.2 def + /Pentagon 1093.2 def + /BoldPentagon 1093.2 def +% DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga + /SolidDiamond 1008 def + /Diamond 1008 def + /BoldDiamond 1008 def +% DG/SR modification end + /.notdef 0 def + end + /BBoxes 13 dict def + BBoxes begin + /Circle { -550 -550 550 550 } def + /BoldCircle /Circle load def + /Bullet /Circle load def + /Triangle { -571.5 -330 571.5 660 } def + /BoldTriangle /Triangle load def + /SolidTriangle /Triangle load def + /Square { -450 -450 450 450 } def + /BoldSquare /Square load def + /SolidSquare /Square load def + /Pentagon { -546.6 -465 546.6 574.7 } def + /BoldPentagon /Pentagon load def + /SolidPentagon /Pentagon load def +% DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga + /Diamond { -428.5 -742.5 428.5 742.5 } def + /BoldDiamond /Diamond load def + /SolidDiamond /Diamond load def +% DG/SR modification end + /.notdef { 0 0 0 0 } def + end + /CharProcs 20 dict def + CharProcs begin + /Adjust { + 2 copy dtransform floor .5 add exch floor .5 add exch idtransform + 3 -1 roll div 3 1 roll exch div exch scale + } def + /CirclePath { 0 0 500 0 360 arc closepath } def + /Bullet { 500 500 Adjust CirclePath fill } def + /Circle { 500 500 Adjust CirclePath .9 .9 scale CirclePath + eofill } def + /BoldCircle { 500 500 Adjust CirclePath .8 .8 scale CirclePath + eofill } def + /BoldCircle { CirclePath .8 .8 scale CirclePath eofill } def + /TrianglePath { 0 660 moveto -571.5 -330 lineto 571.5 -330 lineto + closepath } def + /SolidTriangle { TrianglePath fill } def + /Triangle { TrianglePath .85 .85 scale TrianglePath eofill } def + /BoldTriangle { TrianglePath .7 .7 scale TrianglePath eofill } def + /SquarePath { -450 450 moveto 450 450 lineto 450 -450 lineto + -450 -450 lineto closepath } def + /SolidSquare { SquarePath fill } def + /Square { SquarePath .89 .89 scale SquarePath eofill } def + /BoldSquare { SquarePath .78 .78 scale SquarePath eofill } def + /PentagonPath { + -337.8 -465 moveto + 337.8 -465 lineto + 546.6 177.6 lineto + 0 574.7 lineto + -546.6 177.6 lineto + closepath + } def + /SolidPentagon { PentagonPath fill } def + /Pentagon { PentagonPath .89 .89 scale PentagonPath eofill } def + /BoldPentagon { PentagonPath .78 .78 scale PentagonPath eofill } def +% DG/SR modification begin - Dec. 16, 1999 - From Etienne Riga + /DiamondPath { 0 742.5 moveto -428.5 0 lineto 0 -742.5 lineto + 428.5 0 lineto closepath } def + /SolidDiamond { DiamondPath fill } def + /Diamond { DiamondPath .85 .85 scale DiamondPath eofill } def + /BoldDiamond { DiamondPath .7 .7 scale DiamondPath eofill } def +% DG/SR modification end + /.notdef { } def + end + /BuildGlyph { + exch + begin + Metrics 1 index get exec 0 + BBoxes 3 index get exec + setcachedevice + CharProcs begin load exec end + end + } def + /BuildChar { + 1 index /Encoding get exch get + 1 index /BuildGlyph get exec + } bind def +end +/PSTricksDotFont exch definefont pop +%END pst-dots.pro diff --git a/Master/texmf-dist/dvips/pstricks/pst-grad.pro b/Master/texmf-dist/dvips/pstricks/pst-grad.pro new file mode 100644 index 00000000000..84b0ebfefc2 --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pst-grad.pro @@ -0,0 +1,106 @@ +%! +% PostScript prologue for pst-grad.tex. +% Version 1.04, 2004/06/23 (adding %GradientCircle style - D.G.) +% prepared by Herbert Voss +% For copying restrictions, see pstricks.tex. +% +% For the PSTricks gradient fillstyle.% +% Based on some EPS files by leeweyr!bill@nuchat.sccsi.com (W. R. Lee).% +% Syntax:% D.G. modification begin - Apr. 9, %1998 +%%%%%% R0 G0 B0 R1 G1 B1 NumLines MidPoint Angle GradientFill +% ifGradientCircle GradientScale %GradientPosX GradientPosY +% R0 G0 B0 R1 G1 B1 NumLines MidPoint %Angle GradientFill +% D.G. modification end +% +/tx@GradientDict 40 dict def +tx@GradientDict begin +/GradientFill { + rotate + /MidPoint ED + /NumLines ED + /LastBlue ED + /LastGreen ED + /LastRed ED + /FirstBlue ED + /FirstGreen ED +/FirstRed ED +% D.G. modification begin - Apr. 9, 1998 +/GradientPosY ED +/GradientPosX ED + /GradientScale ED + /ifGradientCircle ED +% D.G. modification end + % This avoids gaps due to rounding errors: + clip + pathbbox %leave llx,lly,urx,ury on stack +% D.G. modification begin - Apr. 10, 1998 + 4 copy /ury ED /urx ED /lly ED /llx ED +% D.G. modification end + /y ED /x ED +% D.G. modification begin - Apr. 10, 1998 +ifGradientCircle + {0 GradientPosX eq + {0 GradientPosX eq {2 copy translate} if} if} + {2 copy translate} ifelse +% D.G. modification end + y sub neg /y ED + x sub neg /x ED % This avoids gaps due to rounding errors: + LastRed FirstRed add 2 div + LastGreen FirstGreen add 2 div + LastBlue FirstBlue add 2 div + setrgbcolor +% D.G. modification begin - Jul. 23, 1997 / Apr. 9, 1998 + ifGradientCircle + {/YSizePerLine y NumLines div def + /CurrentY y 2 div def + /MidLine NumLines 2 div 1 MidPoint sub mul abs cvi def} + {fill + /YSizePerLine y NumLines div def + /CurrentY 0 def + /MidLine NumLines 1 MidPoint sub mul abs cvi def} ifelse +% DG modification end + MidLine NumLines 2 sub gt + { /MidLine NumLines def } + { MidLine 2 lt { /MidLine 0 def } if } + ifelse + MidLine 0 gt + { + /Red FirstRed def + /Green FirstGreen def + /Blue FirstBlue def + /RedIncrement LastRed FirstRed sub MidLine 1 sub div def + /GreenIncrement LastGreen FirstGreen sub MidLine 1 sub div def + /BlueIncrement LastBlue FirstBlue sub MidLine 1 sub div def + MidLine { GradientLoop } repeat + } if + MidLine NumLines lt + { + /Red LastRed def + /Green LastGreen def + /Blue LastBlue def + /RedIncrement FirstRed LastRed sub NumLines MidLine sub 1 sub div def + /GreenIncrement FirstGreen LastGreen sub NumLines MidLine sub 1 sub div def + /BlueIncrement FirstBlue LastBlue sub NumLines MidLine sub 1 sub div def + NumLines MidLine sub { GradientLoop } repeat } + if + } def/GradientLoop { +% D.G. modification begin - Jul. 23, 1997 / Apr. 9, 1998 + ifGradientCircle + {CurrentY 0 gt { +% The default center used is the center of the bounding box of the object + 0 GradientPosX eq {0 GradientPosX eq + {/GradientPosX urx llx sub 2 div def + /GradientPosY ury lly sub 2 div def} if} if + GradientPosX GradientPosY CurrentY GradientScale mul 0 360 arc + Red Green Blue setrgbcolor fill + /CurrentY CurrentY YSizePerLine sub def + /Blue Blue BlueIncrement add def + /Green Green GreenIncrement add def + /Red Red RedIncrement add def} if} {0 CurrentY moveto x 0 rlineto + 0 YSizePerLine rlineto x neg 0 rlineto closepath + Red Green Blue setrgbcolor fill /CurrentY CurrentY YSizePerLine add def + /Blue Blue BlueIncrement add def /Green Green GreenIncrement add def + /Red Red RedIncrement add def} ifelse% D.G. modification end + }def + end +% END pst-grad.pro diff --git a/Master/texmf-dist/dvips/pstricks/pst-node.pro b/Master/texmf-dist/dvips/pstricks/pst-node.pro new file mode 100644 index 00000000000..7168f9c457c --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pst-node.pro @@ -0,0 +1,210 @@ +%! +% PostScript prologue for pst-node.tex. +% Version 97 patch 1, 97/05/09. +% For distribution, see pstricks.tex. +% +/tx@NodeDict 400 dict def tx@NodeDict begin +tx@Dict begin /T /translate load def end +/NewNode { gsave /next ED dict dup 3 1 roll def exch { dup 3 1 roll def } +if begin tx@Dict begin STV CP T exec end /NodeMtrx CM def next end +grestore } def +/InitPnode { /Y ED /X ED /NodePos { NodeSep Cos mul NodeSep Sin mul } def +} def +/InitCnode { /r ED /Y ED /X ED /NodePos { NodeSep r add dup Cos mul exch +Sin mul } def } def +/GetRnodePos { Cos 0 gt { /dx r NodeSep add def } { /dx l NodeSep sub def +} ifelse Sin 0 gt { /dy u NodeSep add def } { /dy d NodeSep sub def } +ifelse dx Sin mul abs dy Cos mul abs gt { dy Cos mul Sin div dy } { dx +dup Sin mul Cos Div } ifelse } def +/InitRnode { /Y ED /X ED X sub /r ED /l X neg def Y add neg /d ED Y sub +/u ED /NodePos { GetRnodePos } def } def +/DiaNodePos { w h mul w Sin mul abs h Cos mul abs add Div NodeSep add dup +Cos mul exch Sin mul } def +/TriNodePos { Sin s lt { d NodeSep sub dup Cos mul Sin Div exch } { w h +mul w Sin mul h Cos abs mul add Div NodeSep add dup Cos mul exch Sin mul +} ifelse } def +/InitTriNode { sub 2 div exch 2 div exch 2 copy T 2 copy 4 index index /d +ED pop pop pop pop -90 mul rotate /NodeMtrx CM def /X 0 def /Y 0 def d +sub abs neg /d ED d add /h ED 2 div h mul h d sub Div /w ED /s d w Atan +sin def /NodePos { TriNodePos } def } def +/OvalNodePos { /ww w NodeSep add def /hh h NodeSep add def Sin ww mul Cos +hh mul Atan dup cos ww mul exch sin hh mul } def +/GetCenter { begin X Y NodeMtrx transform CM itransform end } def +/XYPos { dup sin exch cos Do /Cos ED /Sin ED /Dist ED Cos 0 gt { Dist +Dist Sin mul Cos div } { Cos 0 lt { Dist neg Dist Sin mul Cos div neg } +{ 0 Dist Sin mul } ifelse } ifelse Do } def +/GetEdge { dup 0 eq { pop begin 1 0 NodeMtrx dtransform CM idtransform +exch atan sub dup sin /Sin ED cos /Cos ED /NodeSep ED NodePos NodeMtrx +dtransform CM idtransform end } { 1 eq {{exch}} {{}} ifelse /Do ED pop +XYPos } ifelse } def +/AddOffset { 1 index 0 eq { pop pop } { 2 copy 5 2 roll cos mul add 4 1 +roll sin mul sub exch } ifelse } def +/GetEdgeA { NodeSepA AngleA NodeA NodeSepTypeA GetEdge OffsetA AngleA +AddOffset yA add /yA1 ED xA add /xA1 ED } def +/GetEdgeB { NodeSepB AngleB NodeB NodeSepTypeB GetEdge OffsetB AngleB +AddOffset yB add /yB1 ED xB add /xB1 ED } def +/GetArmA { ArmTypeA 0 eq { /xA2 ArmA AngleA cos mul xA1 add def /yA2 ArmA +AngleA sin mul yA1 add def } { ArmTypeA 1 eq {{exch}} {{}} ifelse /Do ED +ArmA AngleA XYPos OffsetA AngleA AddOffset yA add /yA2 ED xA add /xA2 ED +} ifelse } def +/GetArmB { ArmTypeB 0 eq { /xB2 ArmB AngleB cos mul xB1 add def /yB2 ArmB +AngleB sin mul yB1 add def } { ArmTypeB 1 eq {{exch}} {{}} ifelse /Do ED +ArmB AngleB XYPos OffsetB AngleB AddOffset yB add /yB2 ED xB add /xB2 ED +} ifelse } def +/InitNC { /b ED /a ED /NodeSepTypeB ED /NodeSepTypeA ED /NodeSepB ED +/NodeSepA ED /OffsetB ED /OffsetA ED tx@NodeDict a known tx@NodeDict b +known and dup { /NodeA a load def /NodeB b load def NodeA GetCenter /yA +ED /xA ED NodeB GetCenter /yB ED /xB ED } if } def +/LPutLine { 4 copy 3 -1 roll sub neg 3 1 roll sub Atan /NAngle ED 1 t sub +mul 3 1 roll 1 t sub mul 4 1 roll t mul add /Y ED t mul add /X ED } def +/LPutLines { mark LPutVar counttomark 2 div 1 sub /n ED t floor dup n gt +{ pop n 1 sub /t 1 def } { dup t sub neg /t ED } ifelse cvi 2 mul { pop +} repeat LPutLine cleartomark } def +/BezierMidpoint { /y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED /y0 ED /x0 ED +/t ED /cx x1 x0 sub 3 mul def /cy y1 y0 sub 3 mul def /bx x2 x1 sub 3 +mul cx sub def /by y2 y1 sub 3 mul cy sub def /ax x3 x0 sub cx sub bx +sub def /ay y3 y0 sub cy sub by sub def ax t 3 exp mul bx t t mul mul +add cx t mul add x0 add ay t 3 exp mul by t t mul mul add cy t mul add +y0 add 3 ay t t mul mul mul 2 by t mul mul add cy add 3 ax t t mul mul +mul 2 bx t mul mul add cx add atan /NAngle ED /Y ED /X ED } def +/HPosBegin { yB yA ge { /t 1 t sub def } if /Y yB yA sub t mul yA add def +} def +/HPosEnd { /X Y yyA sub yyB yyA sub Div xxB xxA sub mul xxA add def +/NAngle yyB yyA sub xxB xxA sub Atan def } def +/HPutLine { HPosBegin /yyA ED /xxA ED /yyB ED /xxB ED HPosEnd } def +/HPutLines { HPosBegin yB yA ge { /check { le } def } { /check { ge } def +} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { dup Y check { exit +} { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark HPosEnd +} def +/VPosBegin { xB xA lt { /t 1 t sub def } if /X xB xA sub t mul xA add def +} def +/VPosEnd { /Y X xxA sub xxB xxA sub Div yyB yyA sub mul yyA add def +/NAngle yyB yyA sub xxB xxA sub Atan def } def +/VPutLine { VPosBegin /yyA ED /xxA ED /yyB ED /xxB ED VPosEnd } def +/VPutLines { VPosBegin xB xA ge { /check { le } def } { /check { ge } def +} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { 1 index X check { +exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark +VPosEnd } def +/HPutCurve { gsave newpath /SaveLPutVar /LPutVar load def LPutVar 8 -2 +roll moveto curveto flattenpath /LPutVar [ {} {} {} {} pathforall ] cvx +def grestore exec /LPutVar /SaveLPutVar load def } def +/NCCoor { /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def +GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 xA1 yA1 ] cvx def /LPutPos { +LPutVar LPutLine } def /HPutPos { LPutVar HPutLine } def /VPutPos { +LPutVar VPutLine } def LPutVar } def +/NCLine { NCCoor tx@Dict begin ArrowA CP 4 2 roll ArrowB lineto pop pop +end } def +/NCLines { false NArray n 0 eq { NCLine } { 2 copy yA sub exch xA sub +Atan /AngleA ED n 2 mul dup index exch index yB sub exch xB sub Atan +/AngleB ED GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 n 2 mul 4 add 4 roll xA1 +yA1 ] cvx def mark LPutVar tx@Dict begin false Line end /LPutPos { +LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } +ifelse } def +/NCCurve { GetEdgeA GetEdgeB xA1 xB1 sub yA1 yB1 sub Pyth 2 div dup 3 -1 +roll mul /ArmA ED mul /ArmB ED /ArmTypeA 0 def /ArmTypeB 0 def GetArmA +GetArmB xA2 yA2 xA1 yA1 tx@Dict begin ArrowA end xB2 yB2 xB1 yB1 tx@Dict +begin ArrowB end curveto /LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ] +cvx def /LPutPos { t LPutVar BezierMidpoint } def /HPutPos { { HPutLines +} HPutCurve } def /VPutPos { { VPutLines } HPutCurve } def } def +/NCAngles { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate +def xA2 yA2 mtrx transform pop xB2 yB2 mtrx transform exch pop mtrx +itransform /y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA2 +yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 +yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def +/HPutPos { HPutLines } def /VPutPos { VPutLines } def } def +/NCAngle { GetEdgeA GetEdgeB GetArmB /mtrx AngleA matrix rotate def xB2 +yB2 mtrx itransform pop xA1 yA1 mtrx itransform exch pop mtrx transform +/y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA1 yA1 +tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA1 yA1 ] +cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { +VPutLines } def } def +/NCBar { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def +xA2 yA2 mtrx itransform pop xB2 yB2 mtrx itransform pop sub dup 0 mtrx +transform 3 -1 roll 0 gt { /yB2 exch yB2 add def /xB2 exch xB2 add def } +{ /yA2 exch neg yA2 add def /xA2 exch neg xA2 add def } ifelse mark ArmB +0 ne { xB1 yB1 } if xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict +begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx +def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { +VPutLines } def } def +/NCDiag { GetEdgeA GetEdgeB GetArmA GetArmB mark ArmB 0 ne { xB1 yB1 } if +xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end +/LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { +LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } +def +/NCDiagg { GetEdgeA GetArmA yB yA2 sub xB xA2 sub Atan 180 add /AngleB ED +GetEdgeB mark xB1 yB1 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin +false Line end /LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { +LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } +def +/NCLoop { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate +def xA2 yA2 mtrx transform loopsize add /yA3 ED /xA3 ED /xB3 xB2 yB2 +mtrx transform pop def xB3 yA3 mtrx itransform /yB3 ED /xB3 ED xA3 yA3 +mtrx itransform /yA3 ED /xA3 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 +xB3 yB3 xA3 yA3 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false +Line end /LPutVar [ xB1 yB1 xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 xA1 yA1 ] +cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { +VPutLines } def } def +% DG/SR modification begin - May 9, 1997 - Patch 1 +%/NCCircle { 0 0 NodesepA nodeA \tx@GetEdge pop xA sub 2 div dup 2 exp r +%r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add +%exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 +%mul add dup 5 1 roll 90 sub \tx@PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED +/NCCircle { NodeSepA 0 NodeA 0 GetEdge pop 2 div dup 2 exp r +r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add +exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 +mul add dup 5 1 roll 90 sub PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED +% DG/SR modification end +} def /HPutPos { LPutPos } def /VPutPos { LPutPos } def r AngleA 90 sub a add +AngleA 270 add a sub tx@Dict begin /angleB ED /angleA ED /r ED /c 57.2957 r +Div def /y ED /x ED } def +/NCBox { /d ED /h ED /AngleB yB yA sub xB xA sub Atan def /AngleA AngleB +180 add def GetEdgeA GetEdgeB /dx d AngleB sin mul def /dy d AngleB cos +mul neg def /hx h AngleB sin mul neg def /hy h AngleB cos mul def +/LPutVar [ xA1 hx add yA1 hy add xB1 hx add yB1 hy add xB1 dx add yB1 dy +add xA1 dx add yA1 dy add ] cvx def /LPutPos { LPutLines } def /HPutPos +{ xB yB xA yA LPutLine } def /VPutPos { HPutPos } def mark LPutVar +tx@Dict begin false Polygon end } def +/NCArcBox { /l ED neg /d ED /h ED /a ED /AngleA yB yA sub xB xA sub Atan +def /AngleB AngleA 180 add def /tA AngleA a sub 90 add def /tB tA a 2 +mul add def /r xB xA sub tA cos tB cos sub Div dup 0 eq { pop 1 } if def +/x0 xA r tA cos mul add def /y0 yA r tA sin mul add def /c 57.2958 r div +def /AngleA AngleA a sub 180 add def /AngleB AngleB a add 180 add def +GetEdgeA GetEdgeB /AngleA tA 180 add yA yA1 sub xA xA1 sub Pyth c mul +sub def /AngleB tB 180 add yB yB1 sub xB xB1 sub Pyth c mul add def l 0 +eq { x0 y0 r h add AngleA AngleB arc x0 y0 r d add AngleB AngleA arcn } +{ x0 y0 translate /tA AngleA l c mul add def /tB AngleB l c mul sub def +0 0 r h add tA tB arc r h add AngleB PtoC r d add AngleB PtoC 2 copy 6 2 +roll l arcto 4 { pop } repeat r d add tB PtoC l arcto 4 { pop } repeat 0 +0 r d add tB tA arcn r d add AngleA PtoC r h add AngleA PtoC 2 copy 6 2 +roll l arcto 4 { pop } repeat r h add tA PtoC l arcto 4 { pop } repeat } +ifelse closepath /LPutVar [ x0 y0 r AngleA AngleB h d ] cvx def /LPutPos +{ LPutVar /d ED /h ED /AngleB ED /AngleA ED /r ED /y0 ED /x0 ED t 1 le { +r h add AngleA 1 t sub mul AngleB t mul add dup 90 add /NAngle ED PtoC } +{ t 2 lt { /NAngle AngleB 180 add def r 2 t sub h mul t 1 sub d mul add +add AngleB PtoC } { t 3 lt { r d add AngleB 3 t sub mul AngleA 2 t sub +mul add dup 90 sub /NAngle ED PtoC } { /NAngle AngleA 180 add def r 4 t +sub d mul t 3 sub h mul add add AngleA PtoC } ifelse } ifelse } ifelse +y0 add /Y ED x0 add /X ED } def /HPutPos { LPutPos } def /VPutPos { +LPutPos } def } def +/Tfan { /AngleA yB yA sub xB xA sub Atan def GetEdgeA w xA1 xB sub yA1 yB +sub Pyth Pyth w Div CLW 2 div mul 2 div dup AngleA sin mul yA1 add /yA1 +ED AngleA cos mul xA1 add /xA1 ED /LPutVar [ xA1 yA1 m { xB w add yB xB +w sub yB } { xB yB w sub xB yB w add } ifelse xA1 yA1 ] cvx def /LPutPos +{ LPutLines } def /VPutPos@ { LPutVar flag { 8 4 roll pop pop pop pop } +{ pop pop pop pop 4 2 roll } ifelse } def /VPutPos { VPutPos@ VPutLine } +def /HPutPos { VPutPos@ HPutLine } def mark LPutVar tx@Dict begin +/ArrowA { moveto } def /ArrowB { } def false Line closepath end } def +/LPutCoor { NAngle tx@Dict begin /NAngle ED end gsave CM STV CP Y sub neg +exch X sub neg exch moveto setmatrix CP grestore } def +/LPut { tx@NodeDict /LPutPos known { LPutPos } { CP /Y ED /X ED /NAngle 0 +def } ifelse LPutCoor } def +/HPutAdjust { Sin Cos mul 0 eq { 0 } { d Cos mul Sin div flag not { neg } +if h Cos mul Sin div flag { neg } if 2 copy gt { pop } { exch pop } +ifelse } ifelse s add flag { r add neg } { l add } ifelse X add /X ED } +def +/VPutAdjust { Sin Cos mul 0 eq { 0 } { l Sin mul Cos div flag { neg } if +r Sin mul Cos div flag not { neg } if 2 copy gt { pop } { exch pop } +ifelse } ifelse s add flag { d add } { h add neg } ifelse Y add /Y ED } +def +end +% END pst-node.pro diff --git a/Master/texmf-dist/dvips/pstricks/pst-slpe.pro b/Master/texmf-dist/dvips/pstricks/pst-slpe.pro new file mode 100644 index 00000000000..552e63f10aa --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pst-slpe.pro @@ -0,0 +1,150 @@ +%% +%% This is file `pst-slpe.pro', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pst-slpe.dtx (with options: `prolog') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% You are *not* allowed to modify this file. +%% +%% You are *not* allowed to distribute this file. +%% For distribution of the original source see the terms +%% for copying and modification in the file pst-slpe.dtx. +%% +/tx@PstSlopeDict 60 dict def tx@PstSlopeDict begin +/max {2 copy lt {exch} if pop} bind def +/Iterate { + 1 sub /NumSegs ED + dup mul 3 1 roll dup mul 3 1 roll dup mul 3 1 roll + setrgbcolor currenthsbcolor + /ThisB ED + /ThisS ED + /ThisH ED + /ThisPt ED + gsave fill grestore + NumSegs { + dup mul 3 1 roll dup mul 3 1 roll dup mul 3 1 roll + setrgbcolor currenthsbcolor + /NextB ED + /NextS ED + /NextH ED + /NextPt ED + ThisPt NextPt sub ThisPt div NumSteps mul cvi /SegSteps exch def + /NumSteps NumSteps SegSteps sub def + SegSteps 0 eq not { + ThisS 0 eq {/ThisH NextH def} if + NextS 0 eq {/NextH ThisH def} if + ThisH NextH sub 0.5 gt + {/NextH NextH 1.0 add def} + { NextH ThisH sub 0.5 ge {/ThisH ThisH 1.0 add def} if } + ifelse + /B ThisB def + /S ThisS def + /H ThisH def + /BInc NextB ThisB sub SegSteps div def + /SInc NextS ThisS sub SegSteps div def + /HInc NextH ThisH sub SegSteps div def + SegSteps { + H dup 1. gt {1. sub} if S B sethsbcolor + currentrgbcolor + sqrt 3 1 roll sqrt 3 1 roll sqrt 3 1 roll + setrgbcolor + DrawStep + /H H HInc add def + /S S SInc add def + /B B BInc add def + } bind repeat + /ThisH NextH def + /ThisS NextS def + /ThisB NextB def + /ThisPt NextPt def + } if + } bind repeat +} def +/PatchRadius { + Radius 0 eq { + /UpdRR { dup mul exch dup mul add RR max /RR ED } bind def + gsave + flattenpath + /RR 0 def + {UpdRR} {UpdRR} {} {} pathforall + grestore + /Radius RR sqrt def + } if +} def +/SlopesFill { + gsave + 180 add rotate + /NumSteps ED + clip + pathbbox + /h ED /w ED + 2 copy translate + h sub neg /h ED + w sub neg /w ED + /XInc w NumSteps div def + /DrawStep { + 0 0 XInc h rectfill + XInc 0 translate + } bind def + Iterate + grestore +} def +/CcSlopesFill { + gsave + /Radius ED + /CenterY ED + /CenterX ED + /NumSteps ED + clip + pathbbox + /h ED /w ED + 2 copy translate + h sub neg /h ED + w sub neg /w ED + w CenterX mul h CenterY mul translate + PatchRadius + /RadPerStep Radius NumSteps div neg def + /Rad Radius def + /DrawStep { + 0 0 Rad 0 360 arc + closepath fill + /Rad Rad RadPerStep add def + } bind def + Iterate + grestore +} def +/RadSlopesFill { + gsave + rotate + /Radius ED + /CenterY ED + /CenterX ED + /NumSteps ED + clip + pathbbox + /h ED /w ED + 2 copy translate + h sub neg /h ED + w sub neg /w ED + w CenterX mul h CenterY mul translate + PatchRadius + /AngleIncrement 360 NumSteps div neg def + /dY AngleIncrement sin AngleIncrement cos div Radius mul def + /DrawStep { + 0 0 moveto + Radius 0 rlineto + 0 dY rlineto + closepath fill + AngleIncrement rotate + } bind def + Iterate + grestore +} def +end + diff --git a/Master/texmf-dist/dvips/pstricks/pst-text.pro b/Master/texmf-dist/dvips/pstricks/pst-text.pro new file mode 100644 index 00000000000..2f001e2af23 --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pst-text.pro @@ -0,0 +1,101 @@ +%! +% PostScript header file pst-text.pro +% Version 97, 94/04/20; patched MV 10-09-99 00:36 +% For distribution, see pstricks.tex. + +/tx@TextPathDict 40 dict def +tx@TextPathDict begin + +% Syntax: <dist> PathPosition - +% Function: Searches for position of currentpath distance <dist> from +% beginning. Sets (X,Y)=position, and Angle=tangent. +/PathPosition +{ /targetdist exch def + /pathdist 0 def + /continue true def + /X { newx } def /Y { newy } def /Angle 0 def + gsave + flattenpath + { movetoproc } { linetoproc } { } { firstx firsty linetoproc } + /pathforall load stopped { pop pop pop pop /X 0 def /Y 0 def } if + grestore +} def + +/movetoproc { continue { @movetoproc } { pop pop } ifelse } def + +/@movetoproc +{ /newy exch def /newx exch def + /firstx newx def /firsty newy def +} def + +/linetoproc { continue { @linetoproc } { pop pop } ifelse } def + +/@linetoproc +{ + /oldx newx def /oldy newy def + /newy exch def /newx exch def + /dx newx oldx sub def + /dy newy oldy sub def + /dist dx dup mul dy dup mul add sqrt def + /pathdist pathdist dist add def + pathdist targetdist ge + { pathdist targetdist sub dist div dup + dy mul neg newy add /Y exch def + dx mul neg newx add /X exch def + /Angle dy dx atan def + /continue false def + } if +} def + +/TextPathShow +{ /String exch def + /CharCount 0 def + String length + { String CharCount 1 getinterval ShowChar + /CharCount CharCount 1 add def + } repeat +} def + +% Syntax: <pathlength> <position> InitTextPath - +/InitTextPath +{ gsave + currentpoint /Y exch def /X exch def + exch X Hoffset sub sub mul + Voffset Hoffset sub add + neg X add /Hoffset exch def + /Voffset Y def + grestore +} def + +/Transform +{ PathPosition + dup + Angle cos mul Y add exch + Angle sin mul neg X add exch + translate + Angle rotate +} def + +/ShowChar +{ /Char exch def + gsave + Char end stringwidth + tx@TextPathDict begin + 2 div /Sy exch def 2 div /Sx exch def + +%%% MV 10-09-99 00:36 + /sc?currentpoint where {pop sc?currentpoint} {currentpoint} ifelse +% currentpoint + + Voffset sub Sy add exch + Hoffset sub Sx add + Transform + Sx neg Sy neg moveto + Char end tx@TextPathSavedShow + tx@TextPathDict begin + grestore + Sx 2 mul Sy 2 mul rmoveto +} def + +end +% END pst-text.pro diff --git a/Master/texmf-dist/dvips/pstricks/pstricks.pro b/Master/texmf-dist/dvips/pstricks/pstricks.pro new file mode 100644 index 00000000000..8c67d1cb7da --- /dev/null +++ b/Master/texmf-dist/dvips/pstricks/pstricks.pro @@ -0,0 +1,410 @@ +%! +% PostScript prologue for pstricks.tex. +% Version 1.00, 2005/09/18 +% For distribution, see pstricks.tex. +% +/tx@Dict 200 dict def tx@Dict begin +/ADict 25 dict def +/CM { matrix currentmatrix } bind def +/SLW /setlinewidth load def +/CLW /currentlinewidth load def +/CP /currentpoint load def +/ED { exch def } bind def +/L /lineto load def +/T /translate load def +/TMatrix { } def +/RAngle { 0 } def +/Atan { /atan load stopped { pop pop 0 } if } def +/ATAN1 {neg -1 atan 180 sub } def % atan(x) (only one parameter) +/Div { dup 0 eq { pop } { div } ifelse } def % control the division +/NET { neg exch neg exch T } def % change coordinate system to the negative one +/Pyth { dup mul exch dup mul add sqrt } def % Pythagoras, epects 2 parameter +/PtoC { 2 copy cos mul 3 1 roll sin mul } def % Polar to Cartesian +%----------------- hv added 20050516 --------------- +/Pi 3.14159265359 def +/TwoPi 6.28318530718 def +/Euler 2.71828182846 def +/RadtoDeg { 180 mul Pi div } def % convert from radian to degrees +/DegtoRad { Pi mul 180 div } def % viceversa +%----------------- hv end--------------------------- +/PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def +/PathLength { flattenpath /z 0 def + { /y1 ED /x1 ED /y2 y1 def /x2 x1 def + }{ /y ED /x ED PathLength@ } {} { /y y2 def /x x2 def PathLength@ } + /pathforall load stopped { pop pop pop pop } if z } def +/STP { .996264 dup scale } def +/STV { SDict begin normalscale end STP } def +% +%%-------------- DG begin patch 15 ---------------%% +%/DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def +%PathLength } ifelse /b ED /x ED /y ED /z y x add def b a .5 sub 2 mul y +%mul sub z Div round z mul a .5 sub 2 mul y mul add b exch Div dup y mul +%/y ED x mul /x ED x 0 gt y 0 gt and { [ y x ] 1 a sub y mul } { [ 1 0 ] +%0 } ifelse setdash stroke } def +/DashLine { + dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def PathLength } ifelse + /b ED /x1 ED /y1 ED /x ED /y ED + /z y x add y1 add x1 add def + /Coef b a .5 sub 2 mul y mul sub z Div round + z mul a .5 sub 2 mul y mul add b exch Div def + /y y Coef mul def + /x x Coef mul def + /y1 y1 Coef mul def + /x1 x1 Coef mul def + x1 0 gt y1 0 gt or x 0 gt or y 0 gt and + { [ y x y1 x1 ] 1 a sub y mul } + { [ 1 0 ] 0 } ifelse + setdash stroke +} def +%%-------------- DG end patch 15 ---------------%% +/DotLine { + /b PathLength def + /a ED /z ED /y CLW def + /z y z add def + a 0 gt { + /b b a div def + }{ + a 0 eq { + /b b y sub def + }{ a -3 eq { + /b b y add def } if + } ifelse + } ifelse + [ 0 b b z Div round Div dup 0 le { pop 1 } if ] + a 0 gt { 0 }{ y 2 div a -2 gt { neg }if } ifelse + setdash 1 setlinecap stroke +} def +% +/LineFill { % hv ------------ patch 7 ------------- + gsave + abs /hatchWidthInc ED + abs /hatchSepInc ED + abs CLW add /a ED + a 0 dtransform round exch round exch + 2 copy idtransform + exch Atan rotate + idtransform pop /a ED + .25 .25 itransform pathbbox + /y2 ED + a Div ceiling cvi /x2 ED /y1 ED + a Div cvi /x1 ED /y2 y2 y1 sub def + clip + newpath + 2 setlinecap + systemdict + /setstrokeadjust known { true setstrokeadjust } if + x2 x1 sub 1 add { + x1 a mul y1 moveto 0 y2 rlineto stroke + /x1 x1 1 add + hatchWidthInc 0 gt { CLW add } if + def + hatchSepInc 0 gt hatchWidthInc 0 gt or { + /a a hatchSepInc add def + CLW hatchWidthInc add SLW + } if + } repeat + grestore + pop pop } def +% +%gsave abs CLW add /a ED a 0 dtransform round exch round exch +%2 copy idtransform exch Atan rotate idtransform pop /a ED .25 .25 +%% DG/SR modification begin - Dec. 12, 1997 - Patch 2 +%%itransform translate pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a +%itransform pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a +%% DG/SR modification end +%Div cvi /x1 ED /y2 y2 y1 sub def clip newpath 2 setlinecap systemdict +%/setstrokeadjust known { true setstrokeadjust } if x2 x1 sub 1 add { x1 +%% DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) +%% a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore } +%% def +%a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore +%pop pop } def +%% DG/SR modification end +% +/BeginArrow { ADict begin /@mtrx CM def gsave 2 copy T 2 index sub neg +exch 3 index sub exch Atan rotate newpath } def +/EndArrow { @mtrx setmatrix CP grestore end } def +/Arrow { CLW mul add dup 2 div /w ED mul dup /h ED mul /a ED { 0 h T 1 -1 +scale } if w neg h moveto 0 0 L w h L w neg a neg rlineto gsave fill +grestore } def +/Tbar { CLW mul add /z ED z -2 div CLW 2 div moveto z 0 rlineto stroke 0 +CLW moveto } def +/Bracket { CLW mul add dup CLW sub 2 div /x ED mul CLW add /y ED /z CLW 2 +div def x neg y moveto x neg CLW 2 div L x CLW 2 div L x y L stroke 0 +CLW moveto } def +/RoundBracket { CLW mul add dup 2 div /x ED mul /y ED /mtrx CM def 0 CLW +2 div T x y mul 0 ne { x y scale } if 1 1 moveto .85 .5 .35 0 0 0 +curveto -.35 0 -.85 .5 -1 1 curveto mtrx setmatrix stroke 0 CLW moveto } +def +/SD { 0 360 arc fill } def +/EndDot { { /z DS def } { /z 0 def } ifelse /b ED 0 z DS SD b { 0 z DS +CLW sub SD } if 0 DS z add CLW 4 div sub moveto } def +/Shadow { [ { /moveto load } { /lineto load } { /curveto load } { +/closepath load } /pathforall load stopped { pop pop pop pop CP /moveto +load } if ] cvx newpath 3 1 roll T exec } def +/NArray { aload length 2 div dup dup cvi eq not { exch pop } if /n exch +cvi def } def +/NArray { % holds the coordinates and on top of stack the showpoints boolean + /f ED + counttomark 2 div dup cvi /n ED + n eq not { exch pop } if + f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse +} def +/Line { + NArray n 0 eq not + { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub def + n { Lineto } repeat + CP 4 2 roll ArrowB L pop pop + } if +} def +/Arcto { /a [ 6 -2 roll ] cvx def a r /arcto load stopped { 5 } { 4 } + ifelse { pop } repeat a } def +/CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq + and { pop pop /n n 1 sub def } if } def +/Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop } + repeat } { n 3 gt { CheckClosed } if n 2 mul -2 roll /y0 ED /x0 ED /y1 + ED /x1 ED x1 y1 /x1 x0 x1 add 2 div def /y1 y0 y1 add 2 div def x1 y1 + moveto /n n 2 sub def n { Lineto } repeat x1 y1 x0 y0 6 4 roll Lineto + Lineto pop pop closepath } ifelse } def +/Diamond { + /mtrx CM def + T rotate + /h ED + /w ED + dup 0 eq { pop } { CLW mul neg + /d ED + /a w h Atan def + /h d a sin Div h add def + /w d a cos Div w add def } ifelse + mark w 2 div h 2 div w 0 0 h neg w neg 0 0 h w 2 div h 2 div + /ArrowA { moveto } def + /ArrowB { } def + false Line + closepath mtrx setmatrix } def +% DG modification begin - Jan. 15, 1997 +%/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup 0 eq { +%pop } { CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 +%div dup cos exch sin Div mul sub def } ifelse mark 0 d w neg d 0 h w d 0 +%d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx +%setmatrix } def +/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup +CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 +div dup cos exch sin Div mul sub def mark 0 d w neg d 0 h w d 0 +d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx +% DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) +% setmatrix } def +setmatrix pop } def +% DG/SR modification end +/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth +def } def +/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth +def } def +/CC { /l0 l1 def /x1 x dx sub def /y1 y dy sub def /dx0 dx1 def /dy0 dy1 +def CCA /dx dx0 l1 c exp mul dx1 l0 c exp mul add def /dy dy0 l1 c exp +mul dy1 l0 c exp mul add def /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos +abs b exp a mul dx dy Pyth Div 2 div def /x2 x l0 dx mul m mul sub def +/y2 y l0 dy mul m mul sub def /dx l1 dx mul m mul neg def /dy l1 dy mul +m mul neg def } def +/IC { /c c 1 add def c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } +ifelse /a a 2 mul 3 div 45 cos b exp div def CCA /dx 0 def /dy 0 def } +def +/BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def +/NC { CC x1 y1 x2 y2 x y curveto } def +/EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def +/BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def +/NAC { x2 y2 x y curveto CC x1 y1 } def +/EAC { x2 y2 x y ArrowB curveto pop pop } def +/OpenCurve { + NArray n 3 lt + { n { pop pop } repeat } + { BOC /n n 3 sub def n { NC } repeat EOC } ifelse +} def +/AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload +/Points ED n 2 mul -2 roll } { false NArray } ifelse n 4 lt { n { pop +pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def +/ClosedCurve { NArray n 3 lt { n { pop pop } repeat } { n 3 gt { +CheckClosed } if 6 copy n 2 mul 6 add 6 roll IC CC x y moveto n { NC } +repeat closepath pop pop } ifelse } def +/SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def +/ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def +/SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore } +def +/FontDot { DS 2 mul dup matrix scale matrix concatmatrix exch matrix +rotate matrix concatmatrix exch findfont exch makefont setfont } def +/Rect { x1 y1 y2 add 2 div moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto +x1 y1 lineto closepath } def +/OvalFrame { x1 x2 eq y1 y2 eq or { pop pop x1 y1 moveto x2 y2 L } { y1 +y2 sub abs x1 x2 sub abs 2 copy gt { exch pop } { pop } ifelse 2 div +exch { dup 3 1 roll mul exch } if 2 copy lt { pop } { exch pop } ifelse +/b ED x1 y1 y2 add 2 div moveto x1 y2 x2 y2 b arcto x2 y2 x2 y1 b arcto +x2 y1 x1 y1 b arcto x1 y1 x1 y2 b arcto 16 { pop } repeat closepath } +ifelse } def +/Frame { CLW mul /a ED 3 -1 roll 2 copy gt { exch } if a sub /y2 ED a add +/y1 ED 2 copy gt { exch } if a sub /x2 ED a add /x1 ED 1 index 0 eq { +pop pop Rect } { OvalFrame } ifelse } def +/BezierNArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop +} if n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat f { ] +aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def +/OpenBezier { BezierNArray n 1 eq { pop pop } { ArrowA n 4 sub 3 idiv { 6 +2 roll 4 2 roll curveto } repeat 6 2 roll 4 2 roll ArrowB curveto } +ifelse } def +/ClosedBezier { BezierNArray n 1 eq { pop pop } { moveto n 1 sub 3 idiv { +6 2 roll 4 2 roll curveto } repeat closepath } ifelse } def +/BezierShowPoints { gsave Points aload length 2 div cvi /n ED moveto n 1 +sub { lineto } repeat CLW 2 div SLW [ 4 4 ] 0 setdash stroke grestore } +def +/Parab { /y0 exch def /x0 exch def /y1 exch def /x1 exch def /dx x0 x1 +sub 3 div def /dy y0 y1 sub 3 div def x0 dx sub y0 dy add x1 y1 ArrowA +x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB curveto /Points [ x1 y1 x0 +y0 x0 2 mul x1 sub y1 ] def } def +/Grid { newpath /a 4 string def /b ED /c ED /n ED cvi dup 1 lt { pop 1 } +if /s ED s div dup 0 eq { pop 1 } if /dy ED s div dup 0 eq { pop 1 } if +/dx ED dy div round dy mul /y0 ED dx div round dx mul /x0 ED dy div +round cvi /y2 ED dx div round cvi /x2 ED dy div round cvi /y1 ED dx div +round cvi /x1 ED /h y2 y1 sub 0 gt { 1 } { -1 } ifelse def /w x2 x1 sub +0 gt { 1 } { -1 } ifelse def b 0 gt { /z1 b 4 div CLW 2 div add def +/Helvetica findfont b scalefont setfont /b b .95 mul CLW 2 div add def } +if systemdict /setstrokeadjust known { true setstrokeadjust /t { } def } +{ /t { transform 0.25 sub round 0.25 add exch 0.25 sub round 0.25 add +exch itransform } bind def } ifelse gsave n 0 gt { 1 setlinecap [ 0 dy n +div ] dy n div 2 div setdash } { 2 setlinecap } ifelse /i x1 def /f y1 +dy mul n 0 gt { dy n div 2 div h mul sub } if def /g y2 dy mul n 0 gt { +dy n div 2 div h mul add } if def x2 x1 sub w mul 1 add dup 1000 gt { +pop 1000 } if { i dx mul dup y0 moveto b 0 gt { gsave c i a cvs dup +stringwidth pop /z2 ED w 0 gt {z1} {z1 z2 add neg} ifelse h 0 gt {b neg} +{z1} ifelse rmoveto show grestore } if dup t f moveto g t L stroke /i i +w add def } repeat grestore gsave n 0 gt +% DG/SR modification begin - Nov. 7, 1997 - Patch 1 +%{ 1 setlinecap [ 0 dx n div ] dy n div 2 div setdash } +{ 1 setlinecap [ 0 dx n div ] dx n div 2 div setdash } +% DG/SR modification end +{ 2 setlinecap } ifelse /i y1 def /f x1 dx mul +n 0 gt { dx n div 2 div w mul sub } if def /g x2 dx mul n 0 gt { dx n +div 2 div w mul add } if def y2 y1 sub h mul 1 add dup 1000 gt { pop +1000 } if { newpath i dy mul dup x0 exch moveto b 0 gt { gsave c i a cvs +dup stringwidth pop /z2 ED w 0 gt {z1 z2 add neg} {z1} ifelse h 0 gt +{z1} {b neg} ifelse rmoveto show grestore } if dup f exch t moveto g +exch t L stroke /i i h add def } repeat grestore } def +/ArcArrow { /d ED /b ED /a ED gsave newpath 0 -1000 moveto clip newpath 0 +1 0 0 b grestore c mul /e ED pop pop pop r a e d PtoC y add exch x add +exch r a PtoC y add exch x add exch b pop pop pop pop a e d CLW 8 div c +mul neg d } def +/Ellipse { /mtrx CM def T scale 0 0 1 5 3 roll arc mtrx setmatrix } def +% +/ArcAdjust { +% given a target length (targetLength) and an initial angle (angle0) [in the stack], +% let M(angle0)=(rx*cos(angle0),ry*sin(angle0))=(x0,y0). +% This computes an angle t such that (x0,y0) is at distance targetLength from the point M(t)=(rx*cos(t),ry*sin(t)). +% NOTE: this an absolute angle, it does not have to be added or substracted to angle0 +% contrary to TvZ's code. +% To achieve, this, one iterates the following process: start with some angle t, +% compute the point M' at distance targetLength of (x0,y0) on the semi-line [(x0,y0) M(t)]. +% Now take t' (= new angle) so that (0,0) M(t') and M' are aligned. +% +% Another difference with TvZ's code is that we need d (=add/sub) to be defined. +% the value of d = add/sub is used to know on which side we have to move. +% It is only used in the initialisation of the angle before the iteration. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Input stack: 1: target length 2: initial angle +% variables used : rx, ry, d (=add/sub) +% + /targetLength ED /angle0 ED + /x0 rx angle0 cos mul def + /y0 ry angle0 sin mul def +% we are looking for an angle t such that (x0,y0) is at distance targetLength from the point M(t)=(rx*cos(t),ry*sin(t))) +%initialisation of angle (using 1st order approx = TvZ's code) + targetLength 57.2958 mul + angle0 sin rx mul dup mul + angle0 cos ry mul dup mul + add sqrt div +% if initialisation angle is two large (more than 90 degrees) set it to 90 degrees +% (if the ellipse is very curved at the point where we draw the arrow, the value can be much more than 360 degrees !) +% this should avoid going on the wrong side (more than 180 degrees) or go near +% a bad attractive point (at 180 degrees) + dup 90 ge { pop 90 } if + angle0 exch d +% maximum number of times to iterate the iterative procedure: + 30 +% iterative procedure: takes an angle t on top of stack, computes a better angle (an put it on top of stack) + { dup +% compute distance D between (x0,y0) and M(t) + dup cos rx mul x0 sub dup mul exch sin ry mul y0 sub dup mul add sqrt +% if D almost equals targetLength, we stop + dup targetLength sub abs 1e-5 le { pop exit } if +% stack now contains D t +% compute the point M(t') at distance targetLength of (x0,y0) on the semi-line [(x0,y0) M(t)]: +% M(t')= ( (x(t)-x0)*targetLength/d+x0 , (y(t)-y0)*targetLength/d+y0 ) + exch dup cos rx mul x0 sub exch sin ry mul y0 sub +% stack contains: y(t)-y0, x(t)-x0, d + 2 index Div targetLength mul y0 add ry Div exch + 2 index Div targetLength mul x0 add rx Div +% stack contains x(t')/rx , y(t')/ry , d +% now compute t', and remove D from stack + atan exch pop + } repeat +% we don't look at what happened... in particular, if targetLength is greater than the diameter of the ellipse... +% the final angle will be around /angle0 + 180. maybe we should treat this pathological case... +%after iteration, stack contains an angle t such that M(t) is the tail of the arrow +% to give back the result as a an angle relative to angle0 we could add the following line: +% angle0 sub 0 exch d +% +} def +% +/EllipticArcArrow { + /d ED % add/sub + /b ED % arrow procedure + /a1 ED % angle + gsave + newpath + 0 -1000 moveto + clip % Set clippath far from arrow. + newpath + 0 1 0 0 b % Draw arrow to determine length. + grestore +% Length of arrow is on top of stack. Next 3 numbers are junk. +% + a1 exch ArcAdjust % Angular position of base of arrow. + /a2 ED + pop pop pop + a2 cos rx mul x add + a2 sin ry mul y add + a1 cos rx mul x add + a1 sin ry mul y add +% Now arrow tip coor and base coor are on stack. + b pop pop pop pop % Draw arrow, and discard coordinates. + a2 CLW 8 div +% change value of d (test it by looking if `` 1 1 d '' gives 2 or not ) + 1 1 d 2 eq { /d { sub } def } { /d { add } def } ifelse + ArcAdjust +% resets original value of d + 1 1 d 2 eq { /d { sub } def } { /d { add } def } ifelse % Adjust angle to give overlap. +} def +%%------------------ tvz/DG/hv (2004-05-10) end -------------------%% +% +/Rot { CP CP translate 3 -1 roll neg rotate NET } def +/RotBegin { tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 } +def } if /TMatrix [ TMatrix CM ] cvx def /a ED a Rot /RAngle [ RAngle +dup a add ] cvx def } def +/RotEnd { /TMatrix [ TMatrix setmatrix ] cvx def /RAngle [ RAngle pop ] +cvx def } def +/PutCoor { gsave CP T CM STV exch exec moveto setmatrix CP grestore } def +/PutBegin { /TMatrix [ TMatrix CM ] cvx def CP 4 2 roll T moveto } def +/PutEnd { CP /TMatrix [ TMatrix setmatrix ] cvx def moveto } def +/Uput { /a ED add 2 div /h ED 2 div /w ED /s a sin def /c a cos def /b s +abs c abs 2 copy gt dup /q ED { pop } { exch pop } ifelse def /w1 c b +div w mul def /h1 s b div h mul def q { w1 abs w sub dup c mul abs } { +h1 abs h sub dup s mul abs } ifelse } def +/UUput { /z ED abs /y ED /x ED q { x s div c mul abs y gt } { x c div s +mul abs y gt } ifelse { x x mul y y mul sub z z mul add sqrt z add } { q +{ x s div } { x c div } ifelse abs } ifelse a PtoC h1 add exch w1 add +exch } def +/BeginOL { dup (all) eq exch TheOL eq or { IfVisible not { Visible +/IfVisible true def } if } { IfVisible { Invisible /IfVisible false def +} if } ifelse } def +/InitOL { /OLUnit [ 3000 3000 matrix defaultmatrix dtransform ] cvx def +/Visible { CP OLUnit idtransform T moveto } def /Invisible { CP OLUnit +neg exch neg exch idtransform T moveto } def /BOL { BeginOL } def +/IfVisible true def } def +end +% END pstricks.pro |