diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-01 22:47:30 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-01 22:47:30 +0000 |
commit | 33a1fed6bf16c61516dd7ef7ecc7598f30ccd689 (patch) | |
tree | 7e3b173f85769f763ac002187d7a88f1219b69a0 /Master/texmf-dist/dvips | |
parent | 608fb06f9098a25c854017f05d2a20192083baf8 (diff) |
pst-fractal (1dec18)
git-svn-id: svn://tug.org/texlive/trunk@49295 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r-- | Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro | 83 |
1 files changed, 76 insertions, 7 deletions
diff --git a/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro b/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro index f0f0de007e9..fcdc69bb99a 100644 --- a/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro +++ b/Master/texmf-dist/dvips/pst-fractal/pst-fractal.pro @@ -1,4 +1,4 @@ -%% $Id: pst-fractal.pro 673 2017-12-02 22:04:41Z herbert $ +%% $Id: pst-fractal.pro 679 2017-12-04 21:41:23Z herbert $ %% %% This is file `pst-fractal.pro', %% @@ -16,7 +16,7 @@ %% `pst-fractal' is a PSTricks package to draw fractal objects %% %% -%% version 0.05 / 2017-12-02 Herbert Voss <hvoss _at_ tug.org> +%% version 0.06 / 2017-12-04 Herbert Voss <hvoss _at_ tug.org> % /tx@fractalDict 100 dict def tx@fractalDict begin @@ -150,7 +150,7 @@ tx@fractalDict begin P0 [ 0 2 Pi length 2 sub {/i exch def - Pi i get Pi i 1 add get Rot-90 + Pi i get Pi i 1 add get exch neg % Rot-90 } for ] /Pi exch def P0 Pi concatarray /P0 exch def @@ -167,7 +167,7 @@ tx@fractalDict begin /P2 {[ 0 2 P0 length 2 sub { /i exch def - P0 i get P0 i 1 add get Rot-90 + P0 i get P0 i 1 add get exch neg % Rot-90 2 cmunit coefficient mul add exch -2 cmunit coefficient mul add exch } for ] @@ -176,7 +176,7 @@ tx@fractalDict begin /P3 {[ 0 2 P0 length 2 sub { /i exch def - P0 i get P0 i 1 add get Rot-90 Rot-90 + P0 i get P0 i 1 add get neg exch neg exch % Rot-90 Rot-90 2 cmunit coefficient mul add exch 2 cmunit coefficient mul add exch } for @@ -184,7 +184,7 @@ tx@fractalDict begin % /P4 {[ 0 2 P0 length 2 sub {/i exch def - P0 i get P0 i 1 add get Rot-90 Rot-90 Rot-90 + P0 i get P0 i 1 add get neg exch % Rot-90 Rot-90 Rot-90 -2 cmunit coefficient mul add exch 2 cmunit coefficient mul add exch } for @@ -879,6 +879,75 @@ end grestore end } def - +% +/Rot2 { % Rot-90+translation + 2 dict begin + /y exch neg def /x exch def + y 2 n@ 1 add exp 1 sub add + x neg 2 n@ exp 1 sub add + end + } def +/Trans1 { + 2 dict begin + /y exch def /x exch def + x + y 2 n@ exp add + end +} def +/Trans2 { + 2 dict begin + /y exch def /x exch def + x 2 n@ exp add + y 2 n@ exp add + end +} def +% +/HilbertFractal { + /M0 [[0 0] [0 1] [1 1] [1 0]] def + /n@ 1 def + N@ { + /M1 [] def + /M2 [] def + /M3 [] def + /M4 [] def + 0 1 M0 length 1 sub {/i exch def + /M M0 i get def + /Mt [ + 0 2 M length 2 sub { + /k exch def + M k 2 getinterval + } for + ] def + M1 [Mt {aload pop exch } forall] concatarray /M1 exch def + M2 [Mt {aload pop Trans1} forall] concatarray /M2 exch def + M3 [Mt {aload pop Trans2} forall] concatarray /M3 exch def + M4 [Mt {aload pop Rot2 } forall] concatarray /M4 exch def + } for + /n@ n@ 1 add def + /M0 [M1 M2 M3 M4] def + } repeat +% tableau des points + /HilbertCurve [ + 0 1 M0 length 1 sub { + /i exch def + /lePt M0 i get def + 0 2 lePt length 2 sub { + /j exch def + lePt j get cmunit + lePt j 1 add get cmunit + } for + } for + ] def +% le dessin de la courbe + newpath + 0 0 moveto + 0 2 HilbertCurve length 2 sub { + /i exch def + i 2 div Npts ge {exit} if + HilbertCurve i get + HilbertCurve i 1 add get + lineto + } for +} def % end
\ No newline at end of file |