From 5412d52974c365e2d5bc1a8320816a729f7c10ab Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 11 Mar 2020 03:01:11 +0000 Subject: CTAN sync 202003110301 --- graphics/pstricks/contrib/pst-fractal/Changes | 1 + graphics/pstricks/contrib/pst-fractal/Makefile | 84 ++ graphics/pstricks/contrib/pst-fractal/README | 10 +- .../contrib/pst-fractal/doc/pst-fractal-doc.bib | 132 -- .../contrib/pst-fractal/doc/pst-fractal-doc.pdf | Bin 31954522 -> 0 bytes .../contrib/pst-fractal/doc/pst-fractal-doc.tex | 1589 -------------------- .../contrib/pst-fractal/dvips/pst-fractal.pro | 953 ------------ .../contrib/pst-fractal/images/crop-eps.sh | 8 + .../contrib/pst-fractal/latex/pst-fractal.sty | 12 - .../contrib/pst-fractal/pst-fractal-doc.bib | 132 ++ .../contrib/pst-fractal/pst-fractal-doc.pdf | Bin 0 -> 31952801 bytes .../contrib/pst-fractal/pst-fractal-doc.tex | 1589 ++++++++++++++++++++ .../pstricks/contrib/pst-fractal/pst-fractal.pro | 953 ++++++++++++ .../pstricks/contrib/pst-fractal/pst-fractal.sty | 12 + .../pstricks/contrib/pst-fractal/pst-fractal.tex | 738 +++++++++ .../contrib/pst-fractal/tex/pst-fractal.tex | 738 --------- 16 files changed, 3520 insertions(+), 3431 deletions(-) create mode 100644 graphics/pstricks/contrib/pst-fractal/Makefile delete mode 100644 graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.bib delete mode 100644 graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf delete mode 100644 graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex delete mode 100644 graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro create mode 100644 graphics/pstricks/contrib/pst-fractal/images/crop-eps.sh delete mode 100644 graphics/pstricks/contrib/pst-fractal/latex/pst-fractal.sty create mode 100644 graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.bib create mode 100644 graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.pdf create mode 100644 graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.tex create mode 100644 graphics/pstricks/contrib/pst-fractal/pst-fractal.pro create mode 100644 graphics/pstricks/contrib/pst-fractal/pst-fractal.sty create mode 100644 graphics/pstricks/contrib/pst-fractal/pst-fractal.tex delete mode 100644 graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex (limited to 'graphics') diff --git a/graphics/pstricks/contrib/pst-fractal/Changes b/graphics/pstricks/contrib/pst-fractal/Changes index a6f08b3fac..8749766a19 100644 --- a/graphics/pstricks/contrib/pst-fractal/Changes +++ b/graphics/pstricks/contrib/pst-fractal/Changes @@ -8,6 +8,7 @@ pst-fractal.pro -------- pst-fractal.tex -------- +0.11 2020-03-10 - fixed trailing space in \pstKochflake 0.10 2018-11-10 - added Cantor set 0.09 2017-12-02 - added fibinacci curves 0.08 2017-11-26 - added sierpinski curve diff --git a/graphics/pstricks/contrib/pst-fractal/Makefile b/graphics/pstricks/contrib/pst-fractal/Makefile new file mode 100644 index 0000000000..8353dad340 --- /dev/null +++ b/graphics/pstricks/contrib/pst-fractal/Makefile @@ -0,0 +1,84 @@ + +# `Makefile' for `pst-fractal.pdf', hv, 2007/04/05 + +.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps + +PACKAGE = pst-fractal + +MAIN = $(PACKAGE)-doc + +LATEX = latex + +ARCHNAME = $(MAIN)-$(shell date +%y%m%d) + +ARCHFILES = $(PACKAGE).sty $(PACKAGE).tex $(PACKAGE).pro $(MAIN).tex README Changes Makefile + +TDS = ~/PSTricks/PSTricks-TDS + +all : doc clean +doc: $(MAIN).pdf + +$(MAIN).pdf : $(MAIN).ps + GS_OPTIONS=-dAutoRotatePages=/None ps2pdf $< + +$(MAIN).ps : $(MAIN).dvi + dvips $< + +$(MAIN).dvi : $(MAIN).tex + $(LATEX) $< + $(LATEX) $< + if ! test -f $(basename $<).glo ; then touch $(basename $<).glo; fi + if ! test -f $(basename $<).idx ; then touch $(basename $<).idx; fi + makeindex -s gglo.ist -t $(basename $<).glg -o $(basename $<).gls \ + $(basename $<).glo + makeindex -t $(basename $<).ilg -o $(basename $<).ind \ + $(basename $<).idx + biber $(basename $<) + $(LATEX) $< + $(LATEX) $< + +clean : + $(RM) $(addprefix $(MAIN), .log .aux .glg .glo .gls .ilg .idx .ind .tmp .toc .out .blg .Roessler .bbl ) + $(RM) $(addprefix $(MAIN), .dvi .ps .bcf .run.xml) + +veryclean : clean + $(RM) $(addprefix $(MAIN), .pdf .bbl .blg) + +arch : + zip $(ARCHNAME).zip $(ARCHFILES) + +tds: + cp Changes $(TDS)/doc/generic/$(PACKAGE)/ + cp README $(TDS)/doc/generic/$(PACKAGE)/ + cp $(MAIN).pdf $(TDS)/doc/generic/$(PACKAGE)/ +# + cp Changes $(TDS)/tex/latex/$(PACKAGE)/ + cp $(PACKAGE).sty $(TDS)/tex/latex/$(PACKAGE)/ +# + cp Changes $(TDS)/tex/generic/$(PACKAGE)/ + cp $(PACKAGE).tex $(TDS)/tex/generic/$(PACKAGE)/ +# + cp Changes $(TDS)/dvips/$(PACKAGE)/ + cp $(PACKAGE).pro $(TDS)/dvips/$(PACKAGE)/ +# + cp Changes $(TDS)/source/$(PACKAGE)/ + cp $(MAIN).tex $(TDS)/source/$(PACKAGE)/ + cp $(MAIN).bib $(TDS)/source/$(PACKAGE)/ + cp Makefile $(TDS)/source/$(PACKAGE)/ +# cp -r images $(TDS)/source/$(PACKAGE)/ + + +ctan: + rm -f .ctan/$(PACKAGE)/latex/* + cp *.sty .ctan/$(PACKAGE)/latex/ + rm -f .ctan/$(PACKAGE)/tex/* + cp $(PACKAGE).tex .ctan/$(PACKAGE)/tex/ + cp $(PACKAGE).pro .ctan/$(PACKAGE)/dvips/ + cp $(PACKAGE).pro ~/Links/dvips-local/ + rm -f .ctan/$(PACKAGE)/doc/* + cp $(PACKAGE)-doc.* .ctan/$(PACKAGE)/doc/ + cp Changes .ctan/$(PACKAGE)/ + cp README .ctan/$(PACKAGE)/ + chmod -R a+r .ctan/$(PACKAGE) + +# EOF diff --git a/graphics/pstricks/contrib/pst-fractal/README b/graphics/pstricks/contrib/pst-fractal/README index 9bbab9f8cd..2eaef4e037 100644 --- a/graphics/pstricks/contrib/pst-fractal/README +++ b/graphics/pstricks/contrib/pst-fractal/README @@ -1,13 +1,7 @@ pst-fractal: plotting fractals -Save the files pst-fractal.sty|tex in a directory, which is part of your -local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/ -Then do not forget to run texhash to update this tree. -For more information see the documentation of your LATEX distribution -on installing packages into your local TeX system. - PSTricks is PostScript Tricks, the documentation cannot be run -with pdftex, use the sequence latex->dvips->ps2pdf. +with pdftex, use the sequence latex->dvips->ps2pdf or run xelatex. To gett he documentation of this document you have to run pst2pdf pst-fractal-doc --Iext=.jpg @@ -15,3 +9,5 @@ pst2pdf pst-fractal-doc --Iext=.jpg %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives %% in directory macros/latex/base/lppl.txt. + +hvoss@tug.org \ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.bib b/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.bib deleted file mode 100644 index a140094051..0000000000 --- a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.bib +++ /dev/null @@ -1,132 +0,0 @@ -@STRING{tugboat = {TUGboat} } -@STRING{beiprogramm = {{\TeX}-Beiprogramm} } -@STRING{bretter = {Bretter, die die Welt bedeuten} } -@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} } -@STRING{editorial = {Editorial} } -@STRING{fremdebuehne = {Von fremden B{\"u}hnen} } -@STRING{fundus = {Aus dem Fundus} } -@STRING{hinterbuehne = {Hinter der B{\"u}hne} } -@STRING{leserbrief = {Leserbrief(e)} } -@STRING{magazin = {Magazin} } -@STRING{rezension = {Rezensionen} } -@STRING{schonimmer = {Was Sie schon immer {\"u}ber {\TeX} wissen wollten \dots} } -@STRING{theaterkasse = {Von der Theaterkasse} } -@STRING{theatertage = {{\TeX}-Theatertage} } - - -@Article{ dtk02.1:voss:mathematischen, - author = {Herbert Voß}, - title = {Die mathematischen {F}unktionen von {P}ost{S}cript}, - journal = dtk, - year = 2002, - volume = {1/02}, - altvolume = 1, - altnumber = 14, - month = mar, - pages = {}, - annote = bretter, - keywords = {}, - abstract = { \PS, faktisch genauso alt wie {\TeX}, ist im - Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es - darum geht zu beurteilen, was es denn nun im eigentlichen - Sinne ist. Außerdem wird h{\"a}ufig vergessen, dass - sich mit den \PS-Funktionen viele Dinge erledigen lassen, - bei denen sonst auf externe Programme zur{\"u}ckgegriffen - wird. Dies wird im Folgenden f{\"u}r die mathematischen - Funktionen im Zusammenhang mit dem Paket \texttt{pst-plot} - gezeigt. } -} - -@Book{tlgc2, - author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Voß}, - title = {The {\LaTeX} {G}raphics {C}ompanion}, - publisher = {{Addison-Wesley Publishing Company}}, - edition = 2, - year = {2007}, - address = {Reading, Mass.} -} - - -@Article{girou:01:, - author = {Denis Girou}, - title = {Pr\'esentation de {PST}ricks}, - journal = {Cahier {GUT}enberg}, - year = 1994, - volume = {16}, - month = apr, - pages = {21-70} -} - -@Article{girou:02:, - author = {{Timothy van} Zandt and Denis Girou}, - title = {Inside {PST}ricks}, - journal = TUGboat, - year = 1994, - volume = {15}, - month = sep, - pages = {239-246} -} - -@Book{PostScript, - Author = {Kollock, Nikolai G.}, - Title = {Post{S}cript richtig eingesetzt: vom {K}onzept zum - praktischen {E}insatz}, - Publisher = {IWT}, - Address = {Vaterstetten}, - year = 1989, -} - -@online{pstricks, - Title = {PSTricks - {\PS} macros for generic {\TeX}}, - Author = {{Timothy van} Zandt}, - Organization = {}, - url = {http://www.tug.org/application/PSTricks}, - year = 1993 -} - -@Book{PSTricks2, - author = {Herbert Voß}, - title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, - edition = {7}, - publisher = {DANTE -- Lehmanns}, - year = {2016}, - publisher = {Heidelberg and Berlin} -} - -@Book{PSTricks2-UIT, - author = {Herbert Voß}, - title = {PSTricks -- Graphics for \TeX\ and \LaTeX}, - publisher = {UIT}, - year = {2011}, - address = {Cambridge} -} - -@Book{LaTeXRef-UIT, - author = {Herbert Voß}, - title = {{\LaTeX} quick reference}, - publisher = {UIT}, - year = {2012}, - address = {Cambridge} -} - -@online{wolfram, - author = {Eric Weisstein}, - title = {Wolfram MathWorld}, - publisher = {{Wolfram}}, - year = {2007}, - url = {http://mathworld.wolfram.com} -} - -@ctan{pst-tools, - author = {Herbert Voß}, - title = {\texttt{pst-tools} -- Helper functions}, - year = {2012}, - url = {/graphics/pstricks/contrib/pst-tools} -} - -@online{ramirez, -title= {Properties and Generalizations of the Fibonacci Word Fractal Exploring Fractal Curves}, -url = {http://www.mathematica-journal.com/2014/02/properties-and-generalizations-of-the-fibonacci-word-fractal/}, -author= {José L. Ramírez and Gustavo N. Rubiano}, -} - \ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf b/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf deleted file mode 100644 index 28dfccc6a0..0000000000 Binary files a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.pdf and /dev/null differ diff --git a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex b/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex deleted file mode 100644 index 884b7d5079..0000000000 --- a/graphics/pstricks/contrib/pst-fractal/doc/pst-fractal-doc.tex +++ /dev/null @@ -1,1589 +0,0 @@ -%% $Id: pst-fractal-doc.tex 846 2018-11-30 21:44:45Z herbert $ -\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=13,toc=bibliography,parskip=false, - headings=small, headinclude=false,footinclude=false,oneside]{pst-doc} -\usepackage[utf8]{inputenc} -\usepackage{pst-fractal} -\let\pstFV\fileversion -\renewcommand\bgImage{\includegraphics[scale=0.75]{images/demo}} -\def\PSLenv{\Lenv{pspicture}} -\usepackage{animate} - - -\def\pSTilingsFibonacci#1#2#3{% #1=n #2=nbre de lignes #3=type 1 ou 2 - \pstFPDiv\Nbr{#2}{2}% - \psset[pst-fractal]{n=#1}% - \pstVerb{/n0 #1 def /tabPell [0 1 2 5 12 29 70 169 408] def - /Type #3 def - Type 2 gt {/Type 1 def} if - Type 2 eq { -% (-1)^2P(n),(P(n+1) - /Y1 tabPell n0 1 add get def - /X1 -1 n0 exp tabPell n0 get mul def - }{ -% (P(n+1),(-1)^2P(n) - /X1 tabPell n0 1 add get def - /Y1 -1 n0 exp tabPell n0 get mul def - } ifelse - % le déplacement perpendiculaire - /X2 Y1 neg def - /Y2 X1 def -}% -\pstVerb{/ListColors [0 0 1] def}% -\multido{\I=-\Nbr+1}{#2}{5 \rput(!X2 \I\space mul Y2 \I\space mul){% - \multido{\i=-\Nbr+1}{#2}{% -%\definecolor[ps]{Couleur}{rgb}{ListColors aload pop}% - \definecolor[ps]{Couleur}{cmyk}{ListColors aload pop 0}% - \rput(!X1 \i\space mul Y1 \i\space mul){\psFibonacciPolyominoes[fillcolor=Couleur]}% - \pstVerb{/ListColors [ListColors aload pop 3 1 roll] def}% -}}}}% - - - -%\usepackage{auto-pst-pdf} - -\addbibresource{\jobname.bib} -\lstset{language=PSTricks,basicstyle=\footnotesize\ttfamily} -% -\begin{document} - -\title{\texttt{pst-fractal}} -\subtitle{Plotting fractals; v.\pstFV} -\author{Herbert Vo\ss} -\docauthor{} -\date{\today} -\maketitle - -\tableofcontents - -\vspace{3cm} - - -\begin{abstract} -\noindent -The well known \LPack{pstricks} package offers excellent macros to insert more or less complex -graphics into a document. \LPack{pstricks} itself is the base for several other additional packages, -which are mostly named \verb+pst-xxxx+, like \LPack{pst-fractal}. - -This version uses the extended keyval package \LPack{xkeyval}, so be sure that you have installed -this package together with the spcecial one \LPack{pst-xkey} for PSTricks. The \LPack{xkeyval} -package is available at \url{CTAN:/macros/latex/contrib/xkeyval/}. -It is also important that after \LPack{pst-fractal} no package is loaded, which uses the old keyval interface. - -The fractals are really big, which is the reason why this document is about 15 MByte -when you run it without using the external png-images. -\end{abstract}% - -All images in this documentation were converted to the \Lext{jpg} format to get -a small pdf file size. When using the pdf format for the images the file size will be -more than 20 MBytes. However, having a small file size will lead into a bad image -resolution. Run the examples as single documents to see how it will be in -high quality. - - -\section{Cantor set} - -The set is always plotted from the origin down to into negative $y$ values. - -\begin{BDef} -\Lcs{psCantor}\OptArgs\\ -\end{BDef} - -Possible optional arguments are \Lkeyword{linewidth}, \Lkeyword{linecolor}, -\Lkeyword{n} (recursion depth), \Lkeyword{xWidth}, and \Lkeyword{yWidth} (vertical increment). -The defaults are 2mm, black, 5, 10cm, and 5mm. - -\begin{LTXexample}[pos=l] -\begin{pspicture}(10,-2) - \psCantor -\end{pspicture} -\end{LTXexample} - - -\begin{LTXexample}[pos=l] -\begin{pspicture}(10,-2) - \psCantor[linewidth=3mm,linecolor=red, - n=7,xWidth=11,yWidth=4mm] -\end{pspicture} -\end{LTXexample} - - -\section{Sierpinski triangle and curve} - -The triangle must be given by three mandatory arguments. Depending to the kind of -arguments it is one of the two possible versions: - -\begin{BDef} -\Lcs{psSier}\OptArgs\coord0\coord1\coord2\\ -\Lcs{psSier}\OptArgs\coord0\Largb{Base}\Largb{Recursion}\\ -\Lcs{psSier}\OptArgs -\end{BDef} - -\subsection{Triangle} -In difference to \Lcs{psfractal} it doesn't reserve any space, this is the -reason why it should be part of a \PSLenv{} environment. - -\begin{LTXexample}[pos=l] -\begin{pspicture}(5,5) - \psSier(0,0)(2,5)(5,0) -\end{pspicture} -\end{LTXexample} - - -\begin{LTXexample}[pos=t] -\multido{\iA=1+1}{6}{% -\begin{pspicture}(2,1.7) -\psSier[linecolor=blue!70, - fillcolor=red!40](0,0){2cm}{\iA} -\end{pspicture} } -\end{LTXexample} - -\subsection{Curve} - -There are four special optional arguments for the Siepinski curve: -\begin{itemize} - \item \texttt{[n=4]} : number of iterations - \item \texttt{[N=all]} : number of placed points (only of interest for an animation) - \item \texttt{[dotcolor=red]} : in difference to linecolor for standard PSTricks - \item \texttt{[showpoints=false]} : show calculated points -\end{itemize} - -\begin{LTXexample}[pos=t] -\begin{pspicture}(-4,-4)(4,4) -\psframe*[linecolor=cyan](-4,-4)(4,4) -\psSier[unit=0.25,n=4,fillstyle=solid,fillcolor=yellow,linecolor=blue] -\psgrid[subgriddiv=0,gridcolor=blue,griddots=5,gridlabels=0pt,unit=0.5](-8,-8)(8,8) -\end{pspicture} -\end{LTXexample} - - -\begin{LTXexample}[pos=t] -\begin{pspicture}[showgrid](-4,-4)(4,4) -\psset{unit=0.25} -% n=4 => Nmax=4^(n+1)=1024 -% ici on marque la moitie des points -\psSier[n=4,N=512] -\end{pspicture} -\end{LTXexample} - - - -\begin{LTXexample}[pos=t] -\begin{pspicture}(-4,-4)(4,4) -\psframe*[linecolor=-yellow](-4,-4)(4,4) -\psSier[n=5,unit=0.125,fillstyle=solid,fillcolor=-cyan,linecolor=-blue] -\end{pspicture} -\end{LTXexample} - - -\begin{animateinline}[controls,% palindrome, - begin={\begin{pspicture}(-4,-4)(4,4)}, - end={\end{pspicture}}]{5}% 5 image/s -\multiframe{256}{i=1+1}{% - \psframe*[linecolor=yellow!20](-4,-4)(4,4) - \psgrid[subgriddiv=0,gridcolor=blue,griddots=5,gridlabels=0pt,unit=0.5](-8,-8)(8,8) -% n=3 => Nmax=4^(n+1)=256 points - \psSier[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.1,N=\i,unit=0.5]} -\end{animateinline} - - -\begin{verbatim} -\begin{animateinline}[controls,% palindrome, - begin={\begin{pspicture}(-4,-4)(4,4)}, - end={\end{pspicture}}]{5}% 5 image/s -\multiframe{256}{i=1+1}{% -\psframe*[linecolor=yellow!20](-4,-4)(4,4) -\psgrid[subgriddiv=0,gridcolor=blue,griddots=5,gridlabels=0pt,unit=0.5](-8,-8)(8,8) -% n=3 => Nmax=4^(n+1)=256 points -\psSierpinskyCurve[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.1,N=\i,unit=0.5]} -\end{animateinline} -\end{verbatim} - - - -\section{Julia and Mandelbrot sets} - -The syntax of the \Lcs{psfractal} macro is simple -% -\begin{BDef} -\Lcs{psfractal}\OptArgs\coord0\coord1 -\end{BDef} - - -All Arguments are optional, \Lcs{psfractal} is the same as \Lcs{psfractal}\verb+(-1,-1)(1,1)+. -The Julia and Mandelbrot sets are a graphical representation of the following sequence -$x$ is the real and $y$ the imaginary part of the complex number $z$. $C(x,y)$ is a complex constant -and preset by $(0,0)$. -\begin{align} -z_{n+1}(x,y) &= (z_n(x,y))^2 +C(x,y) -\end{align} - -\subsection{Julia sets} - -A Julia set is given with - -\begin{align} -z_{n+1}(x,y) &= (z_n(x,y))^2 +C(x,y)\\ -z_0 &= (x_0;y_0) -\end{align} -$(x_0;y_0)$ is the starting value. - -\psset{unit=1cm,opacity=0} - - - -\begin{LTXexample}[pos=l] -\psfractal -\end{LTXexample} - -\begin{LTXexample}[pos=l] -\psfractal[xWidth=4cm,yWidth=4cm, baseColor=white, dIter=20](-2,-2)(2,2) -\end{LTXexample} - - -\subsection{Mandelbrot sets} - -A Mandelbrot set is given with - -\begin{align} -z_{n+1}(x,y) &= (z_n(x,y))^2 +C(x,y)\\ -z_0 &= (0;0)\\ -C(x,y) &= (x_0;y_0) -\end{align} - -$(x_0;y_0)$ is the starting value. - -\begin{LTXexample}[pos=l] -\psfractal[type=Mandel] -\end{LTXexample} - - -\begin{LTXexample}[pos=l] -\psfractal[type=Mandel, xWidth=6cm, - yWidth=4.8cm, baseColor=white, - dIter=10](-2,-1.2)(1,1.2) -\end{LTXexample} - -\subsection{The options} - - -\subsection{\texttt{type}} -\Lkeyword{txpe} can be of \Lkeyval{Julia} (default) or \Lkeyval{Mandel}. - - -\begin{LTXexample}[pos=l] -\psfractal \qquad -\psfractal[type=Mandel] -\end{LTXexample} - -\subsection{\texttt{baseColor}} -The color for the convergent part is set by \Lkeyword{baseColor}. - -\begin{LTXexample} -\psfractal[xWidth=4cm,yWidth=4cm,dIter=30](-2,-2)(2,2) \qquad -\psfractal[xWidth=4cm,yWidth=4cm,baseColor=yellow,dIter=30](-2,-2)(2,2) -\end{LTXexample} - - -\subsection{\texttt{xWidth} and \texttt{yWidth}} -\Lkeyword{xWidth} and \Lkeyword{yWidth} - define the physical width of the fractal. - -\begin{LTXexample} -\psfractal[type=Mandel,xWidth=12.8cm,yWidth=10.8cm,dIter=5](-2.5,-1.3)(0.7,1.3) -\end{LTXexample} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\subsection{\texttt{cx} and \texttt{cy}}\xLkeyword{cx}\xLkeyword{cy} -Define the starting value for the complex constant number $C$. - -\begin{LTXexample} -\psset{xWidth=5cm,yWidth=5cm} -\psfractal[dIter=2](-2,-2)(2,2) \qquad -\psfractal[dIter=2,cx=-1.3,cy=0](-2,-2)(2,2) -\end{LTXexample} - - -\subsection{\texttt{dIter}} -The color is set by \Index{wavelength} to RGB conversion of the iteration number, where -\Lkeyword{dIter} is the step, predefined by 1. The wavelength is given by -the value of \Lps{iter} added by 400. - -\begin{LTXexample} -\psset{xWidth=5cm,yWidth=5cm} -\psfractal[dIter=30](-2,-2)(2,2) \qquad -\psfractal[dIter=10,cx=-1.3,cy=0](-2,-2)(2,2) -\end{LTXexample} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\subsection{\texttt{maxIter}} -\Lkeyword{maxIter} is the number of the maximum iteration until it leaves the loop. -It is predefined by 255, but internally multiplied by \Lkeyword{dIter}. - -\begin{LTXexample} -\psset{xWidth=5cm,yWidth=5cm} -\psfractal[maxIter=50,dIter=3](-2,-2)(2,2) \qquad -\psfractal[maxIter=30,cx=-1.3,cy=0](-2,-2)(2,2) -\end{LTXexample} - -\subsection{\texttt{maxRadius}} -If the square of distance of $z_n$ to the origin of the complex coordinate system -is greater as \Lkeyword{maxRadius} then the algorithm leaves the loop -and sets the point. \Lkeyword{maxRadius} should always be the square of the "`real"' -value, it is preset by 100. - -\begin{LTXexample} -\psset{xWidth=5cm,yWidth=5cm} -\psfractal[maxRadius=30,dIter=10](-2,-2)(2,2) \qquad -\psfractal[maxRadius=30,dIter=30,cx=-1.3,cy=0](-2,-2)(2,2) -\end{LTXexample} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% - -\subsection{\texttt{plotpoints}}\xLkeyword{plotpoints} -This option is only valid for the Sierpinski triangle and preset by 2000. - -\begin{LTXexample} -\begin{pspicture}(5,5) - \psSier(0,0)(2.5,5)(5,0) -\end{pspicture} \quad -\begin{pspicture}(5,5) - \psSier[plotpoints=10000](0,0)(2.5,5)(5,0) -\end{pspicture} -\end{LTXexample} - - - -\section{Phyllotaxis} -The beautiful arrangement of leaves in some plants, called phyllotaxis, -obeys a number of subtle mathematical relationships. For instance, the florets -in the head of a sunflower form two oppositely directed spirals: 55 of them clockwise -and 34 counterclockwise. Surprisingly, these numbers are consecutive Fibonacci numbers. -The Phyllotaxis is like a Lindenmayer system. - -\begin{BDef} -\Lcs{psPhyllotaxis}\OptArgs\Largr{\CAny} -\end{BDef} - -The coordinates of the center are optional, if they are missing, then $(0,0)$ -is assumed. - - -\begin{LTXexample}[pos=l] -\psframebox{% -\begin{pspicture}(-3,-3)(3,3) - \psPhyllotaxis -\end{pspicture}} -\end{LTXexample} - - - -\begin{LTXexample}[pos=l] -\psframebox{% -\begin{pspicture}(-3,-3)(4,4) - \psPhyllotaxis(1,1) -\end{pspicture}} -\end{LTXexample} - -\subsection{\texttt{angle}}\xLkeyword{angle} - -\begin{LTXexample}[pos=l] -\psframebox{% -\begin{pspicture}(-2.5,-2.5)(2.5,2.5) - \psPhyllotaxis[angle=99] -\end{pspicture}} -\end{LTXexample} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%% - - -\subsection{\texttt{c}}\xLkeyword{c} -This is the length of one element in the unit pt. - -\begin{LTXexample} -\psframebox{% -\begin{pspicture}(8,8) - \psPhyllotaxis[c=7](4,4) -\end{pspicture}} -\end{LTXexample} - -\begin{LTXexample} -\psframebox{% -\begin{pspicture}(-3,-3)(3,3) - \psPhyllotaxis[c=4,angle=111] -\end{pspicture}} -\end{LTXexample} - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%% - - -\subsection{\texttt{maxIter}}\xLkeyword{maxIter} -This is the number for the iterations. - -\begin{LTXexample} -\psframebox{% -\begin{pspicture}(-3,-3)(3,3) - \psPhyllotaxis[c=6,angle=111,maxIter=100] -\end{pspicture}} -\end{LTXexample} - - - -\section{Fern} - -\begin{BDef} -\Lcs{psFern}\OptArgs\Largr{\CAny} -\end{BDef} - -The coordinates of the starting point are optional, if they are missing, then $(0,0)$ -is assumed. The default \Lkeyword{scale} is set to 10. - -\begin{LTXexample} -\psframebox{% -\begin{pspicture}(-1,0)(1,4) - \psFern -\end{pspicture}} -\end{LTXexample} - -\begin{LTXexample} -\psframebox{% -\begin{pspicture}(-1,0)(2,5) - \psFern(1,1) -\end{pspicture}} -\end{LTXexample} - -\begin{LTXexample} -\psframebox{% -\begin{pspicture}(-3,0)(3,11) - \psFern[scale=30,maxIter=100000,linecolor=green] -\end{pspicture}} -\end{LTXexample} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\section{Koch flake} - -\begin{BDef} -\Lcs{psKochflake}\OptArgs\Largr{\CAny} -\end{BDef} - -The coordinates of the starting point are optional, if they are missing, then $(0,0)$ -is assumed. The origin is the lower left point of the flake, marked as red -or black point -in the following example: - -\begin{LTXexample} -\begin{pspicture}[showgrid=true](-2.4,-0.4)(5,5) - \psKochflake[scale=10] - \psdot[linecolor=red,dotstyle=*](0,0) -\end{pspicture} -\end{LTXexample} - -\begin{LTXexample} -\begin{pspicture}(-0.4,-0.4)(12,4) - \psset{fillcolor=lime,fillstyle=solid} - \multido{\iA=0+1,\iB=0+2}{6}{% - \psKochflake[angle=-30,scale=3,maxIter=\iA](\iB,2.5)\psdot*(\iB,2.5) - \psKochflake[scale=3,maxIter=\iA](\iB,0)\psdot*(\iB,0)} -\end{pspicture} -\end{LTXexample} - -Optional arguments are \Lkeyword{scale}, \Lkeyword{maxIter} (iteration depth) and \Lkeyword{angle} -for the first rotation angle. - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section{Apollonius circles} - -\begin{BDef} -\Lcs{psAppolonius}\OptArgs\Largr{\CAny} -\end{BDef} - -The coordinates of the starting point are optional, if they are missing, then $(0,0)$ -is assumed. The origin is the center of the circle: - -\begin{LTXexample} -\begin{pspicture}[showgrid=true](-4,-4)(4,4) - \psAppolonius[Radius=4cm] -\end{pspicture} -\end{LTXexample} - - -\begin{LTXexample} -\begin{pspicture}(-5,-5)(5,5) - \psAppolonius[Radius=5cm,Color] -\end{pspicture} -\end{LTXexample} - - -\section{Trees} - -\begin{BDef} -\Lcs{psPTree}\OptArgs\Largr{\CAny} -\Lcs{psFArrow}\OptArgs\Largr{\CAny}\Largb{fraction} -\end{BDef} - -The coordinates of the starting point are optional, if they are missing, then $(0,0)$ -is assumed. The origin is the center of the lower line, shown in the following examples -by the dot. Special parameters are the width of the lower basic line for the tree and the -height and angle for the arrow and for both the color option. The color step is given by \Lkeyword{dIter} -and the depth by \Lkeyword{maxIter}. Valid optional arguments are - -\medskip -\begin{center} -\begin{tabular}{@{}>{\ttfamily}lll@{}}\hline -\emph{Name} & \emph{Meaning} & \emph{default}\\\hline -\Lkeyword{xWidth} & first base width & 1cm\\ -\Lkeyword{minWidth} & last base width & 1pt\\ -\Lkeyword{c} & factor for unbalanced trees (0}(4.8,2)(3,2) -\psline[arrowinset=0.1,arrowsize=0.2]{->}(5,2.5)(5,4) -\end{pspicture} -\hfill -\begin{pspicture}[showgrid](0,0)(7,7) -\psFibonacci[unit=0.1,linecolor=blue,n=16,linewidth=0.04cm] -\rput(5,2){$F_{16}$} -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(8,5) -\psFibonacci[unit=0.05,linecolor=blue,n=17,linewidth=0.02cm,juxtaposition] -\rput(2.5,4){\blue$F_{17}$} -\rput(6,4){\red$F_{16}$} -\end{pspicture} -\hfill -\begin{pspicture}[showgrid](0,0)(8,5) -\psFibonacci[unit=0.05,n=18,linewidth=0.02cm] -\rput(4,4){$F_{18}$} -\end{pspicture} -\end{LTXexample} - - - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(10,7) -\psFibonacci[unit=0.1,linecolor=blue,n=16,linewidth=0.03cm,juxtaposition] -\rput(5,2){\blue$F_{16}$} -\rput(9,2){\red$F_{15}$} -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(10,7) -\psFibonacci[unit=0.1,n=17,linewidth=0.03cm] -\rput(5,2){$F_{17}$} -\end{pspicture} -\end{LTXexample} - - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(13,12) -\psFibonacci[unit=0.03,linecolor=blue,n=21,linewidth=0.02cm,juxtaposition] -\rput(1.5,3.5){\blue$F_{21}$} -\rput(8.5,10.5){\red$F_{20}$} -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(13,12) -\psFibonacci[unit=0.03,n=22,linewidth=0.025cm] -\rput(9,4){$F_{22}$} -\end{pspicture} -\end{LTXexample} - - - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(14,6) -\psFibonacci[unit=0.015,linecolor=blue,n=23,linewidth=0.01cm,juxtaposition] -\rput(4,2){\blue$F_{23}$} -\rput(10.5,4){\red$F_{22}$} -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(14,6) -\psFibonacci[unit=0.015,n=24,linewidth=0.01cm] -\rput(7,6.5){$F_{24}$} -\end{pspicture} -\end{LTXexample} - - - -\subsection{Curves with a big number of iterations} -With \texttt{n=30} it takes a long time and the number is not readable. - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(14,6) -\psFibonacci[unit=0.0025,n=30,linewidth=0.001cm] -\end{pspicture} -\end{LTXexample} - - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\subsection{Double color curves} - -Superposition of two curves are possible by choosing diffrent color and line thickness. - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-1,-1)(15,12) -\psgrid[style=gridstyleA] -\psFibonacci[unit=0.4,linecolor=blue,n=13,linewidth=0.2cm]% -\psFibonacci[unit=0.4,linecolor=red,n=13,linewidth=0.05cm]% -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-1,-1)(14,6) -\psFibonacci[unit=0.5,linecolor=red,n=12,linewidth=0.2cm]% -\psFibonacci[unit=0.5,linecolor=yellow,n=12,linewidth=0.05cm]% -\end{pspicture} -\end{LTXexample} - - - - -\section{``Dense Fibonacci Word'' and the command \Lcs{psNewFibonacci}}\label{dfw} - -In the chapter ``The dense Fibonacci word: a whole family of curves'', Alexis Monnerot-Dumaine -wrote: - -\begin{quote} -The odd-even design rule is not easy to manage and we can change to -a more practical rule. As Jean-Paul Allouche suggested, we can create a word of 3 -letters with \{0; 1; 2\} that can draw the Fibonacci fractal with the simplest drawing rules -following: - -\begin{itemize} -\item 0, draw a segment in line with the previous one -\item 1, draw a segment by turning to the right -\item 2, draw a segment by turning to the left -\end{itemize} -\end{quote} - - -By replacing in the Fibonacci word 00$\rightarrow$0, 01$\rightarrow$1 and 10$\rightarrow$2. Alexis Monnerot-Dumaine -defines the ``Dense Fibonacci Word'' (DFW). -From the DFW, we get a whole family of curves by doing, for example, substitutions -following: - -\begin{itemize} - \item $\mu_1$ : $1 \longrightarrow 10$ ; $0 \longrightarrow 12$ ; $2 \longrightarrow 02$ - \item $\mu_2$ : $1 \longrightarrow 010$ ; $0 \longrightarrow 0102$ ; $2 \longrightarrow 002$ - \item $\mu_3$ : $1 \longrightarrow 02$ ; $0 \longrightarrow 21$ ; $2 \longrightarrow 10$ - \item $\mu_4$ : $1 \longrightarrow 02$ ; $0 \longrightarrow 00$ ; $2 \longrightarrow 10$ -\end{itemize} - -We will find all these families of curves with explanations and references in the article -Alexis Monnerot-Dumaine. These are just brief explanations for using the commands -PSTricks to draw these families of curves. In their article "Properties and Gener- -Fractal Exploring Fractal Curves ``alizations of the Fibonacci'' \cite{ramirez} illustrate this -family of curves with Mathematica by designating them under the name of -New-Fibonacci. This name seems to me sensible the PSTricks command will be called \Lcs{psNewFibonacci}. - - -\subsection{``Dense Fibonacci Word''} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid=false](-1,-0.2)(10,2) -\uput[r](-0.5,1){FW=}% -\psFibonacciWord[n=10,fontscale=12](0.5,0.9) -\uput[r](-0.75,0){DFW=}% -\psFibonacciWord[n=10,DFW,fontscale=12](0.5,-0.1) -\end{pspicture} -\end{LTXexample} - - - -\subsection{Fractal of ``\textit{Dense Fibonacci Word}''} - -The curve can be created with \verb+\psNewFibonacci+ - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-3,0)(10,11) -\psNewFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm] -\rput(4,4){n=17} -\end{pspicture} -\end{LTXexample} - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-4,0)(6,10) -\psNewFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=() (1) (2)] -\rput(2,4){n=17} -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-1,0)(15,6) -\psNewFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=18,linewidth=0.03cm,morphism=(12) (1) (2)] -\rput(4,2){n=18} -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-7,0)(5,10) -\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(102) (2) (1)] -\rput(-2,4){n=17} -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-7,0)(4,10) -\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(210) (02) (10)] -\rput(-2,4){n=17} -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-5,0)(4,9) -\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(21) (02) (10)] -\rput(-1,4){n=17} -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-10,0)(4,12) -\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(210) (020) (10)] -\rput(-4,4){n=17} -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-10,0)(4,11) -\psNewFibonacci[unit=0.075,linecolor={[rgb]{0.5 0 0}},n=18,linewidth=0.025cm,morphism=(102) (2) (1)] -\rput(-4,2){n=18} -\end{pspicture} -\end{LTXexample} - - - - -\section{The command \Lcs{psiFibonacci}} - -\subsection{How it works} -Briefly, (read the article \cite{ramirez} for more details) more -``I-Fibonacci Word'' depends on the parameter i and the number of iterations n with the following rules, -according to the authors' notations: - -\begin{itemize} - \item $f_0^{[i]}$ =0 - \item $f_1^{[i]} =0^{i-1}1$ : this notation means that it is necessary to put (i-1) 0 before the 1 - \item $f_n^{[i]}= f_{n -1}^{[i]} f_{n -2}^{[i]}$ pour $n\geq 2$ et $i \geq 1$. -\end{itemize} - -The construction of the associated fractal curves follows the ``even-odd'' rule as for the fractal -of the word Fibonacci. - - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - - -\subsection{Examples} - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-7,0)(3,9) -\psiFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=3] -\end{pspicture} -\end{LTXexample} - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(9,9.5) -\psiFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=4] -\end{pspicture} -\end{LTXexample} - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-7,0)(3,9) -\psiFibonacci[unit=0.15,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=5] -\end{pspicture} -\end{LTXexample} - - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(9,9.5) -\psiFibonacci[unit=0.15,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=6] -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-6,0)(3,8) -\psiFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=7] -\end{pspicture} -\end{LTXexample} - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-8,0)(3,12) -\psiFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=11] -\end{pspicture} -\end{LTXexample} - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](0,0)(6,14) -\psiFibonacci[unit=0.05,linecolor={[rgb]{0.5 0 0}},n=12,linewidth=0.025cm,i=12] -\end{pspicture} -\end{LTXexample} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%% - - -\section{The command \Lcs{pskFibonacci}} -The 2 mandatory parameters are n and k. The following coordinates are optional but -put, possibly, to center the curve at the origin of the mark. - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-4,-4)(4,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\pskFibonacci[unit=0.02,linecolor={[rgb]{0 0 0.5}},linewidth=0.02cm,n=6,k=5](-2.3,-3.2) -\end{pspicture} -\end{LTXexample} - - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-4,-4)(4,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\pskFibonacci[unit=0.4,linecolor={[rgb]{0 0 0.5}},n=3,k=5](2.8,-3.6) -\end{pspicture} -\end{LTXexample} - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-4,-4)(4,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\pskFibonacci[unit=0.025,linecolor={[rgb]{0 0 0.5}},linewidth=0.02cm,n=6,k=6](3,0.5) -\end{pspicture} -\end{LTXexample} - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-4,-4)(4,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor={[rgb]{0 0 0.5}},griddots=10] -\pskFibonacci[unit=0.2,linecolor={[rgb]{0 0 0.5}},n=4,k=6,angle=60](-2,0) -\end{pspicture} -\end{LTXexample} - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-4,-4)(2,1) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\pskFibonacci[unit=0.1,linecolor={[rgb]{0 0 0.5}},n=4,k=4,angle=60](0,0) -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-8,-8)(8,8) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor={[rgb]{0 0 0.5}},griddots=10] -\pskFibonacci[unit=0.02,linecolor={[rgb]{0.5 0 0}},linewidth=0.02cm,n=6,k=7](6,-4) -\end{pspicture} -\end{LTXexample} - - - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section{The command \Lcs{psBiperiodicFibonacci}} -The 3 mandatory parameters are n, a and b. As for the previous command, the coordinates -following are optional but allow, eventually, to center the curve at the origin of the -mark. - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid=false](-4,-4)(4,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\psBiperiodicFibonacci[unit=0.2,linecolor={[rgb]{0 0.5 0}},linewidth=0.1cm,n=5,a=6,b=6,angle=60](0,2.1) -\psBiperiodicFibonacci[unit=0.2,linecolor=white,n=5,a=6,b=6,angle=60](0,2.1) -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid=false](-4,-4)(4,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\psBiperiodicFibonacci[unit=0.5,linecolor={[rgb]{0 0.5 0}},n=5,a=3,b=4,angle=120](-1.5,3.5) -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid=false](-4,-4)(4,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\psBiperiodicFibonacci[unit=0.2,linecolor=black,linewidth=0.1cm,n=7,a=2,b=6,angle=72](2.62,2) -\psBiperiodicFibonacci[unit=0.2,linecolor=yellow,n=7,a=2,b=6,angle=72](2.62,2) -\end{pspicture} -\end{LTXexample} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid=false](-5,-4)(5,4) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\psBiperiodicFibonacci[unit=0.1,linecolor=red,linewidth=0.1cm,n=10,a=2,b=5](3.5,-1.5) -\psBiperiodicFibonacci[unit=0.1,linecolor=yellow,n=10,a=2,b=5](3.5,-1.5) -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-5,-5)(5,5) -\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] -\psBiperiodicFibonacci[unit=0.15,linecolor={[rgb]{0 0.5 0}},n=9,a=2,b=5](3.15,-1.35) -\end{pspicture} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-5,-5)(5,5) -\psBiperiodicFibonacci[unit=0.8,linecolor=black,linewidth=0.1cm,,n=8,a=2,b=3,angle=120](-1,1) -\psBiperiodicFibonacci[unit=0.8,linecolor=white,n=8,a=2,b=3,angle=120](-1,1) -\end{pspicture} -\end{LTXexample} - - - -\section{The command \Lcs{psFibonacciPolyominoes}} - - -The only mandatory parameter is the order of the tile: n. Coordinates are optional, but -they will be used for paving the plan. - - - -\subsection{The order 0, 1, 2, 3, and 4} - -\psset{unit=1cm} -\begin{LTXexample} -\psset{linecolor={[rgb]{0 0.5 0}},fillstyle=solid,fillcolor=red} -\begin{pspicture}[showgrid](0,-1)(1,4) -\psFibonacciPolyominoes[n=0,unit=0.5] -\end{pspicture} -\quad -\begin{pspicture}[showgrid](-2,-1)(1,4) -\psFibonacciPolyominoes[n=1,unit=0.5] -\end{pspicture} -\quad -\begin{pspicture}[showgrid](-3,-1)(2,4) -\psFibonacciPolyominoes[unit=0.5,n=2] -\end{pspicture} -\quad -\begin{pspicture}[showgrid](-3,-1)(2,4) -\psFibonacciPolyominoes[unit=0.2cm,n=3] -\end{pspicture} -\end{LTXexample} - - - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}[showgrid](-7,-2)(4,10) -\psFibonacciPolyominoes[unit=0.2,n=4,fillcolor=cyan,linecolor=blue,fillstyle=solid] -\end{pspicture} -\end{LTXexample} - - - -\iffalse - - -\subsection{Paving the plan with Fibonacci tiles} -This tiling is done with the \Lcs{pSTilingsFibonacci}\Largb{n}\Largb{N}\Largb{T} command which has 3 arguments: the -first is the order of the tile (n = 0, 1, 2 etc.), the second the number of tiles per side of the square, -preferably it must be odd and T = 1 or 2 defines the type of paving. For tiles to be -colored, activate the \texttt{fillstyle=solid} option in a pre-command. - - -\begin{verbatim} -\def\pSTilingsFibonacci#1#2#3{% #1=n #2=nbre de lignes #3=type 1 ou 2 - \pstFPDiv\Nbr{#2}{2}% - \psset[pst-fractal]{n=#1}% - \pstVerb{/n0 #1 def /tabPell [0 1 2 5 12 29 70 169 408] def - /Type #3 def - Type 2 gt {/Type 1 def} if - Type 2 eq { - % (-1)^2P(n),(P(n+1) - /Y1 tabPell n0 1 add get def - /X1 -1 n0 exp tabPell n0 get mul def - }{ - % (P(n+1),(-1)^2P(n) - /X1 tabPell n0 1 add get def - /Y1 -1 n0 exp tabPell n0 get mul def - } ifelse - % le déplacement perpendiculaire - /X2 Y1 neg def - /Y2 X1 def -}% -\pstVerb{/ListColors [0 0 1] def}% -\multido{\I=-\Nbr+1}{#2}{5 - \rput(!X2 \I\space mul Y2 \I\space mul){% - \multido{\i=-\Nbr+1}{#2}{% -%\definecolor[ps]{Couleur}{rgb}{ListColors aload pop}% - \definecolor[ps]{Couleur}{cmyk}{ListColors aload pop 0}% - \rput(!X1 \i\space mul Y1 \i\space mul){\psFibonacciPolyominoes[fillcolor=Couleur]} - \pstVerb{/ListColors [ListColors aload pop 3 1 roll] def}% -}}}}% -\end{verbatim} - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture*}(-9,-7)(8,9) -\psset{unit=0.125,linestyle=solid} -\pSTilingsFibonacci{3}{13}{1}% -\psset{fillstyle=solid,linecolor=blue}% -\pSTilingsFibonacci{3}{7}{1}% -\end{pspicture*} -\end{LTXexample} - - - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture*}(-9,-7)(8,9) -\psset{unit=0.125,linestyle=solid} -\pSTilingsFibonacci{3}{13}{2}% -\psset{fillstyle=solid,linecolor=blue}% -\pSTilingsFibonacci{3}{7}{2}% -\end{pspicture*} -\end{LTXexample} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\fi - - -\section{The command \Lcs{psFibonacciWord}} - -\psset{unit=1cm} -\begin{LTXexample} -\begin{pspicture}(-1,0)(10,5) -\rput(0.15,5){\small$F_{1}=1$} -\rput(0.15,4.5){\small$F_{2}=0$} -\multido{\i=3+1,\I=3+1,\n=4.0+-0.5}{8}{% - \psFibonacciWord[n=\i](0.5,\n) - \rput(0,\n){$F_{\I}=$}} -\end{pspicture} -\end{LTXexample} - - -\begin{LTXexample} -\begin{pspicture}(-1,0)(10,6) -\psset{n=5} -\multido{\i=1+1,\I=1+1,\n=3.5+-0.5}{6}{% -\psFibonacciWord[i=\i,iFibonacci](0.5,\n\space 0.1 sub) -\rput(0,\n){$F_{5}^{[\i]}=$} -} -\end{pspicture} -\end{LTXexample} - - -\section{The Hilbert fractal} - -\begin{BDef} -\Lcs{psHilbert}\OptArgs\\ -\end{BDef} - - - -\begin{itemize} - \item \texttt{n=4} : Number of iterations; - \item \Lkeyset{N=all} : number of points to place, by default all. This option allows you to create an animation in -placing and connecting the successive points to the indicated number. - \item \Lkeyset{dotcolor=red} : color of the points, the size of the points is fixed with the option - \Lkeyword{dotsize} of PSTricks; - \item \Lkeyset{showpoints=false} : boolean of PSTricks to display the points. -\end{itemize} - -The color and the thickness of the lines are adjusted with the usual PSTricks options: - \Lkeyword{linecolor} and \Lkeyword{linewidth}. -The scale of the drawing is defined with the unit option. We can use the option \Lkeyset{linestyle=none}, as well as -\Lkeyset{fillstyle=solid}, \Lkeyword{fillcolor} but, in the latter case only, if all the points are kept -(\Lkeyset{N=all}). - - -\clearpage - - -\subsection{Examples} -\begin{LTXexample} -\begin{pspicture}(0,-1)(1,1) -\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](1,1) -\psHilbert[linecolor=red,n=0,linejoin=1,fillstyle=solid,fillcolor=blue] -\rput(0.5,-0.5){n=0} -\end{pspicture} -\qquad -\begin{pspicture}(0,-1)(3,3) -\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](3,3) -\psHilbert[linecolor=red,n=1,linejoin=1,fillstyle=solid,fillcolor=blue] -\rput(1.5,-0.5){n=1} -\end{pspicture} -\qquad -\begin{pspicture}(0,-1)(7,7) -\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](7,7) -\psHilbert[linecolor=blue,n=2,showpoints=false,dotsize=0.2,fillstyle=solid,fillcolor=red] -\rput(3.5,-0.5){n=2} -\end{pspicture} -\end{LTXexample} - - -Draw the first 220 of 256 points (n=3): - - -\begin{LTXexample} -\begin{pspicture}(0,0)(15,16) -% 4^(n+1)=4^4=256 -\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](15,15) -\psHilbert[unit=1,linecolor=blue,linewidth=0.1,n=3,showpoints=true,dotsize=0.25,N=220] -\end{pspicture} -\end{LTXexample} - - -\begin{LTXexample} -\begin{pspicture}(0,0)(16,16) -\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](16,16) -\psHilbert[unit=0.5,linecolor=red,linewidth=0.1,showpoints] -\end{pspicture} -\end{LTXexample} - - - - -\begin{LTXexample} -\begin{pspicture}(0,0)(16,16) -\psframe*(0,0)(15.75,15.75) -\psHilbert[unit=0.25,linecolor=-red,n=5,linewidth=0.2,linejoin=1,fillstyle=solid,fillcolor=-blue] -\end{pspicture} -\end{LTXexample} - - -\section{The Henon Sttractor} - -\begin{LTXexample} -\begin{pspicture}(-5,-6)(5,6) -\psclip{\psframe(-5,-5)(5,5)} -\psHenon -\endpsclip -\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) -\end{pspicture} -\end{LTXexample} - - - - -\subsection{En noir et blanc} -\begin{minipage}{10cm} -\begin{pspicture}(-5,-5)(5,5) -\psclip{\psframe(-5,-5)(5,5)} -\psHenon[pixelscolor=false] -\endpsclip -\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) -\end{pspicture} -\end{minipage} -\begin{minipage}{6cm} -\begin{verbatim} -\begin{pspicture}(-5,-5)(5,5) -\psclip{\psframe(-5,-5)(5,5)} -\psHenon[pixelscolor=false] -\endpsclip -\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) -\end{pspicture} -\end{verbatim} -\end{minipage} -\section{Animation pour illustrer le principe de l'attracteur de Hénon} -En fonction du tableau des points initiaux, la figure obtenue dépend de l'angle $a$. -Les commentaires de Robert Dony correspondent à la premiére figure pour $a=1.32837$ rd, les voici : -\begin{center} -\begin{pspicture}(-5,-5)(5,5) -\psclip{\psframe(-5,-5)(5,5)} -\psHenon[pixelscolor=false] -\endpsclip -%\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) -\psline{->}(-1,4)(-0.1,3)\uput[ul](-1,4){$S_1$} -\psline{->}(4,3.5)(3,2.5)\uput[ur](4,3.5){$S_2$} -\psline{->}(4,-1.5)(3,-.75)\uput[dr](4,-1.5){$S_3$} -\psline{->}(1.25,-3.75)(0.5,-3)\uput[dr](1.25,-3.75){$S_4$} -\psline{->}(-4,0.75)(-3,0.75)\uput[l](-4,0.75){$S_5$} -\psline{->}(2,4)(1.5,2.6)\uput[ur](2,4){$C_1$} -\psline{->}(4,1)(3,0.8)\uput[ur](4,1){$C_2$} -\psline{->}(2.5,-3)(1.5,-2.25)\uput[dr](2.5,-3){$C_3$} -\psline{->}(-3,-2)(-1.75,-1.4)\uput[l](-3,-2){$C_4$} -\psline{->}(-2.5,3)(-1.75,2)\uput[ul](-2.5,3){$C_5$} -\end{pspicture} -\end{center} - - -\subsection{Animation} - -\begin{center} -\begin{animateinline}[controls,palindrome, - begin={\begin{pspicture}(-1,-1)(16,16)}, - end={\end{pspicture}}]{5}% 5 image/s -\multiframe{256}{i=1+1}{% -\psframe*[linecolor=yellow!20](0,0)(15,15) -\psgrid[subgriddiv=1,gridcolor=red!30,gridlabels=0pt](0,0)(15,15) -\psHilbert[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.2,N=\i]} -\end{animateinline} -\end{center} -\begin{verbatim} -\begin{animateinline}[controls,palindrome, - begin={\begin{pspicture}(-1,-1)(16,16)}, - end={\end{pspicture}}]{5}% 5 image/s -\multiframe{256}{i=1+1}{% -\psframe*[linecolor=yellow!20](0,0)(15,15) -\psgrid[subgriddiv=1,gridcolor=red!30,gridlabels=0pt](0,0)(15,15) -\psHilbert[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.2,N=\i]} -\end{animateinline} -\end{verbatim} - - -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\section{List of all optional arguments for \texttt{pst-fractal}} - - -\xkvview{family=pst-fractal,columns={key,type,default}} - -\nocite{*} -\printbibliography - -\printindex - -\end{document} \ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro b/graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro deleted file mode 100644 index fcdc69bb99..0000000000 --- a/graphics/pstricks/contrib/pst-fractal/dvips/pst-fractal.pro +++ /dev/null @@ -1,953 +0,0 @@ -%% $Id: pst-fractal.pro 679 2017-12-04 21:41:23Z herbert $ -%% -%% This is file `pst-fractal.pro', -%% -%% IMPORTANT NOTICE: -%% -%% Package `pst-fractal' -%% -%% Herbert Voss -%% -%% This program can be redistributed and/or modified under the terms -%% of the LaTeX Project Public License Distributed from CTAN archives -%% in directory macros/latex/base/lppl.txt. -%% -%% DESCRIPTION: -%% `pst-fractal' is a PSTricks package to draw fractal objects -%% -%% -%% version 0.06 / 2017-12-04 Herbert Voss -% -/tx@fractalDict 100 dict def -tx@fractalDict begin -% -/tx@Fractal { -% \pst@temp@A -% \pst@temp@B -% \pst@number\pst@fractal@xWidth -% \pst@number\pst@fractal@yWidth -% \pst@fractal@cx -% \pst@fractal@cy -% \pst@fractal@maxIter -% \pst@fractal@dIter -% \pst@fractal@maxRadius -% {\pst@usecolor\pst@fractal@baseColor} -% \ifx\pst@fractal@type\pst@fractal@Julia true \else false \fi -% \ifPst@CMYK true \else false \fi -% tx@fractalDict begin tx@Fractal end - /ifCMYK ED - /ifJulia ED - /baseColor ED - /maxRadius ED - /dIter ED - /maxIter ED - /cy ED - /cx ED - /MaxYPixel ED - /MaxXPixel ED - /MaxY ED /MaxX ED - /MinY ED /MinX ED - /rPixel 1 def - /totMaxIter maxIter dIter mul def -% - /DX MaxX MinX sub def - /DY MaxY MinY sub def - /dx DX MaxXPixel div def /dy DY MaxYPixel div def -% - /convertX { MinX sub DX sub dx div } def % user -> pt - /convertY { MinY sub dy div } def % user -> pt - /convertXY { convertY exch convertX exch } def -% - /putPixel {% x y auf dem Stack in Benutzerkoordinaten - convertXY - rPixel 0 360 arc fill - } def -% - MinX dx MaxX { - ifJulia { /x exch def }{ /cx exch def /x 0.0 def } ifelse - MinY dy MaxY { - ifJulia { /y exch def }{ /cy exch def /y 0.0 def } ifelse - /iter 0 def - /zx x def - /zy y def - /plot true def - totMaxIter cvi { - zx dup mul zy dup mul add maxRadius gt { - /plot false def - exit - }{% Calculate next value - 2 zx zy mul mul cy add - /zx zx dup mul zy dup mul sub cx add def - /zy exch def - /iter iter dIter add def - } ifelse - } repeat - plot{ - baseColor x y putPixel - }{ iter 400 add - ifCMYK { tx@addDict begin wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor - }{ tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor } ifelse - ifJulia { x y }{ cx cy } ifelse - putPixel stroke - }ifelse % Plot point if point is in set - } for - } for -} def -% -/tx@Sierpinski { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \pst@temp@A -% \pst@temp@B -% \pst@temp@C -% { \pst@usecolor\pslinecolor } -% \pst@fractal@plotpoints - /plotpoints ED - /setColor ED - /Coor ED - /Sx 0 def /Sy 0 def - /putPixel { 0.5 0 360 arc stroke } def % x y on stack - /newPosition { % point # on stack - Coor exch 2 getinterval aload pop - /y exch def /x exch def - x Sx sub 2 div Sx add /Sx exch def - y Sy sub 2 div Sy add /Sy exch def - Sx Sy putPixel - } def - /drawFrame { - Coor aload pop - newpath - moveto - nCoor 1 sub { lineto } repeat % n-1 times - gsave 0.9 setgray fill grestore - setColor - closepath - stroke - } def - /nCoor Coor length 2 div 0.5 add cvi def % # of dots - drawFrame - plotpoints cvi { - rand nCoor mod - dup add newPosition - } repeat -} def -% -/Rot-90 { - 2 dict begin - /y exch def /x exch def - y - x neg - end -} def -% -/tx@SierpinskiCurve { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - /Pi [1.5 cmunit 1 cmunit - 1 cmunit 0.5 cmunit - 1 cmunit -0.5 cmunit - 1.5 cmunit -1 cmunit ] def -% - /P0 Pi def - /coefficient 1 def - 3 { - P0 - [ - 0 2 Pi length 2 sub {/i exch def - Pi i get Pi i 1 add get exch neg % Rot-90 - } for - ] /Pi exch def - P0 Pi concatarray /P0 exch def - } repeat -% -/P1 {[ - 0 2 P0 length 2 sub {/i exch def - P0 i get P0 i 1 add get % Rot-90 - -2 cmunit coefficient mul add exch - -2 cmunit coefficient mul add exch - } for -] } def -% -/P2 {[ - 0 2 P0 length 2 sub { - /i exch def - 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 ] -} def -% -/P3 {[ - 0 2 P0 length 2 sub { - /i exch def - 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 -] } def -% -/P4 {[ - 0 2 P0 length 2 sub {/i exch def - 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 -] } def - n@ 1 eq {/Sierpinsky P0 def}{ - n@ 1 sub { - /Sierpinsky P1 P2 concatarray P3 concatarray P4 concatarray def - /Tab1 [ - 0 2 Sierpinsky length 2 sub {/i exch def - Sierpinsky i 2 getinterval - } for - ] def - /i@ Sierpinsky length 8 div 2.5 mul cvi def % - /Sierpinsky2 [ - Tab1 length { - Tab1 i@ get - /i@ i@ 1 add def - i@ Tab1 length ge {/i@ 0 def} if - }repeat - ] def - /P0 [ - 0 1 Sierpinsky2 length 1 sub {/i exch def - Sierpinsky2 i get aload pop - } for - ] def - /coefficient coefficient 2 mul def - } repeat - } ifelse -% - newpath - Sierpinsky 0 get Sierpinsky 1 get moveto - 0 2 Sierpinsky length 2 sub {/i exch def - i 2 div Npts ge {exit} if - Sierpinsky i get Sierpinsky i 1 add get lineto - } for - Npts 4 n@ 1 add exp cvi ge { closepath } if - useFill { gsave fillColor fill grestore } if -% - useLineStyle -} def -% -/tx@Phyllotaxis { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \pst@tempA -% \pst@fractal@c -% \pst@fractal@angle -% \pst@fractal@maxIter CMYK - /ifCMYK ED - /maxIter ED - /fractalAngle ED - /c ED - translate - /angle fractalAngle dup 0 eq { pop 360 5 sqrt 1 add 2 div dup mul div } if def - maxIter cvi -1 0 { - angle rotate - 0 0 moveto - dup sqrt c mul c lineto - c c neg rlineto - c neg dup rlineto - closepath - gsave - 1 exch maxIter cvi div 90 mul cos 0 - ifCMYK { tx@addDict begin RGBtoCMYK end setcmykcolor }{ setrgbcolor } ifelse - fill - grestore - stroke - } for -} def -% -/tx@Fern { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \pst@fractal@scale -% \pst@tempA -% \pst@fractal@maxIter -% \pst@fractal@radius -% \pst@number\pslinewidth -% { \pst@usecolor\pslinecolor } - /setColor ED - SLW - /radius ED - /maxIter ED - translate - dup scale - /m1 [ 0.00 0.00 0.00 0.16 0.00 0.00 ] def - /m2 [ 0.85 -0.04 0.04 0.85 0.00 1.60 ] def - /m3 [ 0.20 0.23 -0.26 0.22 0.00 1.60 ] def - /m4 [ -0.15 0.26 0.28 0.24 0.00 0.44 ] def - 1 setlinecap - setColor - 0 0 % start point - maxIter cvi { - % get a transformation matrix probabilistically - /r rand 100 mod def - r 1 lt { /m m1 def }{ r 86 lt - { /m m2 def }{ r 93 lt { - /m m3 def }{ /m m4 def } ifelse } ifelse } ifelse - % Make a linear transformation, then - % plot a point at current location - m transform 2 copy radius 0 360 arc - stroke - } repeat -} def -% -/tx@Kochflake { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \pst@tempA -% { \pst@usecolor\pslinecolor } -% \pst@fractal@scale -% \pst@fractal@angle -% CLW -% \pst@fractal@maxIter - /maxIter ED - 10 10 scale - 45 rotate - /side { - dup 0 gt { - 1 sub 1 3 div dup scale side 60 rotate side - -120 rotate side 60 rotate side 3 dup scale 1 add - }{ 1 1 rlineto 1 1 translate } ifelse - } def - /star { - dup currentlinewidth 1 1 - 4 -1 roll { pop 3 div } for - setlinewidth - 0 0 moveto - side -120 rotate side -120 rotate side - pop - closepath - } def - maxIter star -} def -% -/tx@Appolonius { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% \pst@fractal@dIter -% \pst@number\pst@fractal@Radius -% \ifPst@fractal@Color true \else false \fi -% \ifPst@CMYK true \else false \fi -% gsave -% \pst@tempA translate -% \pst@usecolor\pslinecolor -% \pst@fractal@scale -% \pst@number\pslinewidth SLW -% - /ifCMYK ED - /ifColor ED - /Radius ED - /dIter ED - /icount 380 def - /setWaveColor { - /icount icount dup 780 gt { pop 380 }{ dIter add } ifelse def - tx@addDict begin icount - ifCMYK { wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor - }{ wavelengthToRGB Red Green Blue end setrgbcolor } ifelse - } def - /collect { [ 4 1 roll ] } def - /nget { exch dup 3 1 roll exch get } def - /polydup { 1 add [ exch 1 roll ] aload aload pop } def - /circle { aload pop newpath 0 360 arc closepath - ifColor { gsave setWaveColor fill grestore } if - stroke } def - /inverse { - aload 4 1 roll 3 1 roll dup mul exch dup mul add exch dup mul sub - dup 0 eq not {1 exch div} if - exch - aload pop - 4 -1 roll dup 5 1 roll mul 3 1 roll - 4 -1 roll dup 5 1 roll mul 3 1 roll - 4 -1 roll dup 5 1 roll mul 3 1 roll - 4 -1 roll pop - dup 0 lt {neg} if - collect - } def - /between { - collect - 0 nget 2 get exch 1 nget 2 get exch 3 1 roll - lt {aload pop 3 1 roll exch 3 -1 roll collect} if - 0 nget 2 get exch 2 nget 2 get exch 3 1 roll - lt {aload pop 3 -1 roll exch 3 1 roll collect} if - 1 nget 0 get exch 2 nget 2 get exch - 2 nget 0 get exch 1 nget 2 get exch - 1 nget 2 get exch 2 nget 2 get exch - 7 1 roll add 5 1 roll mul 3 1 roll mul add exch div - /xdisp exch def - 1 nget 1 get exch 2 nget 2 get exch - 2 nget 1 get exch 1 nget 2 get exch - 1 nget 2 get exch 2 nget 2 get exch - 7 1 roll add 5 1 roll mul 3 1 roll mul add exch div - /ydisp exch def - 0 nget aload pop 3 1 roll ydisp sub 3 1 roll xdisp sub 3 1 roll - collect - inverse dup - /first exch def - /second exch def - 1 nget 1 get exch 2 nget 1 get exch 3 1 roll sub /xvect exch def - 2 nget 0 get exch 1 nget 0 get exch 3 1 roll sub /yvect exch def - xvect dup mul yvect dup mul add sqrt - dup 0.0 eq not { first 2 get 2 mul exch div} if - dup xvect mul /xvect exch def - yvect mul /yvect exch def - first aload pop 3 1 roll yvect add 3 1 roll xvect add 3 1 roll - collect - inverse /first exch def - second aload pop 3 1 roll yvect sub 3 1 roll xvect sub 3 1 roll - collect - inverse /second exch def - first second - first 2 get second 2 get sub - 0 gt { exch } if - pop - aload pop - 3 1 roll ydisp add 3 1 roll xdisp add 3 1 roll collect - exch pop - } def - /appol { - aload pop 3 polydup between - dup circle - 2 nget CLW gt { 1 1 3 { pop 3 polydup collect 5 1 roll 4 -1 roll } for } if - pop pop pop pop - } def - /inside { - /temp exch def - 0 120 240 { - /angle exch def - temp aload pop - 3 sqrt 2 div 1 add div - /radius exch def - angle sin radius mul - angle cos radius mul - exch 4 -1 roll add - 3 1 roll add - radius 3 sqrt 2 div mul - collect - } for - } def -% - [ 0 0 Radius ] dup inside 4 polydup - 1 1 4 { pop circle } for - 1 1 4 { pop 3 polydup collect 5 1 roll 4 1 roll } for - pop pop pop pop { count 0 eq { exit } if appol } loop -} def -% -/tx@Hugo { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%Creator: Hugo M. Ayala'89, MIT -% \pst@fractal@scale -% \pst@tempA -% \pst@fractal@maxIter, which is the depth -% \pst@number\pslinewidth -% { \pst@usecolor\pslinecolor } -/setColor ED -SLW -/depth ED -translate -dup scale -2 setlinecap -setColor -% -/oldarrayx [0 540 72 72] def -/oldarrayy [0 396 720 72] def -% -/scl .1 def -% -realtime srand -/prorand { rand 32768 div 32768 div 1 sub scl mul} def -/findrow {8 mul 7 sub sqrt 1 add 2 div truncate} def -/findindex {dup 1 sub mul 2 div 1 add} def -/findcolumn {dup findrow findindex sub} def -/findnewrow {2 mul 1 sub} def -/findnewcolumn {2 mul} def -/findarraysize {dup 1 add mul 2 div 1 add} def -/findnumoflines {dup 1 sub mul 2 div 3 mul} def -/findnumpoints {dup 1 add mul 2 div} def -/gtol {2 exch exp 1 add} def -/fixangle {dup 180 ge {180 sub} if} def -/backangle {dup 180 ge {180 sub} {180 add} ifelse} def -/splitline { - tpx btx add 2 div /mdx exch def - tpy bty add 2 div /mdy exch def - tpy bty sub tpx btx sub atan - 90 add fixangle - /lineangle exch def - tpy bty sub dup mul - tpx btx sub dup mul - add sqrt /linelen exch def - prorand linelen mul dup - lineangle cos mul mdx add /mdx exch def - lineangle sin mul mdy add /mdy exch def -} def -% -/findnewindex{ cvi /oldindex exch def - oldindex findrow cvi dup /oldrow exch def - findindex oldindex exch sub cvi /oldcolumn exch def - oldrow findnewrow cvi dup /newrow exch def findindex - oldcolumn findnewcolumn cvi dup /newcolumn exch def add - cvi /newindex exch def -} def -% -/drawfractal { - 1 1 generation gtol 1 sub findnumpoints { - cvi /topindex exch def - topindex dup findcolumn exch findrow 1 add findindex add cvi - /leftindex exch def - leftindex 1 add cvi - /rightindex exch def - /tpx oldarrayx topindex get def - /tpy oldarrayy topindex get def - /btx oldarrayx leftindex get def - /bty oldarrayy leftindex get def - /mdx oldarrayx rightindex get def - /mdy oldarrayy rightindex get def - tpx tpy moveto - btx bty lineto - mdx mdy lineto - closepath stroke - } for -} def -% -1 1 depth { - /generation exch def - generation gtol findarraysize cvi dup array /newarrayx exch def - array /newarrayy exch def - 1 1 generation 1 sub gtol findnumpoints { - findnewindex - newarrayx newindex - oldarrayx oldindex get put - newarrayy newindex - oldarrayy oldindex get put - } for - 1 1 generation 1 sub gtol 1 sub findnumpoints { - findnewindex - newcolumn newrow 2 add findindex add cvi dup - /leftindex exch def - 2 add cvi /rightindex exch def - newcolumn newrow 1 add findindex add cvi - /mindex exch def - /tpx newarrayx newindex get def - /tpy newarrayy newindex get def - /btx newarrayx leftindex get def - /bty newarrayy leftindex get def - splitline - newarrayx mindex mdx put - newarrayy mindex mdy put - mindex 1 add cvi /mindex exch def - /btx newarrayx rightindex get def - /bty newarrayy rightindex get def - splitline - newarrayx mindex mdx put - newarrayy mindex mdy put - /mindex leftindex 1 add cvi def - /tpx newarrayx leftindex get def - /tpy newarrayy leftindex get def - splitline - newarrayx mindex mdx put - newarrayy mindex mdy put - } for - /oldarrayx newarrayx def - /oldarrayy newarrayy def - 7 generation sub 5 div setlinewidth -% drawfractal showpage -} for -drawfractal -} def % end of /tx@Hugo -% -/FibonacciFractal { - 20 dict begin - n@ 2 sub { - /Fi F2 F1 concatstrings def - /F1 F2 def - /F2 Fi def - } repeat - /S Fi def - /nS S length def % nombre de lettres - 0 1 nS 2 sub {/j exch def - x1 y1 translate - /x0 0 def /y0 0 def - /k S j 1 getinterval cvi def - k 0 eq { - j 2 mod 0 eq { - angle neg rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - /flag 0 def - }{ - angle rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - /flag 1 def - } ifelse - }{ - tx ty lineto - currentpoint /y1 exch def /x1 exch def - /flag 2 def - } ifelse - } for - setLineColor - stroke - Pst@juxtaposition { - x1 y1 translate - flag 1 eq {-1 1 scale} if - flag 2 eq {90 rotate 1 -1 scale } if - 0 0 moveto - /x0 0 def /y0 0 def - /F1 (1) def - /F2 (0) def - /x1 0 def /y1 1 cmunit def - x1 y1 lineto - n@ 3 sub{ - /Fi F2 F1 concatstrings def - /F1 F2 def - /F2 Fi def - } repeat - /S Fi def - /nS S length def % nombre de lettres - 0 1 nS 2 sub {/j exch def - x1 y1 translate - /x0 0 def /y0 0 def - /k S j 1 getinterval cvi def - k 0 eq { - j 2 mod 0 eq { - -90 rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - }{ - 90 rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } ifelse - }{ - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } ifelse - } for - ColorF - stroke - } if % end Pst@juxtaposition - end -} def -% -/newFibonacciFractal { - 20 dict begin - n@ 2 sub { - /Fi F2 F1 concatstrings def - /F1 F2 def - /F2 Fi def - } repeat - % The Dense Fibonacci Word - /DFW () def - 0 2 F2 length 2 sub { - /i exch def - /I F2 i 2 getinterval def - I (00) eq {DFW (0) concatstrings /DFW exch def } if - I (01) eq {DFW (1) concatstrings /DFW exch def } if - I (10) eq {DFW (2) concatstrings /DFW exch def } if - } for -% morphismes -% newFibonacci -% 0->"", 1->1, 2->2 - /F2 DFW def - /Fi () def - 0 1 F2 length 1 sub { - /i exch def - /I F2 i 1 getinterval def - I (0) eq {Fi m@0 concatstrings /Fi exch def} if - I (1) eq {Fi m@1 concatstrings /Fi exch def} if - I (2) eq {Fi m@2 concatstrings /Fi exch def} if - } for - /S Fi def - /nS S length def % nombre de lettres - 0 1 nS 1 sub { - /j exch def - x1 y1 translate - /x0 0 def /y0 0 def - /k S j 1 getinterval cvi def - k 1 eq {angle neg rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } if - k 2 eq { angle rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } if - k 0 eq { - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } if - } for - setLineColor - stroke - end -} def -% -/i-FibonacciFractal { - 20 dict begin - /F0 (0) def - /Fi () def - i@ 1 sub { - Fi (0) concatstrings /Fi exch def - } repeat - Fi (1) concatstrings - /F1 exch def - n@ { - F1 F0 concatstrings - /Fi exch def - /F0 F1 def - /F1 Fi def - } repeat - /S Fi def - 0 0 translate - 0 0 moveto - currentpoint /y0 exch def /x0 exch def - 0 1 cmunit lineto - currentpoint /y1 exch def /x1 exch def - /tx {x1 x0 sub} def - /ty {y1 y0 sub} def -% - /nS S length def % nombre de lettres - 0 1 nS 2 sub { - /j exch def - x1 y1 translate - /x0 0 def /y0 0 def - /k S j 1 getinterval cvi def - k 0 eq { - j 2 mod 0 eq { - angle neg rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - }{ - angle rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } ifelse - }{ - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } ifelse - } for - setLineColor - stroke - end -} def -% -/k-FibonacciFractal { - 20 dict begin - /f0 (0) def - /fi (0) def - k@ 2 sub { - fi (0) concatstrings /fi exch def - } repeat - fi (1) concatstrings - /f1 exch def - /fi f1 def - n@ 1 sub { - k@ 1 sub { f1 fi concatstrings /f1 exch def } repeat - f1 f0 concatstrings /f1 exch def - /f0 fi def - /fi f1 def - } repeat - /S f1 def - t@x cmunit_1 28.45 mul t@y cmunit_1 28.45 mul translate - 0 0 moveto - currentpoint /y0 exch def /x0 exch def - 0 1 cmunit lineto - currentpoint /y1 exch def /x1 exch def - /tx {x1 x0 sub} def - /ty {y1 y0 sub} def - /nS S length def % nombre de lettres - 0 1 nS 1 sub {/j exch def - x1 y1 translate - /x0 0 def /y0 0 def - /k S j 1 getinterval cvi def - k 0 eq { - j 2 mod 0 eq { - angle neg rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } - { - angle rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } - ifelse -} { - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } ifelse - } for - setLineColor - stroke - end -} def -% -/Biperiodic-FibonacciWords { - 20 dict begin -/f0 () def -/f1 (0) def -/f2 a@ 1 sub {(0) f0 concatstrings /f0 exch def} repeat f0 (1) concatstrings def -3 1 n@ {/i exch def -/fi () def -i 2 mod 0 eq { - a@ { fi f2 concatstrings /fi exch def } repeat - }{ - b@ { fi f2 concatstrings /fi exch def } repeat - } ifelse - fi f1 concatstrings /fi exch def - /f1 f2 def - /f2 fi def -} for -/S f2 def -t@x cmunit_1 28.45 mul t@y cmunit_1 28.45 mul translate -0 0 moveto -currentpoint /y0 exch def /x0 exch def -1 cmunit 0 cmunit lineto -currentpoint /y1 exch def /x1 exch def -/tx {x1 x0 sub} def -/ty {y1 y0 sub} def -/nS S length def % nombre de lettres -0 1 nS 1 sub {/j exch def -x1 y1 translate -/x0 0 def /y0 0 def -/k S j 1 getinterval cvi def -k 0 eq { -j 2 mod 0 eq { - angle neg rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } - { - angle rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - } - ifelse -} { -tx ty lineto -currentpoint /y1 exch def /x1 exch def -} ifelse -} for - setLineColor -stroke -end - }def -% -/InverseLR { - 1 dict begin - /str exch def - 0 1 str length 1 sub {/i exch def - str i 1 getinterval (L) eq {str i (R) putinterval }{str i (L) putinterval }ifelse - } for - str - end -} def -% -/FibonacciPolyominoes { - 20 dict begin - gsave - t@x t@y translate - /q0 () def - /q1 (R) def - /N n@ 3 mul 1 add def - 2 1 N { - /n exch def - n 3 mod 2 eq {/qi q1 q0 concatstrings def} - {/qi q1 q0 InverseLR concatstrings def} ifelse - /q0 q1 def - /q1 qi def - } for - /q_1 q1 reversestring def - /qii () def - /Q 3 {qii q1 concatstrings /qii exch def } repeat - qii q_1 reversestring concatstrings def -% remarque -% identique /Q 4{qii q1 concatstrings /qii exch def} repeat qii def - /tx {x1 x0 sub} def - /ty {y1 y0 sub} def - /y0 0 def /x0 0 def - /x1 x0 0 cmunit add def /y1 y0 1 cmunit add def - newpath - x0 y0 moveto - x1 y1 lineto - 0 1 Q length 1 sub {/i exch def - x1 y1 translate - Q i 1 getinterval (L) eq { - 90 rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - }{ - 90 neg rotate - tx ty lineto - currentpoint /y1 exch def /x1 exch def - }ifelse - } for - closepath - setFillColor - setLineColor - 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 diff --git a/graphics/pstricks/contrib/pst-fractal/images/crop-eps.sh b/graphics/pstricks/contrib/pst-fractal/images/crop-eps.sh new file mode 100644 index 0000000000..bbdcbfef27 --- /dev/null +++ b/graphics/pstricks/contrib/pst-fractal/images/crop-eps.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# pdf->-crop.pdf +echo "cropping all eps-files:" +for i in ${1}*.pdf ; do + STEM=`basename $i .pdf` + convert $i $STEM.jpg + echo "converting $i" +done diff --git a/graphics/pstricks/contrib/pst-fractal/latex/pst-fractal.sty b/graphics/pstricks/contrib/pst-fractal/latex/pst-fractal.sty deleted file mode 100644 index 17833d134c..0000000000 --- a/graphics/pstricks/contrib/pst-fractal/latex/pst-fractal.sty +++ /dev/null @@ -1,12 +0,0 @@ -%% $Id: pst-fractal-doc.tex 658 2017-11-26 16:55:41Z herbert $ -\RequirePackage{pstricks} -\ProvidesPackage{pst-fractal}[2007/09/25 package wrapper for - pst-fractal.tex (hv)] -\input{pst-fractal.tex} -\IfFileExists{pst-fractal.pro}{% - \ProvidesFile{pst-fractal.pro} - [2017/12/04 v. 0.06, PostScript prologue file (hv)] - \@addtofilelist{pst-fractal.pro}}{}% -\ProvidesFile{pst-fractal.tex} - [\filedate\space v\fileversion\space `PST-fractal' (hv)] -\endinput diff --git a/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.bib b/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.bib new file mode 100644 index 0000000000..a140094051 --- /dev/null +++ b/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.bib @@ -0,0 +1,132 @@ +@STRING{tugboat = {TUGboat} } +@STRING{beiprogramm = {{\TeX}-Beiprogramm} } +@STRING{bretter = {Bretter, die die Welt bedeuten} } +@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} } +@STRING{editorial = {Editorial} } +@STRING{fremdebuehne = {Von fremden B{\"u}hnen} } +@STRING{fundus = {Aus dem Fundus} } +@STRING{hinterbuehne = {Hinter der B{\"u}hne} } +@STRING{leserbrief = {Leserbrief(e)} } +@STRING{magazin = {Magazin} } +@STRING{rezension = {Rezensionen} } +@STRING{schonimmer = {Was Sie schon immer {\"u}ber {\TeX} wissen wollten \dots} } +@STRING{theaterkasse = {Von der Theaterkasse} } +@STRING{theatertage = {{\TeX}-Theatertage} } + + +@Article{ dtk02.1:voss:mathematischen, + author = {Herbert Voß}, + title = {Die mathematischen {F}unktionen von {P}ost{S}cript}, + journal = dtk, + year = 2002, + volume = {1/02}, + altvolume = 1, + altnumber = 14, + month = mar, + pages = {}, + annote = bretter, + keywords = {}, + abstract = { \PS, faktisch genauso alt wie {\TeX}, ist im + Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es + darum geht zu beurteilen, was es denn nun im eigentlichen + Sinne ist. Außerdem wird h{\"a}ufig vergessen, dass + sich mit den \PS-Funktionen viele Dinge erledigen lassen, + bei denen sonst auf externe Programme zur{\"u}ckgegriffen + wird. Dies wird im Folgenden f{\"u}r die mathematischen + Funktionen im Zusammenhang mit dem Paket \texttt{pst-plot} + gezeigt. } +} + +@Book{tlgc2, + author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Voß}, + title = {The {\LaTeX} {G}raphics {C}ompanion}, + publisher = {{Addison-Wesley Publishing Company}}, + edition = 2, + year = {2007}, + address = {Reading, Mass.} +} + + +@Article{girou:01:, + author = {Denis Girou}, + title = {Pr\'esentation de {PST}ricks}, + journal = {Cahier {GUT}enberg}, + year = 1994, + volume = {16}, + month = apr, + pages = {21-70} +} + +@Article{girou:02:, + author = {{Timothy van} Zandt and Denis Girou}, + title = {Inside {PST}ricks}, + journal = TUGboat, + year = 1994, + volume = {15}, + month = sep, + pages = {239-246} +} + +@Book{PostScript, + Author = {Kollock, Nikolai G.}, + Title = {Post{S}cript richtig eingesetzt: vom {K}onzept zum + praktischen {E}insatz}, + Publisher = {IWT}, + Address = {Vaterstetten}, + year = 1989, +} + +@online{pstricks, + Title = {PSTricks - {\PS} macros for generic {\TeX}}, + Author = {{Timothy van} Zandt}, + Organization = {}, + url = {http://www.tug.org/application/PSTricks}, + year = 1993 +} + +@Book{PSTricks2, + author = {Herbert Voß}, + title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, + edition = {7}, + publisher = {DANTE -- Lehmanns}, + year = {2016}, + publisher = {Heidelberg and Berlin} +} + +@Book{PSTricks2-UIT, + author = {Herbert Voß}, + title = {PSTricks -- Graphics for \TeX\ and \LaTeX}, + publisher = {UIT}, + year = {2011}, + address = {Cambridge} +} + +@Book{LaTeXRef-UIT, + author = {Herbert Voß}, + title = {{\LaTeX} quick reference}, + publisher = {UIT}, + year = {2012}, + address = {Cambridge} +} + +@online{wolfram, + author = {Eric Weisstein}, + title = {Wolfram MathWorld}, + publisher = {{Wolfram}}, + year = {2007}, + url = {http://mathworld.wolfram.com} +} + +@ctan{pst-tools, + author = {Herbert Voß}, + title = {\texttt{pst-tools} -- Helper functions}, + year = {2012}, + url = {/graphics/pstricks/contrib/pst-tools} +} + +@online{ramirez, +title= {Properties and Generalizations of the Fibonacci Word Fractal Exploring Fractal Curves}, +url = {http://www.mathematica-journal.com/2014/02/properties-and-generalizations-of-the-fibonacci-word-fractal/}, +author= {José L. Ramírez and Gustavo N. Rubiano}, +} + \ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.pdf b/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.pdf new file mode 100644 index 0000000000..719027358e Binary files /dev/null and b/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.pdf differ diff --git a/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.tex b/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.tex new file mode 100644 index 0000000000..884b7d5079 --- /dev/null +++ b/graphics/pstricks/contrib/pst-fractal/pst-fractal-doc.tex @@ -0,0 +1,1589 @@ +%% $Id: pst-fractal-doc.tex 846 2018-11-30 21:44:45Z herbert $ +\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=13,toc=bibliography,parskip=false, + headings=small, headinclude=false,footinclude=false,oneside]{pst-doc} +\usepackage[utf8]{inputenc} +\usepackage{pst-fractal} +\let\pstFV\fileversion +\renewcommand\bgImage{\includegraphics[scale=0.75]{images/demo}} +\def\PSLenv{\Lenv{pspicture}} +\usepackage{animate} + + +\def\pSTilingsFibonacci#1#2#3{% #1=n #2=nbre de lignes #3=type 1 ou 2 + \pstFPDiv\Nbr{#2}{2}% + \psset[pst-fractal]{n=#1}% + \pstVerb{/n0 #1 def /tabPell [0 1 2 5 12 29 70 169 408] def + /Type #3 def + Type 2 gt {/Type 1 def} if + Type 2 eq { +% (-1)^2P(n),(P(n+1) + /Y1 tabPell n0 1 add get def + /X1 -1 n0 exp tabPell n0 get mul def + }{ +% (P(n+1),(-1)^2P(n) + /X1 tabPell n0 1 add get def + /Y1 -1 n0 exp tabPell n0 get mul def + } ifelse + % le déplacement perpendiculaire + /X2 Y1 neg def + /Y2 X1 def +}% +\pstVerb{/ListColors [0 0 1] def}% +\multido{\I=-\Nbr+1}{#2}{5 \rput(!X2 \I\space mul Y2 \I\space mul){% + \multido{\i=-\Nbr+1}{#2}{% +%\definecolor[ps]{Couleur}{rgb}{ListColors aload pop}% + \definecolor[ps]{Couleur}{cmyk}{ListColors aload pop 0}% + \rput(!X1 \i\space mul Y1 \i\space mul){\psFibonacciPolyominoes[fillcolor=Couleur]}% + \pstVerb{/ListColors [ListColors aload pop 3 1 roll] def}% +}}}}% + + + +%\usepackage{auto-pst-pdf} + +\addbibresource{\jobname.bib} +\lstset{language=PSTricks,basicstyle=\footnotesize\ttfamily} +% +\begin{document} + +\title{\texttt{pst-fractal}} +\subtitle{Plotting fractals; v.\pstFV} +\author{Herbert Vo\ss} +\docauthor{} +\date{\today} +\maketitle + +\tableofcontents + +\vspace{3cm} + + +\begin{abstract} +\noindent +The well known \LPack{pstricks} package offers excellent macros to insert more or less complex +graphics into a document. \LPack{pstricks} itself is the base for several other additional packages, +which are mostly named \verb+pst-xxxx+, like \LPack{pst-fractal}. + +This version uses the extended keyval package \LPack{xkeyval}, so be sure that you have installed +this package together with the spcecial one \LPack{pst-xkey} for PSTricks. The \LPack{xkeyval} +package is available at \url{CTAN:/macros/latex/contrib/xkeyval/}. +It is also important that after \LPack{pst-fractal} no package is loaded, which uses the old keyval interface. + +The fractals are really big, which is the reason why this document is about 15 MByte +when you run it without using the external png-images. +\end{abstract}% + +All images in this documentation were converted to the \Lext{jpg} format to get +a small pdf file size. When using the pdf format for the images the file size will be +more than 20 MBytes. However, having a small file size will lead into a bad image +resolution. Run the examples as single documents to see how it will be in +high quality. + + +\section{Cantor set} + +The set is always plotted from the origin down to into negative $y$ values. + +\begin{BDef} +\Lcs{psCantor}\OptArgs\\ +\end{BDef} + +Possible optional arguments are \Lkeyword{linewidth}, \Lkeyword{linecolor}, +\Lkeyword{n} (recursion depth), \Lkeyword{xWidth}, and \Lkeyword{yWidth} (vertical increment). +The defaults are 2mm, black, 5, 10cm, and 5mm. + +\begin{LTXexample}[pos=l] +\begin{pspicture}(10,-2) + \psCantor +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample}[pos=l] +\begin{pspicture}(10,-2) + \psCantor[linewidth=3mm,linecolor=red, + n=7,xWidth=11,yWidth=4mm] +\end{pspicture} +\end{LTXexample} + + +\section{Sierpinski triangle and curve} + +The triangle must be given by three mandatory arguments. Depending to the kind of +arguments it is one of the two possible versions: + +\begin{BDef} +\Lcs{psSier}\OptArgs\coord0\coord1\coord2\\ +\Lcs{psSier}\OptArgs\coord0\Largb{Base}\Largb{Recursion}\\ +\Lcs{psSier}\OptArgs +\end{BDef} + +\subsection{Triangle} +In difference to \Lcs{psfractal} it doesn't reserve any space, this is the +reason why it should be part of a \PSLenv{} environment. + +\begin{LTXexample}[pos=l] +\begin{pspicture}(5,5) + \psSier(0,0)(2,5)(5,0) +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample}[pos=t] +\multido{\iA=1+1}{6}{% +\begin{pspicture}(2,1.7) +\psSier[linecolor=blue!70, + fillcolor=red!40](0,0){2cm}{\iA} +\end{pspicture} } +\end{LTXexample} + +\subsection{Curve} + +There are four special optional arguments for the Siepinski curve: +\begin{itemize} + \item \texttt{[n=4]} : number of iterations + \item \texttt{[N=all]} : number of placed points (only of interest for an animation) + \item \texttt{[dotcolor=red]} : in difference to linecolor for standard PSTricks + \item \texttt{[showpoints=false]} : show calculated points +\end{itemize} + +\begin{LTXexample}[pos=t] +\begin{pspicture}(-4,-4)(4,4) +\psframe*[linecolor=cyan](-4,-4)(4,4) +\psSier[unit=0.25,n=4,fillstyle=solid,fillcolor=yellow,linecolor=blue] +\psgrid[subgriddiv=0,gridcolor=blue,griddots=5,gridlabels=0pt,unit=0.5](-8,-8)(8,8) +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample}[pos=t] +\begin{pspicture}[showgrid](-4,-4)(4,4) +\psset{unit=0.25} +% n=4 => Nmax=4^(n+1)=1024 +% ici on marque la moitie des points +\psSier[n=4,N=512] +\end{pspicture} +\end{LTXexample} + + + +\begin{LTXexample}[pos=t] +\begin{pspicture}(-4,-4)(4,4) +\psframe*[linecolor=-yellow](-4,-4)(4,4) +\psSier[n=5,unit=0.125,fillstyle=solid,fillcolor=-cyan,linecolor=-blue] +\end{pspicture} +\end{LTXexample} + + +\begin{animateinline}[controls,% palindrome, + begin={\begin{pspicture}(-4,-4)(4,4)}, + end={\end{pspicture}}]{5}% 5 image/s +\multiframe{256}{i=1+1}{% + \psframe*[linecolor=yellow!20](-4,-4)(4,4) + \psgrid[subgriddiv=0,gridcolor=blue,griddots=5,gridlabels=0pt,unit=0.5](-8,-8)(8,8) +% n=3 => Nmax=4^(n+1)=256 points + \psSier[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.1,N=\i,unit=0.5]} +\end{animateinline} + + +\begin{verbatim} +\begin{animateinline}[controls,% palindrome, + begin={\begin{pspicture}(-4,-4)(4,4)}, + end={\end{pspicture}}]{5}% 5 image/s +\multiframe{256}{i=1+1}{% +\psframe*[linecolor=yellow!20](-4,-4)(4,4) +\psgrid[subgriddiv=0,gridcolor=blue,griddots=5,gridlabels=0pt,unit=0.5](-8,-8)(8,8) +% n=3 => Nmax=4^(n+1)=256 points +\psSierpinskyCurve[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.1,N=\i,unit=0.5]} +\end{animateinline} +\end{verbatim} + + + +\section{Julia and Mandelbrot sets} + +The syntax of the \Lcs{psfractal} macro is simple +% +\begin{BDef} +\Lcs{psfractal}\OptArgs\coord0\coord1 +\end{BDef} + + +All Arguments are optional, \Lcs{psfractal} is the same as \Lcs{psfractal}\verb+(-1,-1)(1,1)+. +The Julia and Mandelbrot sets are a graphical representation of the following sequence +$x$ is the real and $y$ the imaginary part of the complex number $z$. $C(x,y)$ is a complex constant +and preset by $(0,0)$. +\begin{align} +z_{n+1}(x,y) &= (z_n(x,y))^2 +C(x,y) +\end{align} + +\subsection{Julia sets} + +A Julia set is given with + +\begin{align} +z_{n+1}(x,y) &= (z_n(x,y))^2 +C(x,y)\\ +z_0 &= (x_0;y_0) +\end{align} +$(x_0;y_0)$ is the starting value. + +\psset{unit=1cm,opacity=0} + + + +\begin{LTXexample}[pos=l] +\psfractal +\end{LTXexample} + +\begin{LTXexample}[pos=l] +\psfractal[xWidth=4cm,yWidth=4cm, baseColor=white, dIter=20](-2,-2)(2,2) +\end{LTXexample} + + +\subsection{Mandelbrot sets} + +A Mandelbrot set is given with + +\begin{align} +z_{n+1}(x,y) &= (z_n(x,y))^2 +C(x,y)\\ +z_0 &= (0;0)\\ +C(x,y) &= (x_0;y_0) +\end{align} + +$(x_0;y_0)$ is the starting value. + +\begin{LTXexample}[pos=l] +\psfractal[type=Mandel] +\end{LTXexample} + + +\begin{LTXexample}[pos=l] +\psfractal[type=Mandel, xWidth=6cm, + yWidth=4.8cm, baseColor=white, + dIter=10](-2,-1.2)(1,1.2) +\end{LTXexample} + +\subsection{The options} + + +\subsection{\texttt{type}} +\Lkeyword{txpe} can be of \Lkeyval{Julia} (default) or \Lkeyval{Mandel}. + + +\begin{LTXexample}[pos=l] +\psfractal \qquad +\psfractal[type=Mandel] +\end{LTXexample} + +\subsection{\texttt{baseColor}} +The color for the convergent part is set by \Lkeyword{baseColor}. + +\begin{LTXexample} +\psfractal[xWidth=4cm,yWidth=4cm,dIter=30](-2,-2)(2,2) \qquad +\psfractal[xWidth=4cm,yWidth=4cm,baseColor=yellow,dIter=30](-2,-2)(2,2) +\end{LTXexample} + + +\subsection{\texttt{xWidth} and \texttt{yWidth}} +\Lkeyword{xWidth} and \Lkeyword{yWidth} + define the physical width of the fractal. + +\begin{LTXexample} +\psfractal[type=Mandel,xWidth=12.8cm,yWidth=10.8cm,dIter=5](-2.5,-1.3)(0.7,1.3) +\end{LTXexample} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\subsection{\texttt{cx} and \texttt{cy}}\xLkeyword{cx}\xLkeyword{cy} +Define the starting value for the complex constant number $C$. + +\begin{LTXexample} +\psset{xWidth=5cm,yWidth=5cm} +\psfractal[dIter=2](-2,-2)(2,2) \qquad +\psfractal[dIter=2,cx=-1.3,cy=0](-2,-2)(2,2) +\end{LTXexample} + + +\subsection{\texttt{dIter}} +The color is set by \Index{wavelength} to RGB conversion of the iteration number, where +\Lkeyword{dIter} is the step, predefined by 1. The wavelength is given by +the value of \Lps{iter} added by 400. + +\begin{LTXexample} +\psset{xWidth=5cm,yWidth=5cm} +\psfractal[dIter=30](-2,-2)(2,2) \qquad +\psfractal[dIter=10,cx=-1.3,cy=0](-2,-2)(2,2) +\end{LTXexample} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\subsection{\texttt{maxIter}} +\Lkeyword{maxIter} is the number of the maximum iteration until it leaves the loop. +It is predefined by 255, but internally multiplied by \Lkeyword{dIter}. + +\begin{LTXexample} +\psset{xWidth=5cm,yWidth=5cm} +\psfractal[maxIter=50,dIter=3](-2,-2)(2,2) \qquad +\psfractal[maxIter=30,cx=-1.3,cy=0](-2,-2)(2,2) +\end{LTXexample} + +\subsection{\texttt{maxRadius}} +If the square of distance of $z_n$ to the origin of the complex coordinate system +is greater as \Lkeyword{maxRadius} then the algorithm leaves the loop +and sets the point. \Lkeyword{maxRadius} should always be the square of the "`real"' +value, it is preset by 100. + +\begin{LTXexample} +\psset{xWidth=5cm,yWidth=5cm} +\psfractal[maxRadius=30,dIter=10](-2,-2)(2,2) \qquad +\psfractal[maxRadius=30,dIter=30,cx=-1.3,cy=0](-2,-2)(2,2) +\end{LTXexample} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% + +\subsection{\texttt{plotpoints}}\xLkeyword{plotpoints} +This option is only valid for the Sierpinski triangle and preset by 2000. + +\begin{LTXexample} +\begin{pspicture}(5,5) + \psSier(0,0)(2.5,5)(5,0) +\end{pspicture} \quad +\begin{pspicture}(5,5) + \psSier[plotpoints=10000](0,0)(2.5,5)(5,0) +\end{pspicture} +\end{LTXexample} + + + +\section{Phyllotaxis} +The beautiful arrangement of leaves in some plants, called phyllotaxis, +obeys a number of subtle mathematical relationships. For instance, the florets +in the head of a sunflower form two oppositely directed spirals: 55 of them clockwise +and 34 counterclockwise. Surprisingly, these numbers are consecutive Fibonacci numbers. +The Phyllotaxis is like a Lindenmayer system. + +\begin{BDef} +\Lcs{psPhyllotaxis}\OptArgs\Largr{\CAny} +\end{BDef} + +The coordinates of the center are optional, if they are missing, then $(0,0)$ +is assumed. + + +\begin{LTXexample}[pos=l] +\psframebox{% +\begin{pspicture}(-3,-3)(3,3) + \psPhyllotaxis +\end{pspicture}} +\end{LTXexample} + + + +\begin{LTXexample}[pos=l] +\psframebox{% +\begin{pspicture}(-3,-3)(4,4) + \psPhyllotaxis(1,1) +\end{pspicture}} +\end{LTXexample} + +\subsection{\texttt{angle}}\xLkeyword{angle} + +\begin{LTXexample}[pos=l] +\psframebox{% +\begin{pspicture}(-2.5,-2.5)(2.5,2.5) + \psPhyllotaxis[angle=99] +\end{pspicture}} +\end{LTXexample} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%% + + +\subsection{\texttt{c}}\xLkeyword{c} +This is the length of one element in the unit pt. + +\begin{LTXexample} +\psframebox{% +\begin{pspicture}(8,8) + \psPhyllotaxis[c=7](4,4) +\end{pspicture}} +\end{LTXexample} + +\begin{LTXexample} +\psframebox{% +\begin{pspicture}(-3,-3)(3,3) + \psPhyllotaxis[c=4,angle=111] +\end{pspicture}} +\end{LTXexample} + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%% + + +\subsection{\texttt{maxIter}}\xLkeyword{maxIter} +This is the number for the iterations. + +\begin{LTXexample} +\psframebox{% +\begin{pspicture}(-3,-3)(3,3) + \psPhyllotaxis[c=6,angle=111,maxIter=100] +\end{pspicture}} +\end{LTXexample} + + + +\section{Fern} + +\begin{BDef} +\Lcs{psFern}\OptArgs\Largr{\CAny} +\end{BDef} + +The coordinates of the starting point are optional, if they are missing, then $(0,0)$ +is assumed. The default \Lkeyword{scale} is set to 10. + +\begin{LTXexample} +\psframebox{% +\begin{pspicture}(-1,0)(1,4) + \psFern +\end{pspicture}} +\end{LTXexample} + +\begin{LTXexample} +\psframebox{% +\begin{pspicture}(-1,0)(2,5) + \psFern(1,1) +\end{pspicture}} +\end{LTXexample} + +\begin{LTXexample} +\psframebox{% +\begin{pspicture}(-3,0)(3,11) + \psFern[scale=30,maxIter=100000,linecolor=green] +\end{pspicture}} +\end{LTXexample} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\section{Koch flake} + +\begin{BDef} +\Lcs{psKochflake}\OptArgs\Largr{\CAny} +\end{BDef} + +The coordinates of the starting point are optional, if they are missing, then $(0,0)$ +is assumed. The origin is the lower left point of the flake, marked as red +or black point +in the following example: + +\begin{LTXexample} +\begin{pspicture}[showgrid=true](-2.4,-0.4)(5,5) + \psKochflake[scale=10] + \psdot[linecolor=red,dotstyle=*](0,0) +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample} +\begin{pspicture}(-0.4,-0.4)(12,4) + \psset{fillcolor=lime,fillstyle=solid} + \multido{\iA=0+1,\iB=0+2}{6}{% + \psKochflake[angle=-30,scale=3,maxIter=\iA](\iB,2.5)\psdot*(\iB,2.5) + \psKochflake[scale=3,maxIter=\iA](\iB,0)\psdot*(\iB,0)} +\end{pspicture} +\end{LTXexample} + +Optional arguments are \Lkeyword{scale}, \Lkeyword{maxIter} (iteration depth) and \Lkeyword{angle} +for the first rotation angle. + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{Apollonius circles} + +\begin{BDef} +\Lcs{psAppolonius}\OptArgs\Largr{\CAny} +\end{BDef} + +The coordinates of the starting point are optional, if they are missing, then $(0,0)$ +is assumed. The origin is the center of the circle: + +\begin{LTXexample} +\begin{pspicture}[showgrid=true](-4,-4)(4,4) + \psAppolonius[Radius=4cm] +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample} +\begin{pspicture}(-5,-5)(5,5) + \psAppolonius[Radius=5cm,Color] +\end{pspicture} +\end{LTXexample} + + +\section{Trees} + +\begin{BDef} +\Lcs{psPTree}\OptArgs\Largr{\CAny} +\Lcs{psFArrow}\OptArgs\Largr{\CAny}\Largb{fraction} +\end{BDef} + +The coordinates of the starting point are optional, if they are missing, then $(0,0)$ +is assumed. The origin is the center of the lower line, shown in the following examples +by the dot. Special parameters are the width of the lower basic line for the tree and the +height and angle for the arrow and for both the color option. The color step is given by \Lkeyword{dIter} +and the depth by \Lkeyword{maxIter}. Valid optional arguments are + +\medskip +\begin{center} +\begin{tabular}{@{}>{\ttfamily}lll@{}}\hline +\emph{Name} & \emph{Meaning} & \emph{default}\\\hline +\Lkeyword{xWidth} & first base width & 1cm\\ +\Lkeyword{minWidth} & last base width & 1pt\\ +\Lkeyword{c} & factor for unbalanced trees (0}(4.8,2)(3,2) +\psline[arrowinset=0.1,arrowsize=0.2]{->}(5,2.5)(5,4) +\end{pspicture} +\hfill +\begin{pspicture}[showgrid](0,0)(7,7) +\psFibonacci[unit=0.1,linecolor=blue,n=16,linewidth=0.04cm] +\rput(5,2){$F_{16}$} +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(8,5) +\psFibonacci[unit=0.05,linecolor=blue,n=17,linewidth=0.02cm,juxtaposition] +\rput(2.5,4){\blue$F_{17}$} +\rput(6,4){\red$F_{16}$} +\end{pspicture} +\hfill +\begin{pspicture}[showgrid](0,0)(8,5) +\psFibonacci[unit=0.05,n=18,linewidth=0.02cm] +\rput(4,4){$F_{18}$} +\end{pspicture} +\end{LTXexample} + + + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(10,7) +\psFibonacci[unit=0.1,linecolor=blue,n=16,linewidth=0.03cm,juxtaposition] +\rput(5,2){\blue$F_{16}$} +\rput(9,2){\red$F_{15}$} +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(10,7) +\psFibonacci[unit=0.1,n=17,linewidth=0.03cm] +\rput(5,2){$F_{17}$} +\end{pspicture} +\end{LTXexample} + + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(13,12) +\psFibonacci[unit=0.03,linecolor=blue,n=21,linewidth=0.02cm,juxtaposition] +\rput(1.5,3.5){\blue$F_{21}$} +\rput(8.5,10.5){\red$F_{20}$} +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(13,12) +\psFibonacci[unit=0.03,n=22,linewidth=0.025cm] +\rput(9,4){$F_{22}$} +\end{pspicture} +\end{LTXexample} + + + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(14,6) +\psFibonacci[unit=0.015,linecolor=blue,n=23,linewidth=0.01cm,juxtaposition] +\rput(4,2){\blue$F_{23}$} +\rput(10.5,4){\red$F_{22}$} +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(14,6) +\psFibonacci[unit=0.015,n=24,linewidth=0.01cm] +\rput(7,6.5){$F_{24}$} +\end{pspicture} +\end{LTXexample} + + + +\subsection{Curves with a big number of iterations} +With \texttt{n=30} it takes a long time and the number is not readable. + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(14,6) +\psFibonacci[unit=0.0025,n=30,linewidth=0.001cm] +\end{pspicture} +\end{LTXexample} + + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\subsection{Double color curves} + +Superposition of two curves are possible by choosing diffrent color and line thickness. + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-1,-1)(15,12) +\psgrid[style=gridstyleA] +\psFibonacci[unit=0.4,linecolor=blue,n=13,linewidth=0.2cm]% +\psFibonacci[unit=0.4,linecolor=red,n=13,linewidth=0.05cm]% +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-1,-1)(14,6) +\psFibonacci[unit=0.5,linecolor=red,n=12,linewidth=0.2cm]% +\psFibonacci[unit=0.5,linecolor=yellow,n=12,linewidth=0.05cm]% +\end{pspicture} +\end{LTXexample} + + + + +\section{``Dense Fibonacci Word'' and the command \Lcs{psNewFibonacci}}\label{dfw} + +In the chapter ``The dense Fibonacci word: a whole family of curves'', Alexis Monnerot-Dumaine +wrote: + +\begin{quote} +The odd-even design rule is not easy to manage and we can change to +a more practical rule. As Jean-Paul Allouche suggested, we can create a word of 3 +letters with \{0; 1; 2\} that can draw the Fibonacci fractal with the simplest drawing rules +following: + +\begin{itemize} +\item 0, draw a segment in line with the previous one +\item 1, draw a segment by turning to the right +\item 2, draw a segment by turning to the left +\end{itemize} +\end{quote} + + +By replacing in the Fibonacci word 00$\rightarrow$0, 01$\rightarrow$1 and 10$\rightarrow$2. Alexis Monnerot-Dumaine +defines the ``Dense Fibonacci Word'' (DFW). +From the DFW, we get a whole family of curves by doing, for example, substitutions +following: + +\begin{itemize} + \item $\mu_1$ : $1 \longrightarrow 10$ ; $0 \longrightarrow 12$ ; $2 \longrightarrow 02$ + \item $\mu_2$ : $1 \longrightarrow 010$ ; $0 \longrightarrow 0102$ ; $2 \longrightarrow 002$ + \item $\mu_3$ : $1 \longrightarrow 02$ ; $0 \longrightarrow 21$ ; $2 \longrightarrow 10$ + \item $\mu_4$ : $1 \longrightarrow 02$ ; $0 \longrightarrow 00$ ; $2 \longrightarrow 10$ +\end{itemize} + +We will find all these families of curves with explanations and references in the article +Alexis Monnerot-Dumaine. These are just brief explanations for using the commands +PSTricks to draw these families of curves. In their article "Properties and Gener- +Fractal Exploring Fractal Curves ``alizations of the Fibonacci'' \cite{ramirez} illustrate this +family of curves with Mathematica by designating them under the name of +New-Fibonacci. This name seems to me sensible the PSTricks command will be called \Lcs{psNewFibonacci}. + + +\subsection{``Dense Fibonacci Word''} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid=false](-1,-0.2)(10,2) +\uput[r](-0.5,1){FW=}% +\psFibonacciWord[n=10,fontscale=12](0.5,0.9) +\uput[r](-0.75,0){DFW=}% +\psFibonacciWord[n=10,DFW,fontscale=12](0.5,-0.1) +\end{pspicture} +\end{LTXexample} + + + +\subsection{Fractal of ``\textit{Dense Fibonacci Word}''} + +The curve can be created with \verb+\psNewFibonacci+ + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-3,0)(10,11) +\psNewFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm] +\rput(4,4){n=17} +\end{pspicture} +\end{LTXexample} + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-4,0)(6,10) +\psNewFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=() (1) (2)] +\rput(2,4){n=17} +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-1,0)(15,6) +\psNewFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=18,linewidth=0.03cm,morphism=(12) (1) (2)] +\rput(4,2){n=18} +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-7,0)(5,10) +\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(102) (2) (1)] +\rput(-2,4){n=17} +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-7,0)(4,10) +\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(210) (02) (10)] +\rput(-2,4){n=17} +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-5,0)(4,9) +\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(21) (02) (10)] +\rput(-1,4){n=17} +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-10,0)(4,12) +\psNewFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=17,linewidth=0.03cm,morphism=(210) (020) (10)] +\rput(-4,4){n=17} +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-10,0)(4,11) +\psNewFibonacci[unit=0.075,linecolor={[rgb]{0.5 0 0}},n=18,linewidth=0.025cm,morphism=(102) (2) (1)] +\rput(-4,2){n=18} +\end{pspicture} +\end{LTXexample} + + + + +\section{The command \Lcs{psiFibonacci}} + +\subsection{How it works} +Briefly, (read the article \cite{ramirez} for more details) more +``I-Fibonacci Word'' depends on the parameter i and the number of iterations n with the following rules, +according to the authors' notations: + +\begin{itemize} + \item $f_0^{[i]}$ =0 + \item $f_1^{[i]} =0^{i-1}1$ : this notation means that it is necessary to put (i-1) 0 before the 1 + \item $f_n^{[i]}= f_{n -1}^{[i]} f_{n -2}^{[i]}$ pour $n\geq 2$ et $i \geq 1$. +\end{itemize} + +The construction of the associated fractal curves follows the ``even-odd'' rule as for the fractal +of the word Fibonacci. + + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + + +\subsection{Examples} + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-7,0)(3,9) +\psiFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=3] +\end{pspicture} +\end{LTXexample} + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(9,9.5) +\psiFibonacci[unit=0.2,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=4] +\end{pspicture} +\end{LTXexample} + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-7,0)(3,9) +\psiFibonacci[unit=0.15,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=5] +\end{pspicture} +\end{LTXexample} + + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(9,9.5) +\psiFibonacci[unit=0.15,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=6] +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-6,0)(3,8) +\psiFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=7] +\end{pspicture} +\end{LTXexample} + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-8,0)(3,12) +\psiFibonacci[unit=0.1,linecolor={[rgb]{0.5 0 0}},n=10,linewidth=0.025cm,i=11] +\end{pspicture} +\end{LTXexample} + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](0,0)(6,14) +\psiFibonacci[unit=0.05,linecolor={[rgb]{0.5 0 0}},n=12,linewidth=0.025cm,i=12] +\end{pspicture} +\end{LTXexample} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%% + + +\section{The command \Lcs{pskFibonacci}} +The 2 mandatory parameters are n and k. The following coordinates are optional but +put, possibly, to center the curve at the origin of the mark. + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-4,-4)(4,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\pskFibonacci[unit=0.02,linecolor={[rgb]{0 0 0.5}},linewidth=0.02cm,n=6,k=5](-2.3,-3.2) +\end{pspicture} +\end{LTXexample} + + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-4,-4)(4,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\pskFibonacci[unit=0.4,linecolor={[rgb]{0 0 0.5}},n=3,k=5](2.8,-3.6) +\end{pspicture} +\end{LTXexample} + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-4,-4)(4,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\pskFibonacci[unit=0.025,linecolor={[rgb]{0 0 0.5}},linewidth=0.02cm,n=6,k=6](3,0.5) +\end{pspicture} +\end{LTXexample} + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-4,-4)(4,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor={[rgb]{0 0 0.5}},griddots=10] +\pskFibonacci[unit=0.2,linecolor={[rgb]{0 0 0.5}},n=4,k=6,angle=60](-2,0) +\end{pspicture} +\end{LTXexample} + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-4,-4)(2,1) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\pskFibonacci[unit=0.1,linecolor={[rgb]{0 0 0.5}},n=4,k=4,angle=60](0,0) +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-8,-8)(8,8) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor={[rgb]{0 0 0.5}},griddots=10] +\pskFibonacci[unit=0.02,linecolor={[rgb]{0.5 0 0}},linewidth=0.02cm,n=6,k=7](6,-4) +\end{pspicture} +\end{LTXexample} + + + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{The command \Lcs{psBiperiodicFibonacci}} +The 3 mandatory parameters are n, a and b. As for the previous command, the coordinates +following are optional but allow, eventually, to center the curve at the origin of the +mark. + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid=false](-4,-4)(4,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\psBiperiodicFibonacci[unit=0.2,linecolor={[rgb]{0 0.5 0}},linewidth=0.1cm,n=5,a=6,b=6,angle=60](0,2.1) +\psBiperiodicFibonacci[unit=0.2,linecolor=white,n=5,a=6,b=6,angle=60](0,2.1) +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid=false](-4,-4)(4,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\psBiperiodicFibonacci[unit=0.5,linecolor={[rgb]{0 0.5 0}},n=5,a=3,b=4,angle=120](-1.5,3.5) +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid=false](-4,-4)(4,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\psBiperiodicFibonacci[unit=0.2,linecolor=black,linewidth=0.1cm,n=7,a=2,b=6,angle=72](2.62,2) +\psBiperiodicFibonacci[unit=0.2,linecolor=yellow,n=7,a=2,b=6,angle=72](2.62,2) +\end{pspicture} +\end{LTXexample} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid=false](-5,-4)(5,4) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\psBiperiodicFibonacci[unit=0.1,linecolor=red,linewidth=0.1cm,n=10,a=2,b=5](3.5,-1.5) +\psBiperiodicFibonacci[unit=0.1,linecolor=yellow,n=10,a=2,b=5](3.5,-1.5) +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-5,-5)(5,5) +\psgrid[gridlabels=0pt,subgriddiv=0,gridcolor=red,griddots=10] +\psBiperiodicFibonacci[unit=0.15,linecolor={[rgb]{0 0.5 0}},n=9,a=2,b=5](3.15,-1.35) +\end{pspicture} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-5,-5)(5,5) +\psBiperiodicFibonacci[unit=0.8,linecolor=black,linewidth=0.1cm,,n=8,a=2,b=3,angle=120](-1,1) +\psBiperiodicFibonacci[unit=0.8,linecolor=white,n=8,a=2,b=3,angle=120](-1,1) +\end{pspicture} +\end{LTXexample} + + + +\section{The command \Lcs{psFibonacciPolyominoes}} + + +The only mandatory parameter is the order of the tile: n. Coordinates are optional, but +they will be used for paving the plan. + + + +\subsection{The order 0, 1, 2, 3, and 4} + +\psset{unit=1cm} +\begin{LTXexample} +\psset{linecolor={[rgb]{0 0.5 0}},fillstyle=solid,fillcolor=red} +\begin{pspicture}[showgrid](0,-1)(1,4) +\psFibonacciPolyominoes[n=0,unit=0.5] +\end{pspicture} +\quad +\begin{pspicture}[showgrid](-2,-1)(1,4) +\psFibonacciPolyominoes[n=1,unit=0.5] +\end{pspicture} +\quad +\begin{pspicture}[showgrid](-3,-1)(2,4) +\psFibonacciPolyominoes[unit=0.5,n=2] +\end{pspicture} +\quad +\begin{pspicture}[showgrid](-3,-1)(2,4) +\psFibonacciPolyominoes[unit=0.2cm,n=3] +\end{pspicture} +\end{LTXexample} + + + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}[showgrid](-7,-2)(4,10) +\psFibonacciPolyominoes[unit=0.2,n=4,fillcolor=cyan,linecolor=blue,fillstyle=solid] +\end{pspicture} +\end{LTXexample} + + + +\iffalse + + +\subsection{Paving the plan with Fibonacci tiles} +This tiling is done with the \Lcs{pSTilingsFibonacci}\Largb{n}\Largb{N}\Largb{T} command which has 3 arguments: the +first is the order of the tile (n = 0, 1, 2 etc.), the second the number of tiles per side of the square, +preferably it must be odd and T = 1 or 2 defines the type of paving. For tiles to be +colored, activate the \texttt{fillstyle=solid} option in a pre-command. + + +\begin{verbatim} +\def\pSTilingsFibonacci#1#2#3{% #1=n #2=nbre de lignes #3=type 1 ou 2 + \pstFPDiv\Nbr{#2}{2}% + \psset[pst-fractal]{n=#1}% + \pstVerb{/n0 #1 def /tabPell [0 1 2 5 12 29 70 169 408] def + /Type #3 def + Type 2 gt {/Type 1 def} if + Type 2 eq { + % (-1)^2P(n),(P(n+1) + /Y1 tabPell n0 1 add get def + /X1 -1 n0 exp tabPell n0 get mul def + }{ + % (P(n+1),(-1)^2P(n) + /X1 tabPell n0 1 add get def + /Y1 -1 n0 exp tabPell n0 get mul def + } ifelse + % le déplacement perpendiculaire + /X2 Y1 neg def + /Y2 X1 def +}% +\pstVerb{/ListColors [0 0 1] def}% +\multido{\I=-\Nbr+1}{#2}{5 + \rput(!X2 \I\space mul Y2 \I\space mul){% + \multido{\i=-\Nbr+1}{#2}{% +%\definecolor[ps]{Couleur}{rgb}{ListColors aload pop}% + \definecolor[ps]{Couleur}{cmyk}{ListColors aload pop 0}% + \rput(!X1 \i\space mul Y1 \i\space mul){\psFibonacciPolyominoes[fillcolor=Couleur]} + \pstVerb{/ListColors [ListColors aload pop 3 1 roll] def}% +}}}}% +\end{verbatim} + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture*}(-9,-7)(8,9) +\psset{unit=0.125,linestyle=solid} +\pSTilingsFibonacci{3}{13}{1}% +\psset{fillstyle=solid,linecolor=blue}% +\pSTilingsFibonacci{3}{7}{1}% +\end{pspicture*} +\end{LTXexample} + + + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture*}(-9,-7)(8,9) +\psset{unit=0.125,linestyle=solid} +\pSTilingsFibonacci{3}{13}{2}% +\psset{fillstyle=solid,linecolor=blue}% +\pSTilingsFibonacci{3}{7}{2}% +\end{pspicture*} +\end{LTXexample} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\fi + + +\section{The command \Lcs{psFibonacciWord}} + +\psset{unit=1cm} +\begin{LTXexample} +\begin{pspicture}(-1,0)(10,5) +\rput(0.15,5){\small$F_{1}=1$} +\rput(0.15,4.5){\small$F_{2}=0$} +\multido{\i=3+1,\I=3+1,\n=4.0+-0.5}{8}{% + \psFibonacciWord[n=\i](0.5,\n) + \rput(0,\n){$F_{\I}=$}} +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample} +\begin{pspicture}(-1,0)(10,6) +\psset{n=5} +\multido{\i=1+1,\I=1+1,\n=3.5+-0.5}{6}{% +\psFibonacciWord[i=\i,iFibonacci](0.5,\n\space 0.1 sub) +\rput(0,\n){$F_{5}^{[\i]}=$} +} +\end{pspicture} +\end{LTXexample} + + +\section{The Hilbert fractal} + +\begin{BDef} +\Lcs{psHilbert}\OptArgs\\ +\end{BDef} + + + +\begin{itemize} + \item \texttt{n=4} : Number of iterations; + \item \Lkeyset{N=all} : number of points to place, by default all. This option allows you to create an animation in +placing and connecting the successive points to the indicated number. + \item \Lkeyset{dotcolor=red} : color of the points, the size of the points is fixed with the option + \Lkeyword{dotsize} of PSTricks; + \item \Lkeyset{showpoints=false} : boolean of PSTricks to display the points. +\end{itemize} + +The color and the thickness of the lines are adjusted with the usual PSTricks options: + \Lkeyword{linecolor} and \Lkeyword{linewidth}. +The scale of the drawing is defined with the unit option. We can use the option \Lkeyset{linestyle=none}, as well as +\Lkeyset{fillstyle=solid}, \Lkeyword{fillcolor} but, in the latter case only, if all the points are kept +(\Lkeyset{N=all}). + + +\clearpage + + +\subsection{Examples} +\begin{LTXexample} +\begin{pspicture}(0,-1)(1,1) +\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](1,1) +\psHilbert[linecolor=red,n=0,linejoin=1,fillstyle=solid,fillcolor=blue] +\rput(0.5,-0.5){n=0} +\end{pspicture} +\qquad +\begin{pspicture}(0,-1)(3,3) +\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](3,3) +\psHilbert[linecolor=red,n=1,linejoin=1,fillstyle=solid,fillcolor=blue] +\rput(1.5,-0.5){n=1} +\end{pspicture} +\qquad +\begin{pspicture}(0,-1)(7,7) +\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](7,7) +\psHilbert[linecolor=blue,n=2,showpoints=false,dotsize=0.2,fillstyle=solid,fillcolor=red] +\rput(3.5,-0.5){n=2} +\end{pspicture} +\end{LTXexample} + + +Draw the first 220 of 256 points (n=3): + + +\begin{LTXexample} +\begin{pspicture}(0,0)(15,16) +% 4^(n+1)=4^4=256 +\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](15,15) +\psHilbert[unit=1,linecolor=blue,linewidth=0.1,n=3,showpoints=true,dotsize=0.25,N=220] +\end{pspicture} +\end{LTXexample} + + +\begin{LTXexample} +\begin{pspicture}(0,0)(16,16) +\psgrid[subgriddiv=0,gridcolor=lightgray,griddots=10,gridlabels=0pt](16,16) +\psHilbert[unit=0.5,linecolor=red,linewidth=0.1,showpoints] +\end{pspicture} +\end{LTXexample} + + + + +\begin{LTXexample} +\begin{pspicture}(0,0)(16,16) +\psframe*(0,0)(15.75,15.75) +\psHilbert[unit=0.25,linecolor=-red,n=5,linewidth=0.2,linejoin=1,fillstyle=solid,fillcolor=-blue] +\end{pspicture} +\end{LTXexample} + + +\section{The Henon Sttractor} + +\begin{LTXexample} +\begin{pspicture}(-5,-6)(5,6) +\psclip{\psframe(-5,-5)(5,5)} +\psHenon +\endpsclip +\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) +\end{pspicture} +\end{LTXexample} + + + + +\subsection{En noir et blanc} +\begin{minipage}{10cm} +\begin{pspicture}(-5,-5)(5,5) +\psclip{\psframe(-5,-5)(5,5)} +\psHenon[pixelscolor=false] +\endpsclip +\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) +\end{pspicture} +\end{minipage} +\begin{minipage}{6cm} +\begin{verbatim} +\begin{pspicture}(-5,-5)(5,5) +\psclip{\psframe(-5,-5)(5,5)} +\psHenon[pixelscolor=false] +\endpsclip +\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) +\end{pspicture} +\end{verbatim} +\end{minipage} +\section{Animation pour illustrer le principe de l'attracteur de Hénon} +En fonction du tableau des points initiaux, la figure obtenue dépend de l'angle $a$. +Les commentaires de Robert Dony correspondent à la premiére figure pour $a=1.32837$ rd, les voici : +\begin{center} +\begin{pspicture}(-5,-5)(5,5) +\psclip{\psframe(-5,-5)(5,5)} +\psHenon[pixelscolor=false] +\endpsclip +%\psgrid[unit=5,subgriddiv=10](-1,-1)(1,1) +\psline{->}(-1,4)(-0.1,3)\uput[ul](-1,4){$S_1$} +\psline{->}(4,3.5)(3,2.5)\uput[ur](4,3.5){$S_2$} +\psline{->}(4,-1.5)(3,-.75)\uput[dr](4,-1.5){$S_3$} +\psline{->}(1.25,-3.75)(0.5,-3)\uput[dr](1.25,-3.75){$S_4$} +\psline{->}(-4,0.75)(-3,0.75)\uput[l](-4,0.75){$S_5$} +\psline{->}(2,4)(1.5,2.6)\uput[ur](2,4){$C_1$} +\psline{->}(4,1)(3,0.8)\uput[ur](4,1){$C_2$} +\psline{->}(2.5,-3)(1.5,-2.25)\uput[dr](2.5,-3){$C_3$} +\psline{->}(-3,-2)(-1.75,-1.4)\uput[l](-3,-2){$C_4$} +\psline{->}(-2.5,3)(-1.75,2)\uput[ul](-2.5,3){$C_5$} +\end{pspicture} +\end{center} + + +\subsection{Animation} + +\begin{center} +\begin{animateinline}[controls,palindrome, + begin={\begin{pspicture}(-1,-1)(16,16)}, + end={\end{pspicture}}]{5}% 5 image/s +\multiframe{256}{i=1+1}{% +\psframe*[linecolor=yellow!20](0,0)(15,15) +\psgrid[subgriddiv=1,gridcolor=red!30,gridlabels=0pt](0,0)(15,15) +\psHilbert[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.2,N=\i]} +\end{animateinline} +\end{center} +\begin{verbatim} +\begin{animateinline}[controls,palindrome, + begin={\begin{pspicture}(-1,-1)(16,16)}, + end={\end{pspicture}}]{5}% 5 image/s +\multiframe{256}{i=1+1}{% +\psframe*[linecolor=yellow!20](0,0)(15,15) +\psgrid[subgriddiv=1,gridcolor=red!30,gridlabels=0pt](0,0)(15,15) +\psHilbert[linecolor=blue,linewidth=0.05,n=3,showpoints,dotsize=0.2,N=\i]} +\end{animateinline} +\end{verbatim} + + +\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{List of all optional arguments for \texttt{pst-fractal}} + + +\xkvview{family=pst-fractal,columns={key,type,default}} + +\nocite{*} +\printbibliography + +\printindex + +\end{document} \ No newline at end of file diff --git a/graphics/pstricks/contrib/pst-fractal/pst-fractal.pro b/graphics/pstricks/contrib/pst-fractal/pst-fractal.pro new file mode 100644 index 0000000000..fcdc69bb99 --- /dev/null +++ b/graphics/pstricks/contrib/pst-fractal/pst-fractal.pro @@ -0,0 +1,953 @@ +%% $Id: pst-fractal.pro 679 2017-12-04 21:41:23Z herbert $ +%% +%% This is file `pst-fractal.pro', +%% +%% IMPORTANT NOTICE: +%% +%% Package `pst-fractal' +%% +%% Herbert Voss +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +%% +%% DESCRIPTION: +%% `pst-fractal' is a PSTricks package to draw fractal objects +%% +%% +%% version 0.06 / 2017-12-04 Herbert Voss +% +/tx@fractalDict 100 dict def +tx@fractalDict begin +% +/tx@Fractal { +% \pst@temp@A +% \pst@temp@B +% \pst@number\pst@fractal@xWidth +% \pst@number\pst@fractal@yWidth +% \pst@fractal@cx +% \pst@fractal@cy +% \pst@fractal@maxIter +% \pst@fractal@dIter +% \pst@fractal@maxRadius +% {\pst@usecolor\pst@fractal@baseColor} +% \ifx\pst@fractal@type\pst@fractal@Julia true \else false \fi +% \ifPst@CMYK true \else false \fi +% tx@fractalDict begin tx@Fractal end + /ifCMYK ED + /ifJulia ED + /baseColor ED + /maxRadius ED + /dIter ED + /maxIter ED + /cy ED + /cx ED + /MaxYPixel ED + /MaxXPixel ED + /MaxY ED /MaxX ED + /MinY ED /MinX ED + /rPixel 1 def + /totMaxIter maxIter dIter mul def +% + /DX MaxX MinX sub def + /DY MaxY MinY sub def + /dx DX MaxXPixel div def /dy DY MaxYPixel div def +% + /convertX { MinX sub DX sub dx div } def % user -> pt + /convertY { MinY sub dy div } def % user -> pt + /convertXY { convertY exch convertX exch } def +% + /putPixel {% x y auf dem Stack in Benutzerkoordinaten + convertXY + rPixel 0 360 arc fill + } def +% + MinX dx MaxX { + ifJulia { /x exch def }{ /cx exch def /x 0.0 def } ifelse + MinY dy MaxY { + ifJulia { /y exch def }{ /cy exch def /y 0.0 def } ifelse + /iter 0 def + /zx x def + /zy y def + /plot true def + totMaxIter cvi { + zx dup mul zy dup mul add maxRadius gt { + /plot false def + exit + }{% Calculate next value + 2 zx zy mul mul cy add + /zx zx dup mul zy dup mul sub cx add def + /zy exch def + /iter iter dIter add def + } ifelse + } repeat + plot{ + baseColor x y putPixel + }{ iter 400 add + ifCMYK { tx@addDict begin wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor + }{ tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor } ifelse + ifJulia { x y }{ cx cy } ifelse + putPixel stroke + }ifelse % Plot point if point is in set + } for + } for +} def +% +/tx@Sierpinski { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \pst@temp@A +% \pst@temp@B +% \pst@temp@C +% { \pst@usecolor\pslinecolor } +% \pst@fractal@plotpoints + /plotpoints ED + /setColor ED + /Coor ED + /Sx 0 def /Sy 0 def + /putPixel { 0.5 0 360 arc stroke } def % x y on stack + /newPosition { % point # on stack + Coor exch 2 getinterval aload pop + /y exch def /x exch def + x Sx sub 2 div Sx add /Sx exch def + y Sy sub 2 div Sy add /Sy exch def + Sx Sy putPixel + } def + /drawFrame { + Coor aload pop + newpath + moveto + nCoor 1 sub { lineto } repeat % n-1 times + gsave 0.9 setgray fill grestore + setColor + closepath + stroke + } def + /nCoor Coor length 2 div 0.5 add cvi def % # of dots + drawFrame + plotpoints cvi { + rand nCoor mod + dup add newPosition + } repeat +} def +% +/Rot-90 { + 2 dict begin + /y exch def /x exch def + y + x neg + end +} def +% +/tx@SierpinskiCurve { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + /Pi [1.5 cmunit 1 cmunit + 1 cmunit 0.5 cmunit + 1 cmunit -0.5 cmunit + 1.5 cmunit -1 cmunit ] def +% + /P0 Pi def + /coefficient 1 def + 3 { + P0 + [ + 0 2 Pi length 2 sub {/i exch def + Pi i get Pi i 1 add get exch neg % Rot-90 + } for + ] /Pi exch def + P0 Pi concatarray /P0 exch def + } repeat +% +/P1 {[ + 0 2 P0 length 2 sub {/i exch def + P0 i get P0 i 1 add get % Rot-90 + -2 cmunit coefficient mul add exch + -2 cmunit coefficient mul add exch + } for +] } def +% +/P2 {[ + 0 2 P0 length 2 sub { + /i exch def + 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 ] +} def +% +/P3 {[ + 0 2 P0 length 2 sub { + /i exch def + 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 +] } def +% +/P4 {[ + 0 2 P0 length 2 sub {/i exch def + 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 +] } def + n@ 1 eq {/Sierpinsky P0 def}{ + n@ 1 sub { + /Sierpinsky P1 P2 concatarray P3 concatarray P4 concatarray def + /Tab1 [ + 0 2 Sierpinsky length 2 sub {/i exch def + Sierpinsky i 2 getinterval + } for + ] def + /i@ Sierpinsky length 8 div 2.5 mul cvi def % + /Sierpinsky2 [ + Tab1 length { + Tab1 i@ get + /i@ i@ 1 add def + i@ Tab1 length ge {/i@ 0 def} if + }repeat + ] def + /P0 [ + 0 1 Sierpinsky2 length 1 sub {/i exch def + Sierpinsky2 i get aload pop + } for + ] def + /coefficient coefficient 2 mul def + } repeat + } ifelse +% + newpath + Sierpinsky 0 get Sierpinsky 1 get moveto + 0 2 Sierpinsky length 2 sub {/i exch def + i 2 div Npts ge {exit} if + Sierpinsky i get Sierpinsky i 1 add get lineto + } for + Npts 4 n@ 1 add exp cvi ge { closepath } if + useFill { gsave fillColor fill grestore } if +% + useLineStyle +} def +% +/tx@Phyllotaxis { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \pst@tempA +% \pst@fractal@c +% \pst@fractal@angle +% \pst@fractal@maxIter CMYK + /ifCMYK ED + /maxIter ED + /fractalAngle ED + /c ED + translate + /angle fractalAngle dup 0 eq { pop 360 5 sqrt 1 add 2 div dup mul div } if def + maxIter cvi -1 0 { + angle rotate + 0 0 moveto + dup sqrt c mul c lineto + c c neg rlineto + c neg dup rlineto + closepath + gsave + 1 exch maxIter cvi div 90 mul cos 0 + ifCMYK { tx@addDict begin RGBtoCMYK end setcmykcolor }{ setrgbcolor } ifelse + fill + grestore + stroke + } for +} def +% +/tx@Fern { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \pst@fractal@scale +% \pst@tempA +% \pst@fractal@maxIter +% \pst@fractal@radius +% \pst@number\pslinewidth +% { \pst@usecolor\pslinecolor } + /setColor ED + SLW + /radius ED + /maxIter ED + translate + dup scale + /m1 [ 0.00 0.00 0.00 0.16 0.00 0.00 ] def + /m2 [ 0.85 -0.04 0.04 0.85 0.00 1.60 ] def + /m3 [ 0.20 0.23 -0.26 0.22 0.00 1.60 ] def + /m4 [ -0.15 0.26 0.28 0.24 0.00 0.44 ] def + 1 setlinecap + setColor + 0 0 % start point + maxIter cvi { + % get a transformation matrix probabilistically + /r rand 100 mod def + r 1 lt { /m m1 def }{ r 86 lt + { /m m2 def }{ r 93 lt { + /m m3 def }{ /m m4 def } ifelse } ifelse } ifelse + % Make a linear transformation, then + % plot a point at current location + m transform 2 copy radius 0 360 arc + stroke + } repeat +} def +% +/tx@Kochflake { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \pst@tempA +% { \pst@usecolor\pslinecolor } +% \pst@fractal@scale +% \pst@fractal@angle +% CLW +% \pst@fractal@maxIter + /maxIter ED + 10 10 scale + 45 rotate + /side { + dup 0 gt { + 1 sub 1 3 div dup scale side 60 rotate side + -120 rotate side 60 rotate side 3 dup scale 1 add + }{ 1 1 rlineto 1 1 translate } ifelse + } def + /star { + dup currentlinewidth 1 1 + 4 -1 roll { pop 3 div } for + setlinewidth + 0 0 moveto + side -120 rotate side -120 rotate side + pop + closepath + } def + maxIter star +} def +% +/tx@Appolonius { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \pst@fractal@dIter +% \pst@number\pst@fractal@Radius +% \ifPst@fractal@Color true \else false \fi +% \ifPst@CMYK true \else false \fi +% gsave +% \pst@tempA translate +% \pst@usecolor\pslinecolor +% \pst@fractal@scale +% \pst@number\pslinewidth SLW +% + /ifCMYK ED + /ifColor ED + /Radius ED + /dIter ED + /icount 380 def + /setWaveColor { + /icount icount dup 780 gt { pop 380 }{ dIter add } ifelse def + tx@addDict begin icount + ifCMYK { wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor + }{ wavelengthToRGB Red Green Blue end setrgbcolor } ifelse + } def + /collect { [ 4 1 roll ] } def + /nget { exch dup 3 1 roll exch get } def + /polydup { 1 add [ exch 1 roll ] aload aload pop } def + /circle { aload pop newpath 0 360 arc closepath + ifColor { gsave setWaveColor fill grestore } if + stroke } def + /inverse { + aload 4 1 roll 3 1 roll dup mul exch dup mul add exch dup mul sub + dup 0 eq not {1 exch div} if + exch + aload pop + 4 -1 roll dup 5 1 roll mul 3 1 roll + 4 -1 roll dup 5 1 roll mul 3 1 roll + 4 -1 roll dup 5 1 roll mul 3 1 roll + 4 -1 roll pop + dup 0 lt {neg} if + collect + } def + /between { + collect + 0 nget 2 get exch 1 nget 2 get exch 3 1 roll + lt {aload pop 3 1 roll exch 3 -1 roll collect} if + 0 nget 2 get exch 2 nget 2 get exch 3 1 roll + lt {aload pop 3 -1 roll exch 3 1 roll collect} if + 1 nget 0 get exch 2 nget 2 get exch + 2 nget 0 get exch 1 nget 2 get exch + 1 nget 2 get exch 2 nget 2 get exch + 7 1 roll add 5 1 roll mul 3 1 roll mul add exch div + /xdisp exch def + 1 nget 1 get exch 2 nget 2 get exch + 2 nget 1 get exch 1 nget 2 get exch + 1 nget 2 get exch 2 nget 2 get exch + 7 1 roll add 5 1 roll mul 3 1 roll mul add exch div + /ydisp exch def + 0 nget aload pop 3 1 roll ydisp sub 3 1 roll xdisp sub 3 1 roll + collect + inverse dup + /first exch def + /second exch def + 1 nget 1 get exch 2 nget 1 get exch 3 1 roll sub /xvect exch def + 2 nget 0 get exch 1 nget 0 get exch 3 1 roll sub /yvect exch def + xvect dup mul yvect dup mul add sqrt + dup 0.0 eq not { first 2 get 2 mul exch div} if + dup xvect mul /xvect exch def + yvect mul /yvect exch def + first aload pop 3 1 roll yvect add 3 1 roll xvect add 3 1 roll + collect + inverse /first exch def + second aload pop 3 1 roll yvect sub 3 1 roll xvect sub 3 1 roll + collect + inverse /second exch def + first second + first 2 get second 2 get sub + 0 gt { exch } if + pop + aload pop + 3 1 roll ydisp add 3 1 roll xdisp add 3 1 roll collect + exch pop + } def + /appol { + aload pop 3 polydup between + dup circle + 2 nget CLW gt { 1 1 3 { pop 3 polydup collect 5 1 roll 4 -1 roll } for } if + pop pop pop pop + } def + /inside { + /temp exch def + 0 120 240 { + /angle exch def + temp aload pop + 3 sqrt 2 div 1 add div + /radius exch def + angle sin radius mul + angle cos radius mul + exch 4 -1 roll add + 3 1 roll add + radius 3 sqrt 2 div mul + collect + } for + } def +% + [ 0 0 Radius ] dup inside 4 polydup + 1 1 4 { pop circle } for + 1 1 4 { pop 3 polydup collect 5 1 roll 4 1 roll } for + pop pop pop pop { count 0 eq { exit } if appol } loop +} def +% +/tx@Hugo { %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%Creator: Hugo M. Ayala'89, MIT +% \pst@fractal@scale +% \pst@tempA +% \pst@fractal@maxIter, which is the depth +% \pst@number\pslinewidth +% { \pst@usecolor\pslinecolor } +/setColor ED +SLW +/depth ED +translate +dup scale +2 setlinecap +setColor +% +/oldarrayx [0 540 72 72] def +/oldarrayy [0 396 720 72] def +% +/scl .1 def +% +realtime srand +/prorand { rand 32768 div 32768 div 1 sub scl mul} def +/findrow {8 mul 7 sub sqrt 1 add 2 div truncate} def +/findindex {dup 1 sub mul 2 div 1 add} def +/findcolumn {dup findrow findindex sub} def +/findnewrow {2 mul 1 sub} def +/findnewcolumn {2 mul} def +/findarraysize {dup 1 add mul 2 div 1 add} def +/findnumoflines {dup 1 sub mul 2 div 3 mul} def +/findnumpoints {dup 1 add mul 2 div} def +/gtol {2 exch exp 1 add} def +/fixangle {dup 180 ge {180 sub} if} def +/backangle {dup 180 ge {180 sub} {180 add} ifelse} def +/splitline { + tpx btx add 2 div /mdx exch def + tpy bty add 2 div /mdy exch def + tpy bty sub tpx btx sub atan + 90 add fixangle + /lineangle exch def + tpy bty sub dup mul + tpx btx sub dup mul + add sqrt /linelen exch def + prorand linelen mul dup + lineangle cos mul mdx add /mdx exch def + lineangle sin mul mdy add /mdy exch def +} def +% +/findnewindex{ cvi /oldindex exch def + oldindex findrow cvi dup /oldrow exch def + findindex oldindex exch sub cvi /oldcolumn exch def + oldrow findnewrow cvi dup /newrow exch def findindex + oldcolumn findnewcolumn cvi dup /newcolumn exch def add + cvi /newindex exch def +} def +% +/drawfractal { + 1 1 generation gtol 1 sub findnumpoints { + cvi /topindex exch def + topindex dup findcolumn exch findrow 1 add findindex add cvi + /leftindex exch def + leftindex 1 add cvi + /rightindex exch def + /tpx oldarrayx topindex get def + /tpy oldarrayy topindex get def + /btx oldarrayx leftindex get def + /bty oldarrayy leftindex get def + /mdx oldarrayx rightindex get def + /mdy oldarrayy rightindex get def + tpx tpy moveto + btx bty lineto + mdx mdy lineto + closepath stroke + } for +} def +% +1 1 depth { + /generation exch def + generation gtol findarraysize cvi dup array /newarrayx exch def + array /newarrayy exch def + 1 1 generation 1 sub gtol findnumpoints { + findnewindex + newarrayx newindex + oldarrayx oldindex get put + newarrayy newindex + oldarrayy oldindex get put + } for + 1 1 generation 1 sub gtol 1 sub findnumpoints { + findnewindex + newcolumn newrow 2 add findindex add cvi dup + /leftindex exch def + 2 add cvi /rightindex exch def + newcolumn newrow 1 add findindex add cvi + /mindex exch def + /tpx newarrayx newindex get def + /tpy newarrayy newindex get def + /btx newarrayx leftindex get def + /bty newarrayy leftindex get def + splitline + newarrayx mindex mdx put + newarrayy mindex mdy put + mindex 1 add cvi /mindex exch def + /btx newarrayx rightindex get def + /bty newarrayy rightindex get def + splitline + newarrayx mindex mdx put + newarrayy mindex mdy put + /mindex leftindex 1 add cvi def + /tpx newarrayx leftindex get def + /tpy newarrayy leftindex get def + splitline + newarrayx mindex mdx put + newarrayy mindex mdy put + } for + /oldarrayx newarrayx def + /oldarrayy newarrayy def + 7 generation sub 5 div setlinewidth +% drawfractal showpage +} for +drawfractal +} def % end of /tx@Hugo +% +/FibonacciFractal { + 20 dict begin + n@ 2 sub { + /Fi F2 F1 concatstrings def + /F1 F2 def + /F2 Fi def + } repeat + /S Fi def + /nS S length def % nombre de lettres + 0 1 nS 2 sub {/j exch def + x1 y1 translate + /x0 0 def /y0 0 def + /k S j 1 getinterval cvi def + k 0 eq { + j 2 mod 0 eq { + angle neg rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + /flag 0 def + }{ + angle rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + /flag 1 def + } ifelse + }{ + tx ty lineto + currentpoint /y1 exch def /x1 exch def + /flag 2 def + } ifelse + } for + setLineColor + stroke + Pst@juxtaposition { + x1 y1 translate + flag 1 eq {-1 1 scale} if + flag 2 eq {90 rotate 1 -1 scale } if + 0 0 moveto + /x0 0 def /y0 0 def + /F1 (1) def + /F2 (0) def + /x1 0 def /y1 1 cmunit def + x1 y1 lineto + n@ 3 sub{ + /Fi F2 F1 concatstrings def + /F1 F2 def + /F2 Fi def + } repeat + /S Fi def + /nS S length def % nombre de lettres + 0 1 nS 2 sub {/j exch def + x1 y1 translate + /x0 0 def /y0 0 def + /k S j 1 getinterval cvi def + k 0 eq { + j 2 mod 0 eq { + -90 rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + }{ + 90 rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } ifelse + }{ + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } ifelse + } for + ColorF + stroke + } if % end Pst@juxtaposition + end +} def +% +/newFibonacciFractal { + 20 dict begin + n@ 2 sub { + /Fi F2 F1 concatstrings def + /F1 F2 def + /F2 Fi def + } repeat + % The Dense Fibonacci Word + /DFW () def + 0 2 F2 length 2 sub { + /i exch def + /I F2 i 2 getinterval def + I (00) eq {DFW (0) concatstrings /DFW exch def } if + I (01) eq {DFW (1) concatstrings /DFW exch def } if + I (10) eq {DFW (2) concatstrings /DFW exch def } if + } for +% morphismes +% newFibonacci +% 0->"", 1->1, 2->2 + /F2 DFW def + /Fi () def + 0 1 F2 length 1 sub { + /i exch def + /I F2 i 1 getinterval def + I (0) eq {Fi m@0 concatstrings /Fi exch def} if + I (1) eq {Fi m@1 concatstrings /Fi exch def} if + I (2) eq {Fi m@2 concatstrings /Fi exch def} if + } for + /S Fi def + /nS S length def % nombre de lettres + 0 1 nS 1 sub { + /j exch def + x1 y1 translate + /x0 0 def /y0 0 def + /k S j 1 getinterval cvi def + k 1 eq {angle neg rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } if + k 2 eq { angle rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } if + k 0 eq { + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } if + } for + setLineColor + stroke + end +} def +% +/i-FibonacciFractal { + 20 dict begin + /F0 (0) def + /Fi () def + i@ 1 sub { + Fi (0) concatstrings /Fi exch def + } repeat + Fi (1) concatstrings + /F1 exch def + n@ { + F1 F0 concatstrings + /Fi exch def + /F0 F1 def + /F1 Fi def + } repeat + /S Fi def + 0 0 translate + 0 0 moveto + currentpoint /y0 exch def /x0 exch def + 0 1 cmunit lineto + currentpoint /y1 exch def /x1 exch def + /tx {x1 x0 sub} def + /ty {y1 y0 sub} def +% + /nS S length def % nombre de lettres + 0 1 nS 2 sub { + /j exch def + x1 y1 translate + /x0 0 def /y0 0 def + /k S j 1 getinterval cvi def + k 0 eq { + j 2 mod 0 eq { + angle neg rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + }{ + angle rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } ifelse + }{ + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } ifelse + } for + setLineColor + stroke + end +} def +% +/k-FibonacciFractal { + 20 dict begin + /f0 (0) def + /fi (0) def + k@ 2 sub { + fi (0) concatstrings /fi exch def + } repeat + fi (1) concatstrings + /f1 exch def + /fi f1 def + n@ 1 sub { + k@ 1 sub { f1 fi concatstrings /f1 exch def } repeat + f1 f0 concatstrings /f1 exch def + /f0 fi def + /fi f1 def + } repeat + /S f1 def + t@x cmunit_1 28.45 mul t@y cmunit_1 28.45 mul translate + 0 0 moveto + currentpoint /y0 exch def /x0 exch def + 0 1 cmunit lineto + currentpoint /y1 exch def /x1 exch def + /tx {x1 x0 sub} def + /ty {y1 y0 sub} def + /nS S length def % nombre de lettres + 0 1 nS 1 sub {/j exch def + x1 y1 translate + /x0 0 def /y0 0 def + /k S j 1 getinterval cvi def + k 0 eq { + j 2 mod 0 eq { + angle neg rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } + { + angle rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } + ifelse +} { + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } ifelse + } for + setLineColor + stroke + end +} def +% +/Biperiodic-FibonacciWords { + 20 dict begin +/f0 () def +/f1 (0) def +/f2 a@ 1 sub {(0) f0 concatstrings /f0 exch def} repeat f0 (1) concatstrings def +3 1 n@ {/i exch def +/fi () def +i 2 mod 0 eq { + a@ { fi f2 concatstrings /fi exch def } repeat + }{ + b@ { fi f2 concatstrings /fi exch def } repeat + } ifelse + fi f1 concatstrings /fi exch def + /f1 f2 def + /f2 fi def +} for +/S f2 def +t@x cmunit_1 28.45 mul t@y cmunit_1 28.45 mul translate +0 0 moveto +currentpoint /y0 exch def /x0 exch def +1 cmunit 0 cmunit lineto +currentpoint /y1 exch def /x1 exch def +/tx {x1 x0 sub} def +/ty {y1 y0 sub} def +/nS S length def % nombre de lettres +0 1 nS 1 sub {/j exch def +x1 y1 translate +/x0 0 def /y0 0 def +/k S j 1 getinterval cvi def +k 0 eq { +j 2 mod 0 eq { + angle neg rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } + { + angle rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + } + ifelse +} { +tx ty lineto +currentpoint /y1 exch def /x1 exch def +} ifelse +} for + setLineColor +stroke +end + }def +% +/InverseLR { + 1 dict begin + /str exch def + 0 1 str length 1 sub {/i exch def + str i 1 getinterval (L) eq {str i (R) putinterval }{str i (L) putinterval }ifelse + } for + str + end +} def +% +/FibonacciPolyominoes { + 20 dict begin + gsave + t@x t@y translate + /q0 () def + /q1 (R) def + /N n@ 3 mul 1 add def + 2 1 N { + /n exch def + n 3 mod 2 eq {/qi q1 q0 concatstrings def} + {/qi q1 q0 InverseLR concatstrings def} ifelse + /q0 q1 def + /q1 qi def + } for + /q_1 q1 reversestring def + /qii () def + /Q 3 {qii q1 concatstrings /qii exch def } repeat + qii q_1 reversestring concatstrings def +% remarque +% identique /Q 4{qii q1 concatstrings /qii exch def} repeat qii def + /tx {x1 x0 sub} def + /ty {y1 y0 sub} def + /y0 0 def /x0 0 def + /x1 x0 0 cmunit add def /y1 y0 1 cmunit add def + newpath + x0 y0 moveto + x1 y1 lineto + 0 1 Q length 1 sub {/i exch def + x1 y1 translate + Q i 1 getinterval (L) eq { + 90 rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + }{ + 90 neg rotate + tx ty lineto + currentpoint /y1 exch def /x1 exch def + }ifelse + } for + closepath + setFillColor + setLineColor + 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 diff --git a/graphics/pstricks/contrib/pst-fractal/pst-fractal.sty b/graphics/pstricks/contrib/pst-fractal/pst-fractal.sty new file mode 100644 index 0000000000..3757084c2f --- /dev/null +++ b/graphics/pstricks/contrib/pst-fractal/pst-fractal.sty @@ -0,0 +1,12 @@ +%% $Id: pst-fractal.sty 1154 2020-03-10 19:38:13Z herbert $ +\RequirePackage{pstricks} +\ProvidesPackage{pst-fractal}[2007/09/25 package wrapper for + pst-fractal.tex (hv)] +\input{pst-fractal.tex} +\IfFileExists{pst-fractal.pro}{% + \ProvidesFile{pst-fractal.pro} + [2017/12/04 v. 0.06, PostScript prologue file (hv)] + \@addtofilelist{pst-fractal.pro}}{}% +\ProvidesFile{pst-fractal.tex} + [\filedate\space v\fileversion\space `PST-fractal' (hv)] +\endinput diff --git a/graphics/pstricks/contrib/pst-fractal/pst-fractal.tex b/graphics/pstricks/contrib/pst-fractal/pst-fractal.tex new file mode 100644 index 0000000000..d8162db193 --- /dev/null +++ b/graphics/pstricks/contrib/pst-fractal/pst-fractal.tex @@ -0,0 +1,738 @@ +%% $Id: pst-fractal.tex 1152 2020-03-10 19:33:03Z herbert $ +%% +%% This is file `pst-fractal.tex', +%% +%% IMPORTANT NOTICE: +%% +%% Package `pst-fractal.tex' +%% +%% Herbert Voss +%% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +%% +%% DESCRIPTION: +%% `pst-fractal' is a PSTricks package to draw Julia and +%% Mandelbrot sets as well as Sierpinski, ... +%% +\csname PSTfractalLoaded\endcsname +\let\PSTfractalLoaded\endinput +\ifx\PSTricksLoaded\endinput\else \input pstricks.tex\fi +\ifx\PSTricksAddLoaded\endinput\else\input pstricks-add.tex\fi +\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi +% +\def\fileversion{0.11} +\def\filedate{2020/03/10} +\message{`PST-fractal' v\fileversion, \filedate\space (hv)} +% +\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax +\pst@addfams{pst-fractal} +\pstheader{pst-fractal.pro} +%\SpecialCoor +% +\newdimen\pst@fractal@xWidth +\define@key[psset]{pst-fractal}{xWidth}[1cm]{\pssetlength\pst@fractal@xWidth{#1}} +\newdimen\pst@fractal@yWidth +\define@key[psset]{pst-fractal}{yWidth}[1cm]{\pssetlength\pst@fractal@yWidth{#1}} +\psset[pst-fractal]{xWidth=1cm,yWidth=1cm} +\define@key[psset]{pst-fractal}{type}[Julia]{\def\pst@fractal@type{#1}} +\psset[pst-fractal]{type=Julia}% or type=Mandel +\def\pst@fractal@Julia{Julia}\def\pst@fractal@Mandel{Mandel} +\define@key[psset]{pst-fractal}{baseColor}[white]{\pst@getcolor{#1}\pst@fractal@baseColor} +\psset[pst-fractal]{baseColor=white} +% +\define@key[psset]{pst-fractal}{cx}[0]{\def\pst@fractal@cx{#1 }} +\define@key[psset]{pst-fractal}{cy}[0]{\def\pst@fractal@cy{#1 }} +\define@key[psset]{pst-fractal}{dIter}[1]{\def\pst@fractal@dIter{#1 }} +\psset[pst-fractal]{cx=0,cy=0,dIter=1} +\define@key[psset]{pst-fractal}{maxIter}[255]{\pst@checknum{#1}\pst@fractal@maxIter} +\define@key[psset]{pst-fractal}{maxRadius}[100]{\pst@checknum{#1}\pst@fractal@maxRadius} +\psset[pst-fractal]{maxIter=255,maxRadius=100} +\define@key[psset]{pst-fractal}{plotpoints}[2000]{\pst@checknum{#1}\pst@fractal@plotpoints} +\psset[pst-fractal]{plotpoints=2000} +% +\define@key[psset]{pst-fractal}{angle}[0]{\pst@getangle{#1}\pst@fractal@angle} +\define@key[psset]{pst-fractal}{c}[5]{\pst@checknum{#1}\pst@fractal@c} +\newdimen\pst@fractal@minWidth +\define@key[psset]{pst-fractal}{minWidth}[1pt]{\pssetlength\pst@fractal@minWidth{#1}} +\psset[pst-fractal]{angle=0,c=5,minWidth=1pt} +% +\define@key[psset]{pst-fractal}{scale}[1]{\pst@getscale{#1}{\pst@fractal@scale}% + \let\pst@fractal@Xscale\pst@tempg} +\psset[pst-fractal]{scale=1} +% +\def\pst@fractal@radius{0.001 } +% +\newdimen\pst@fractal@Radius +\define@key[psset]{pst-fractal}{Radius}[5cm]{\pssetlength\pst@fractal@Radius{#1}} +\define@boolkey[psset]{pst-fractal}[Pst@fractal@]{Color}[true]{} +\psset[pst-fractal]{Radius=5cm,Color=false} +% +\define@key[psset]{pst-fractal}{n}{\def\pst@fractal@n{#1 }} +\define@key[psset]{pst-fractal}{dotcolor}{\pst@getcolor{#1}\psdotcolor} +\define@key[psset]{pst-fractal}{N}{\def\pst@fractal@N{#1}} +\psset[pst-fractal]{n=3,N=all,dotcolor=red} + +\define@key[psset]{pst-fractal}{i}{\def\pst@fractal@i{#1 }} % i-Fibonacci +\define@key[psset]{pst-fractal}{morphism}{\def\pst@fractal@morphism{#1}} % les substitutions +\define@boolkey[psset]{pst-fractal}[Pst@]{juxtaposition}[true]{} % +\define@key[psset]{pst-fractal}{colorF}{\pst@getcolor{#1}\pscolorF} +\psset[pst-fractal]{morphism=(0) (1) (2),juxtaposition=false,colorF=red,i=6} +% +%=========================================================== +% +\def\psCantor{\pst@object{psCantor}} +\def\psCantor@i{% + \addbefore@par{n=5,xWidth=10cm,yWidth=5mm,linewidth=2mm} + \begin@SpecialObj + \addto@pscode{ + /N@ \pst@fractal@n def +% \pst@number\psunit dup scale + /v 0 def + /deltaV \pst@number\pst@fractal@yWidth def + 0 0 moveto + /cantor_set { % x0 x1 v n + 4 dict begin + /n exch def + /v exch def + /x1 exch def + /x0 exch def + x0 v moveto + x1 v lineto \pst@usecolor\pslinecolor \pst@number\pslinewidth stroke + n 1 gt { + x0 dup dup add x1 add 3 div v deltaV sub n 1 sub cantor_set + x0 x1 dup add add 3 div x1 v deltaV sub n 1 sub cantor_set + } if + end + } def + 0 \pst@number\pst@fractal@xWidth 0 N@ cantor_set + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +\def\psHilbert{\pst@object{psHilbert}} +\def\psHilbert@i{% + \addbefore@par{n=4,N=all,dotcolor=red} + \begin@SpecialObj + \addto@pscode{ + /N@ \pst@fractal@n def + /NbrePts (\pst@fractal@N) def + NbrePts (all) eq {/Npts 4 N@ 1 add exp cvi def}{/Npts NbrePts cvi def Npts 4 N@ 1 add exp gt {/Npts 4 N@ 1 add exp cvi def} if } ifelse + /dotcolor {\pst@usecolor\psdotcolor } def + /cmunit {\pst@number\psunit mul} bind def + tx@fractalDict begin HilbertFractal + \psls@solid + \ifshowpoints + 0 2 HilbertCurve length 2 sub { + /i exch def + i 2 div Npts ge {exit} if + HilbertCurve i get + HilbertCurve i 1 add get + \psk@dotsize DS + 0 360 arc dotcolor fill + } for + \fi + end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +\def\psFibonacci{\pst@object{psFibonacci}} +\def\psFibonacci@i{% + \addbefore@par{n=10, angle=90}% + \begin@SpecialObj + \addto@pscode{ + /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle + /angle \pst@fractal@angle def + /n@ \pst@fractal@n def + n@ 3 le {/n@ 3 def} if + /ColorF { \pst@usecolor\pscolorF } def + /setLineColor { \pst@usecolor\pslinecolor } def + /Pst@juxtaposition \ifPst@juxtaposition true \else false \fi def + /F1 (1) def + /F2 (0) def + /tx { x1 x0 sub } def + /ty { y1 y0 sub } def + /x0 0 def /y0 0 def + x0 y0 moveto + /x1 0 def /y1 1 cmunit def + x1 y1 lineto + tx@fractalDict begin FibonacciFractal end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +% +\def\psNewFibonacci{\def\pst@par{}\pst@object{psNewFibonacci}} +\def\psNewFibonacci@i{% + \addbefore@par{n=10, angle=90}% + \begin@SpecialObj + \addto@pscode{ + /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle + /angle \pst@fractal@angle def + /n@ \pst@fractal@n def + n@ 3 le {/n@ 3 def} if + /morhism [\pst@fractal@morphism] def + /setLineColor { \pst@usecolor\pslinecolor } def + /m@0 morhism 0 get def + /m@1 morhism 1 get def + /m@2 morhism 2 get def + /F1 (1) def + /F2 (0) def + /tx {x1 x0 sub} def + /ty {y1 y0 sub} def + /x0 0 def /y0 0 def + x0 y0 moveto + /x1 0 def /y1 1 cmunit def + x1 y1 lineto + tx@fractalDict begin newFibonacciFractal end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +% i-Fibonacci +\def\psiFibonacci{\def\pst@par{}\pst@object{psiFibonacci}} +\def\psiFibonacci@i{% + \addbefore@par{angle=90}% + \begin@SpecialObj + \addto@pscode{ + /cmunit {\pst@number\psunit mul} def + /angle \pst@fractal@angle def + /n@ \pst@fractal@n def + n@ 3 le {/n@ 3 def} if + /i@ \pst@fractal@i def + /setLineColor { \pst@usecolor\pslinecolor } bind def + tx@fractalDict begin i-FibonacciFractal end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +% 30 septembre 2017 +% k-Fibonacci +\define@key[psset]{pst-fractal}{k}{\def\pst@fractal@k{#1 }} % k +\psset[pst-fractal]{k=5} +% +\def\pskFibonacci{\def\pst@par{}\pst@object{pskFibonacci}} +\def\pskFibonacci@i{\@ifnextchar({\pskFibonacci@ii}{\pskFibonacci@ii(0,0)}} +\def\pskFibonacci@ii(#1){% + \addbefore@par{k=5,angle=90}% + \begin@SpecialObj + \pst@@getcoor{#1}% + \addto@pscode{ + \pst@coor /t@y ED /t@x ED + /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle + /cmunit_1 {\pst@number\psunit div} bind def % mise à l'échelle + /angle \pst@fractal@angle def + /n@ \pst@fractal@n def + /k@ \pst@fractal@k def + /setLineColor { \pst@usecolor\pslinecolor } def + tx@fractalDict begin k-FibonacciFractal end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +% 1 octobre 2017 +% Biperiodic-Fibonacci-Words +\define@key[psset]{pst-fractal}{a}{\def\pst@fractal@a{#1 }} % k +\psset[pst-fractal]{a=5} +\define@key[psset]{pst-fractal}{b}{\def\pst@fractal@b{#1 }} % k +\psset[pst-fractal]{b=5} +% +\def\psBiperiodicFibonacci{\def\pst@par{}\pst@object{psBiperiodicFibonacci}} +\def\psBiperiodicFibonacci@i{\@ifnextchar({\psBiperiodicFibonacci@ii}{\psBiperiodicFibonacci@ii(0,0)}} +\def\psBiperiodicFibonacci@ii(#1){% + \addbefore@par{a=5,b=5,angle=90,n=3,k=5} + \begin@SpecialObj + \pst@@getcoor{#1}% + \addto@pscode{ + \pst@coor /t@y ED /t@x ED + /cmunit {\pst@number\psunit mul} bind def + /cmunit_1 {\pst@number\psunit div} bind def + /a@ \pst@fractal@a def + /b@ \pst@fractal@b def + /angle \pst@fractal@angle def + /n@ \pst@fractal@n def + /k@ \pst@fractal@k def + /setLineColor { \pst@usecolor\pslinecolor } def + tx@fractalDict begin Biperiodic-FibonacciWords end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +% 3 octobre 2017 +% +\def\psFibonacciPolyominoes{\pst@object{psFibonacciPolyominoes}} +\def\psFibonacciPolyominoes@i{\@ifnextchar({\psFibonacciPolyominoes@ii}{\psFibonacciPolyominoes@ii(0,0)}} +\def\psFibonacciPolyominoes@ii(#1){% + \addbefore@par{n=3} + \begin@SpecialObj + \pst@@getcoor{#1}% + \addto@pscode{ + \pst@coor /t@y ED /t@x ED + /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle + /n@ \pst@fractal@n def + /setFillColor { + \ifx\psk@fillstyle\relax\else + gsave \pst@usecolor\psfillcolor fill grestore + \fi } def + /setLineColor{ \ifx\pslinestyle\@none\else stroke \fi } def + tx@fractalDict begin FibonacciPolyominoes end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +% type de fonte et taille +\define@boolkey[psset]{pst-fractal}[Pst@]{DFW}[true]{} % +\define@boolkey[psset]{pst-fractal}[Pst@]{iFibonacci}[true]{} % +\psset[pst-fractal]{DFW=false,iFibonacci=false} % +% +\def\psFibonacciWord{\pst@object{psFibonacciWord}} +\def\psFibonacciWord@i{\@ifnextchar({\psFibonacciWord@ii}{\psFibonacciWord@ii(0,0)}} +\def\psFibonacciWord@ii(#1,#2){% + \addbefore@par{%PSfont=Times-Roman, + fontscale=8} + \begin@SpecialObj + \addto@pscode{ + /n@ \pst@fractal@n def + /i@ \pst@fractal@i def + n@ 3 le {/n@ 3 def} if + /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle + /PSfont {\psk@PSfont} def + PSfont findfont \psk@fontscale scalefont setfont + /F1 (1) def + /F2 (0) def + n@ 2 sub{ + /Fi F2 F1 concatstrings def + /F1 F2 def + /F2 Fi def + } repeat + \ifPst@DFW + /Fi () def + 0 2 F2 length 2 sub {/i exch def + /I F2 i 2 getinterval def + I (00) eq {Fi (0) concatstrings /Fi exch def} if + I (01) eq {Fi (1) concatstrings /Fi exch def} if + I (10) eq {Fi (2) concatstrings /Fi exch def} if + } for + \fi + \ifPst@iFibonacci + /F0 (0) def + /Fi () def + i@ 1 sub { + Fi (0) concatstrings /Fi exch def + } repeat + Fi (1) concatstrings + /F1 exch def + n@ { + F1 F0 concatstrings + /Fi exch def + /F0 F1 def + /F1 Fi def + } repeat + \fi + #1 cmunit #2 cmunit moveto Fi show + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} + +% +\def\psfractal{\pst@object{psfractal}} +\def\psfractal@i{\@ifnextchar({\psfractal@ii}{\psfractal@ii(-1,-1)}}% +\def\psfractal@ii(#1){\@ifnextchar({\psfractal@iii(#1)}{\psfractal@iii(#1)(1,1)}}% +\def\psfractal@iii(#1)(#2){% + \begin@SpecialObj + \psset{unit=1pt}% + \pst@getcoor{#1}\pst@temp@A + \pst@getcoor{#2}\pst@temp@B + \pspicture(\pst@fractal@xWidth,\pst@fractal@yWidth)% + \addto@pscode{ + \pst@temp@A + \pst@temp@B + \pst@number\pst@fractal@xWidth + \pst@number\pst@fractal@yWidth + \pst@fractal@cx + \pst@fractal@cy + \pst@fractal@maxIter + \pst@fractal@dIter + \pst@fractal@maxRadius + { \pst@usecolor\pst@fractal@baseColor } + \ifx\pst@fractal@type\pst@fractal@Julia true \else false \fi + \ifPst@CMYK true \else false \fi ^^J + tx@fractalDict begin tx@Fractal end ^^J + }% end add@pscode + \endpspicture + \end@SpecialObj + \ignorespaces} +% +\def\psSier{\pst@object{psSier}} +\def\psSier@i{\@ifnextchar({\psSier@v}{\psSier@vi}} +% +\def\psSier@v(#1){\@ifnextchar({\psSier@ii(#1)}{\psSier@iii(#1)}} +\def\psSier@ii(#1)(#2)(#3){{% + \pst@getcoor{#1}\pst@temp@A + \pst@getcoor{#2}\pst@temp@B + \pst@getcoor{#3}\pst@temp@C + \begin@SpecialObj% + \addto@pscode{ + [ \pst@temp@A \pst@temp@B \pst@temp@C ] ^^J% + { \pst@usecolor\pslinecolor } ^^J% + \pst@fractal@plotpoints ^^J% + tx@fractalDict begin tx@Sierpinski end ^^J% + }% end add@pscode + \end@SpecialObj% +}} +\def\psSier@iii(#1)#2#3{% + \pst@getcoor{#1}\pst@tempA + \pst@getlength{#2}\pst@tempB + \begin@OpenObj% + \addto@pscode{ + /sierpy { + dup 1 ge + { 1 sub gsave 0.5 dup scale dup sierpy + 1 0 translate dup sierpy + -0.5 0.8660254 translate dup sierpy grestore + }{newpath + 0 0 moveto + 1 0 lineto 0.5 0.8660254 lineto closepath + gsave \pst@usecolor\pslinecolor + fill grestore } ifelse pop + } def + \pst@tempA\space translate + \pst@tempB\space dup scale + 0 setlinewidth + 0 0 moveto 1 0 lineto 0.5 0.8660254 lineto 0 setlinewidth closepath + gsave #3 0 gt { \pst@usecolor\psfillcolor }{ \pst@usecolor\pslinecolor } ifelse + fill grestore stroke + #3 dup 0 gt { sierpy } if }% + \end@OpenObj% +} +% +\def\psSier@vi{% Sierpinski curve + \addbefore@par{n=3,N=all,dotcolor=red}% + \begin@SpecialObj + \addto@pscode{ + /useFill \ifx\psk@fillstylename\@none false \else true \fi def + /fillColor { \pst@usecolor\psfillcolor } def +% \else +% /useFillColor {  +% \ifx\psk@fillstylename\@none +% \else +% gsave \pst@usecolor\psfillcolor fill grestore +% \fi +% } def + /useLineStyle { \ifx\pslinestyle\@none\else \psls@solid stroke \fi } def + /n@ \pst@fractal@n def + /NbrePts (\pst@fractal@N) def + /dotcolor { \pst@usecolor\psdotcolor } def + /cmunit { \pst@number\psunit mul } def + NbrePts (all) eq {/Npts 4 n@ 1 add exp cvi def}{/Npts NbrePts cvi def Npts 4 n@ 1 add exp gt {/Npts 4 n@ 1 add exp cvi def} if } ifelse + tx@fractalDict begin tx@SierpinskiCurve + \ifshowpoints + 0 2 Sierpinsky length 2 sub { + /i exch def + i 2 div Npts ge {exit} if + Sierpinsky i get + Sierpinsky i 1 add get + \psk@dotsize DS + 0 360 arc dotcolor fill + } for + \fi + end + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +\def\psPhyllotaxis{\pst@object{psPhyllotaxis}} +\def\psPhyllotaxis@i{\@ifnextchar({\psPhyllotaxis@ii}{\psPhyllotaxis@ii(0,0)}} +\def\psPhyllotaxis@ii(#1){{% + \pst@getcoor{#1}\pst@tempA + \begin@SpecialObj% + \addto@pscode{ + \pst@tempA + \pst@fractal@c + \pst@fractal@angle + \pst@fractal@maxIter + \ifPst@CMYK true \else false \fi ^^J% + tx@fractalDict begin tx@Phyllotaxis end ^^J% + }% end add@pscode + \end@SpecialObj% +}} +% +\def\pst@fractal@radius{0.001 } +\def\psFern{\pst@object{psFern}} +\def\psFern@i{\@ifnextchar({\psFern@ii}{\psFern@ii(0,0)}} +\def\psFern@ii(#1){{% + \addbefore@par{scale=10,linewidth=0.001pt,maxIter=20000,radius=0.001pt}% + \pst@getcoor{#1}\pst@tempA% + \begin@SpecialObj% + \addto@pscode{ + \pst@fractal@Xscale + \pst@tempA + \pst@fractal@maxIter + \pst@fractal@radius + \pst@number\pslinewidth + { \pst@usecolor\pslinecolor } + tx@fractalDict begin tx@Fern end + }% end add@pscode + \end@SpecialObj% +}} +% +\def\psHugo{\pst@object{psHugo}} +\def\psHugo@i{\@ifnextchar({\psHugo@ii}{\psHugo@ii(0,0)}} +\def\psHugo@ii(#1){{% + \addbefore@par{scale=0.1,linewidth=0.001pt,maxIter=5}% + \pst@getcoor{#1}\pst@tempA% + \begin@SpecialObj% + \addto@pscode{ + \pst@fractal@Xscale + \pst@tempA + \pst@fractal@maxIter + \pst@number\pslinewidth + { \pst@usecolor\pslinecolor } + tx@fractalDict begin tx@Hugo end + }% end add@pscode + \end@SpecialObj% +}} +% +\def\psKochflake{\pst@object{psKochflake}} +\def\psKochflake@i{\@ifnextchar({\psKochflake@ii}{\psKochflake@ii(0,0)}} +\def\psKochflake@ii(#1){{% + \addbefore@par{radius=0.25cm,maxIter=5}% + \pst@getcoor{#1}\pst@tempA + \begin@SpecialObj + \addto@pscode{ + gsave ^^J + \pst@tempA translate + \pst@usecolor\pslinecolor + \pst@fractal@angle rotate ^^J + \pst@number\pslinewidth 10 div \pst@fractal@Xscale div SLW ^^J + \pst@fractal@maxIter ^^J + tx@fractalDict begin ^^J + \pst@fractal@scale ^^J + tx@Kochflake end ^^J + }% end add@pscode + \psk@fillstyle + \addto@pscode{stroke grestore }% + \end@SpecialObj +}} +% +\def\psAppolonius{\pst@object{psAppolonius}} +\def\psAppolonius@i{\@ifnextchar({\psAppolonius@ii}{\psAppolonius@ii(0,0)}} +\def\psAppolonius@ii(#1){{% + \addbefore@par{Radius=5cm,dIter=1,linewidth=0.1pt}% + \pst@getcoor{#1}\pst@tempA% + \begin@SpecialObj% + \addto@pscode{ + \pst@fractal@dIter + \pst@number\pst@fractal@Radius + \ifPst@fractal@Color true \else false \fi + \ifPst@CMYK true \else false \fi ^^J + tx@fractalDict begin ^^J + gsave ^^J + \pst@tempA translate ^^J + \pst@usecolor\pslinecolor + \pst@fractal@scale + \pst@number\pslinewidth SLW ^^J + tx@Appolonius end ^^J + }% end add@pscode + \psk@fillstyle% + \addto@pscode{stroke grestore}% + \end@SpecialObj% +}} +% +\def\psPTree{\pst@object{psPTree}} +\def\psPTree@i{\@ifnextchar({\psPTree@ii}{\psPTree@ii(0,0)}} +\def\psPTree@ii(#1){{% + \addbefore@par{xWidth=1cm,Color=false,c=0.5}% + \pst@getcoor{#1}\pst@tempA% + \begin@SpecialObj% + \addto@pscode{ + gsave ^^J% + \pst@tempA exch \pst@number\pst@fractal@xWidth 2 div sub exch translate ^^J% + \pst@usecolor\pslinecolor + \pst@fractal@scale + \pst@number\pslinewidth \pst@fractal@Xscale div SLW ^^J% + /sqrt2 1.41421356237310 def ^^J% + /minWidth \pst@number\pst@fractal@minWidth def + /r 1 def /g 0 def /b 0 def + /icount 380 def + /setWaveColor { + /icount icount dup 780 gt { pop 380 }{ \pst@fractal@dIter add } ifelse def ^^J% + tx@addDict begin icount ^^J% + \ifPst@CMYK wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor ^^J% + \else wavelengthToRGB Red Green Blue end setrgbcolor \fi ^^J% + } def ^^J% + /Alpha1 { .5 1 \pst@fractal@c sub atan } bind def + /Alpha2 { .5 \pst@fractal@c atan } bind def + /box { \@percentchar stacksize ^^J % width on stack + /w ED + newpath % + 0 0 moveto % + w 0 rlineto % w 0 move right + 0 w rlineto % 0 w move up + w neg \pst@fractal@c mul w 0.5 mul % -c*w 0.5*w + rlineto % move left up + w \pst@fractal@c 1 sub mul % -(1-c)*w + w -0.5 mul rlineto % -(1-c)*w -0.5w move left down + closepath % close + \ifPst@fractal@Color + setWaveColor fill ^^J% +% r g b setrgbcolor fill r g b /g exch def /r exch def /b exch def + \else stroke \fi % + w minWidth gt { % w w limit gt + gsave % + 0 w translate + Alpha1 rotate + w dup 0.5 mul 1 \pst@fractal@c sub w mul Pyth box % one w to leave on stack + grestore + gsave + dup dup dup % w w w w + 1 \pst@fractal@c sub mul % w w w w*(1-c) + exch 1.5 mul % w w w*(1-c) w*1.5 + translate % w w + 360 Alpha2 sub rotate + 0.5 mul exch \pst@fractal@c mul Pyth box + grestore + } if + } def + \pst@number\pst@fractal@xWidth box ^^J% + }% end add@pscode + \end@SpecialObj% +}} +% +\def\psFArrow{\pst@object{psFArrow}} +\def\psFArrow@i{\@ifnextchar({\psFArrow@ii}{\psFArrow@ii(0,0)}} +\def\psFArrow@ii(#1)#2{{% + \addbefore@par{linewidth=10pt,yWidth=5cm,maxIter=10,Color=false,scale=1,dIter=1}% + \pst@getcoor{#1}\pst@tempA% + \begin@SpecialObj% + \addto@pscode{ + gsave ^^J% + \pst@tempA translate 0 0 moveto ^^J% + \pst@usecolor\pslinecolor ^^J% + \pst@fractal@scale ^^J% + /depth 0 def ^^J% + /depth++ { /depth depth 1 add def } def ^^J% + /depth-- { /depth depth 1 sub def } def ^^J% + /icount 380 def ^^J% + /setWaveColor { ^^J% + /icount icount dup 780 gt { pop 380 }{ \pst@fractal@dIter add } ifelse def ^^J% + tx@addDict begin icount ^^J% + \ifPst@CMYK wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor ^^J% + \else wavelengthToRGB Red Green Blue end setrgbcolor \fi ^^J% + } def ^^J% + /DoLine { \@percentchar print a vert. line ^^J% + 0 \pst@number\pst@fractal@yWidth rlineto currentpoint ^^J% + \ifPst@fractal@Color setWaveColor \fi ^^J% + stroke ^^J% + translate 0 0 moveto ^^J% + } def ^^J% + /FractArrow { ^^J% + /sc exch def ^^J% + gsave ^^J% + sc dup scale ^^J% + \pst@number\pslinewidth SLW ^^J% + depth++ DoLine ^^J% + depth \pst@fractal@maxIter le { ^^J% + 135 rotate sc FractArrow ^^J% + -270 rotate sc FractArrow ^^J% + } if ^^J% + depth-- ^^J% + grestore ^^J% + } def ^^J% + \pst@fractal@angle rotate ^^J% + #2 FractArrow ^^J% +% 180 rotate #2 FractArrow +% stroke + }% end add@pscode + \end@SpecialObj% +}} +% +\define@key[psset]{pst-fractal}{NbrIter}{\def\pst@fractal@NbrIter{#1 }} % nombre d'itérations +\define@key[psset]{pst-fractal}{tabPts}{\def\pst@fractal@tabPts{#1 }} % tableau de points +\define@key[psset]{pst-fractal}{angleH}{\def\pst@fractal@angleH{#1 }} % angle en radians +\define@key[psset]{pst-fractal}{zoom}{\def\pst@fractal@zoom{#1 }} % grossissement +\psset[pst-fractal]{NbrIter=500,angleH=1.32837,zoom=5,tabPts=0.05 0.05 +0.1 0.1 +0.2 0.2 +0.3 0.2 +0.3 0.3 +0.4 0.3 +0.4 0.324 +0.4 0.326 +0.4 0.5 +0.5 0.3 +0.5 0.5 +0.6 0.5 +0.6 0.6 +0.57 0.575 +0.7 0.7 +0.7 0.9} +\define@boolkey[psset]{pst-fractal}[Pst@]{pixelscolor}[true]{} +\psset[pst-fractal]{pixelscolor=true} % pixels en couleurs + +\def\psHenon{\pst@object{psHenon}} +\def\psHenon@i{% + \addbefore@par{dotsize=0.75pt}% + \begin@SpecialObj + \addto@pscode{ +% échelle 2=> 10 cm pour zoom=5 + /zoom \pst@fractal@zoom def + /cm {\pst@number\psunit mul zoom mul} bind def + /NbreIter \pst@fractal@NbrIter def + /Angle \pst@fractal@angleH RadtoDeg def + /CosA Angle cos def + /SinA Angle sin def + /TabPts [\pst@fractal@tabPts] def + \ifPst@pixelscolor /pixelscolor true def \else /pixelscolor false def \fi + /AttracteurHenon { + 5 dict begin + /Y exch def /X exch def /Aux X def + NbreIter { + /Aux X def + /X X CosA mul Y X X mul sub SinA mul sub def + /Y Aux SinA mul Y Aux Aux mul sub CosA mul add def + X abs 1e12 ge Y abs 1e10 ge or { exit }{ + newpath + X cm \psk@@dotsize sub Y cm \psk@@dotsize sub moveto + \psk@@dotsize 0 rlineto % bottom of square + 0 \psk@@dotsize rlineto % right side of square + -\psk@@dotsize 0 rlineto % top of square + closepath + fill + }ifelse + } repeat + end + } def + /Hsb 0 def + 0 2 TabPts length 2 sub { + /i exch def + % 0 setgray + %TabPts i get TabPts i 1 add get 2 copy + %exch 200 mul exch 200 mul 2 0 360 arc fill + pixelscolor {Hsb 1 1 sethsbcolor}{0 setgray}ifelse + TabPts i get TabPts i 1 add get + AttracteurHenon + /Hsb i TabPts length div def + } for + }% + \showpointsfalse + \end@SpecialObj + \ignorespaces} +% +\catcode`\@=\PstAtCode\relax +% +%% END: pst-fractal.tex +\endinput + diff --git a/graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex b/graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex deleted file mode 100644 index b60dcaf3da..0000000000 --- a/graphics/pstricks/contrib/pst-fractal/tex/pst-fractal.tex +++ /dev/null @@ -1,738 +0,0 @@ -%% $Id: pst-fractal.tex 846 2018-11-30 21:44:45Z herbert $ -%% -%% This is file `pst-fractal.tex', -%% -%% IMPORTANT NOTICE: -%% -%% Package `pst-fractal.tex' -%% -%% Herbert Voss -%% -%% This program can be redistributed and/or modified under the terms -%% of the LaTeX Project Public License Distributed from CTAN archives -%% in directory macros/latex/base/lppl.txt. -%% -%% DESCRIPTION: -%% `pst-fractal' is a PSTricks package to draw Julia and -%% Mandelbrot sets as well as Sierpinski, ... -%% -\csname PSTfractalLoaded\endcsname -\let\PSTfractalLoaded\endinput -\ifx\PSTricksLoaded\endinput\else \input pstricks.tex\fi -\ifx\PSTricksAddLoaded\endinput\else\input pstricks-add.tex\fi -\ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi -% -\def\fileversion{0.10} -\def\filedate{2018/11/30} -\message{`PST-fractal' v\fileversion, \filedate\space (hv)} -% -\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax -\pst@addfams{pst-fractal} -\pstheader{pst-fractal.pro} -%\SpecialCoor -% -\newdimen\pst@fractal@xWidth -\define@key[psset]{pst-fractal}{xWidth}[1cm]{\pssetlength\pst@fractal@xWidth{#1}} -\newdimen\pst@fractal@yWidth -\define@key[psset]{pst-fractal}{yWidth}[1cm]{\pssetlength\pst@fractal@yWidth{#1}} -\psset[pst-fractal]{xWidth=1cm,yWidth=1cm} -\define@key[psset]{pst-fractal}{type}[Julia]{\def\pst@fractal@type{#1}} -\psset[pst-fractal]{type=Julia}% or type=Mandel -\def\pst@fractal@Julia{Julia}\def\pst@fractal@Mandel{Mandel} -\define@key[psset]{pst-fractal}{baseColor}[white]{\pst@getcolor{#1}\pst@fractal@baseColor} -\psset[pst-fractal]{baseColor=white} -% -\define@key[psset]{pst-fractal}{cx}[0]{\def\pst@fractal@cx{#1 }} -\define@key[psset]{pst-fractal}{cy}[0]{\def\pst@fractal@cy{#1 }} -\define@key[psset]{pst-fractal}{dIter}[1]{\def\pst@fractal@dIter{#1 }} -\psset[pst-fractal]{cx=0,cy=0,dIter=1} -\define@key[psset]{pst-fractal}{maxIter}[255]{\pst@checknum{#1}\pst@fractal@maxIter} -\define@key[psset]{pst-fractal}{maxRadius}[100]{\pst@checknum{#1}\pst@fractal@maxRadius} -\psset[pst-fractal]{maxIter=255,maxRadius=100} -\define@key[psset]{pst-fractal}{plotpoints}[2000]{\pst@checknum{#1}\pst@fractal@plotpoints} -\psset[pst-fractal]{plotpoints=2000} -% -\define@key[psset]{pst-fractal}{angle}[0]{\pst@getangle{#1}\pst@fractal@angle} -\define@key[psset]{pst-fractal}{c}[5]{\pst@checknum{#1}\pst@fractal@c} -\newdimen\pst@fractal@minWidth -\define@key[psset]{pst-fractal}{minWidth}[1pt]{\pssetlength\pst@fractal@minWidth{#1}} -\psset[pst-fractal]{angle=0,c=5,minWidth=1pt} -% -\define@key[psset]{pst-fractal}{scale}[1]{\pst@getscale{#1}{\pst@fractal@scale}% - \let\pst@fractal@Xscale\pst@tempg} -\psset[pst-fractal]{scale=1} -% -\def\pst@fractal@radius{0.001 } -% -\newdimen\pst@fractal@Radius -\define@key[psset]{pst-fractal}{Radius}[5cm]{\pssetlength\pst@fractal@Radius{#1}} -\define@boolkey[psset]{pst-fractal}[Pst@fractal@]{Color}[true]{} -\psset[pst-fractal]{Radius=5cm,Color=false} -% -\define@key[psset]{pst-fractal}{n}{\def\pst@fractal@n{#1 }} -\define@key[psset]{pst-fractal}{dotcolor}{\pst@getcolor{#1}\psdotcolor} -\define@key[psset]{pst-fractal}{N}{\def\pst@fractal@N{#1}} -\psset[pst-fractal]{n=3,N=all,dotcolor=red} - -\define@key[psset]{pst-fractal}{i}{\def\pst@fractal@i{#1 }} % i-Fibonacci -\define@key[psset]{pst-fractal}{morphism}{\def\pst@fractal@morphism{#1}} % les substitutions -\define@boolkey[psset]{pst-fractal}[Pst@]{juxtaposition}[true]{} % -\define@key[psset]{pst-fractal}{colorF}{\pst@getcolor{#1}\pscolorF} -\psset[pst-fractal]{morphism=(0) (1) (2),juxtaposition=false,colorF=red,i=6} -% -%=========================================================== -% -\def\psCantor{\pst@object{psCantor}} -\def\psCantor@i{% - \addbefore@par{n=5,xWidth=10cm,yWidth=5mm,linewidth=2mm} - \begin@SpecialObj - \addto@pscode{ - /N@ \pst@fractal@n def -% \pst@number\psunit dup scale - /v 0 def - /deltaV \pst@number\pst@fractal@yWidth def - 0 0 moveto - /cantor_set { % x0 x1 v n - 4 dict begin - /n exch def - /v exch def - /x1 exch def - /x0 exch def - x0 v moveto - x1 v lineto \pst@usecolor\pslinecolor \pst@number\pslinewidth stroke - n 1 gt { - x0 dup dup add x1 add 3 div v deltaV sub n 1 sub cantor_set - x0 x1 dup add add 3 div x1 v deltaV sub n 1 sub cantor_set - } if - end - } def - 0 \pst@number\pst@fractal@xWidth 0 N@ cantor_set - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -\def\psHilbert{\pst@object{psHilbert}} -\def\psHilbert@i{% - \addbefore@par{n=4,N=all,dotcolor=red} - \begin@SpecialObj - \addto@pscode{ - /N@ \pst@fractal@n def - /NbrePts (\pst@fractal@N) def - NbrePts (all) eq {/Npts 4 N@ 1 add exp cvi def}{/Npts NbrePts cvi def Npts 4 N@ 1 add exp gt {/Npts 4 N@ 1 add exp cvi def} if } ifelse - /dotcolor {\pst@usecolor\psdotcolor } def - /cmunit {\pst@number\psunit mul} bind def - tx@fractalDict begin HilbertFractal - \psls@solid - \ifshowpoints - 0 2 HilbertCurve length 2 sub { - /i exch def - i 2 div Npts ge {exit} if - HilbertCurve i get - HilbertCurve i 1 add get - \psk@dotsize DS - 0 360 arc dotcolor fill - } for - \fi - end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -\def\psFibonacci{\pst@object{psFibonacci}} -\def\psFibonacci@i{% - \addbefore@par{n=10, angle=90}% - \begin@SpecialObj - \addto@pscode{ - /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle - /angle \pst@fractal@angle def - /n@ \pst@fractal@n def - n@ 3 le {/n@ 3 def} if - /ColorF { \pst@usecolor\pscolorF } def - /setLineColor { \pst@usecolor\pslinecolor } def - /Pst@juxtaposition \ifPst@juxtaposition true \else false \fi def - /F1 (1) def - /F2 (0) def - /tx { x1 x0 sub } def - /ty { y1 y0 sub } def - /x0 0 def /y0 0 def - x0 y0 moveto - /x1 0 def /y1 1 cmunit def - x1 y1 lineto - tx@fractalDict begin FibonacciFractal end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -% -\def\psNewFibonacci{\def\pst@par{}\pst@object{psNewFibonacci}} -\def\psNewFibonacci@i{% - \addbefore@par{n=10, angle=90}% - \begin@SpecialObj - \addto@pscode{ - /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle - /angle \pst@fractal@angle def - /n@ \pst@fractal@n def - n@ 3 le {/n@ 3 def} if - /morhism [\pst@fractal@morphism] def - /setLineColor { \pst@usecolor\pslinecolor } def - /m@0 morhism 0 get def - /m@1 morhism 1 get def - /m@2 morhism 2 get def - /F1 (1) def - /F2 (0) def - /tx {x1 x0 sub} def - /ty {y1 y0 sub} def - /x0 0 def /y0 0 def - x0 y0 moveto - /x1 0 def /y1 1 cmunit def - x1 y1 lineto - tx@fractalDict begin newFibonacciFractal end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -% i-Fibonacci -\def\psiFibonacci{\def\pst@par{}\pst@object{psiFibonacci}} -\def\psiFibonacci@i{% - \addbefore@par{angle=90}% - \begin@SpecialObj - \addto@pscode{ - /cmunit {\pst@number\psunit mul} def - /angle \pst@fractal@angle def - /n@ \pst@fractal@n def - n@ 3 le {/n@ 3 def} if - /i@ \pst@fractal@i def - /setLineColor { \pst@usecolor\pslinecolor } bind def - tx@fractalDict begin i-FibonacciFractal end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -% 30 septembre 2017 -% k-Fibonacci -\define@key[psset]{pst-fractal}{k}{\def\pst@fractal@k{#1 }} % k -\psset[pst-fractal]{k=5} -% -\def\pskFibonacci{\def\pst@par{}\pst@object{pskFibonacci}} -\def\pskFibonacci@i{\@ifnextchar({\pskFibonacci@ii}{\pskFibonacci@ii(0,0)}} -\def\pskFibonacci@ii(#1){% - \addbefore@par{k=5,angle=90}% - \begin@SpecialObj - \pst@@getcoor{#1}% - \addto@pscode{ - \pst@coor /t@y ED /t@x ED - /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle - /cmunit_1 {\pst@number\psunit div} bind def % mise à l'échelle - /angle \pst@fractal@angle def - /n@ \pst@fractal@n def - /k@ \pst@fractal@k def - /setLineColor { \pst@usecolor\pslinecolor } def - tx@fractalDict begin k-FibonacciFractal end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -% 1 octobre 2017 -% Biperiodic-Fibonacci-Words -\define@key[psset]{pst-fractal}{a}{\def\pst@fractal@a{#1 }} % k -\psset[pst-fractal]{a=5} -\define@key[psset]{pst-fractal}{b}{\def\pst@fractal@b{#1 }} % k -\psset[pst-fractal]{b=5} -% -\def\psBiperiodicFibonacci{\def\pst@par{}\pst@object{psBiperiodicFibonacci}} -\def\psBiperiodicFibonacci@i{\@ifnextchar({\psBiperiodicFibonacci@ii}{\psBiperiodicFibonacci@ii(0,0)}} -\def\psBiperiodicFibonacci@ii(#1){% - \addbefore@par{a=5,b=5,angle=90,n=3,k=5} - \begin@SpecialObj - \pst@@getcoor{#1}% - \addto@pscode{ - \pst@coor /t@y ED /t@x ED - /cmunit {\pst@number\psunit mul} bind def - /cmunit_1 {\pst@number\psunit div} bind def - /a@ \pst@fractal@a def - /b@ \pst@fractal@b def - /angle \pst@fractal@angle def - /n@ \pst@fractal@n def - /k@ \pst@fractal@k def - /setLineColor { \pst@usecolor\pslinecolor } def - tx@fractalDict begin Biperiodic-FibonacciWords end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -% 3 octobre 2017 -% -\def\psFibonacciPolyominoes{\pst@object{psFibonacciPolyominoes}} -\def\psFibonacciPolyominoes@i{\@ifnextchar({\psFibonacciPolyominoes@ii}{\psFibonacciPolyominoes@ii(0,0)}} -\def\psFibonacciPolyominoes@ii(#1){% - \addbefore@par{n=3} - \begin@SpecialObj - \pst@@getcoor{#1}% - \addto@pscode{ - \pst@coor /t@y ED /t@x ED - /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle - /n@ \pst@fractal@n def - /setFillColor { - \ifx\psk@fillstyle\relax\else - gsave \pst@usecolor\psfillcolor fill grestore - \fi } def - /setLineColor{ \ifx\pslinestyle\@none\else stroke \fi } def - tx@fractalDict begin FibonacciPolyominoes end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -% type de fonte et taille -\define@boolkey[psset]{pst-fractal}[Pst@]{DFW}[true]{} % -\define@boolkey[psset]{pst-fractal}[Pst@]{iFibonacci}[true]{} % -\psset[pst-fractal]{DFW=false,iFibonacci=false} % -% -\def\psFibonacciWord{\pst@object{psFibonacciWord}} -\def\psFibonacciWord@i{\@ifnextchar({\psFibonacciWord@ii}{\psFibonacciWord@ii(0,0)}} -\def\psFibonacciWord@ii(#1,#2){% - \addbefore@par{%PSfont=Times-Roman, - fontscale=8} - \begin@SpecialObj - \addto@pscode{ - /n@ \pst@fractal@n def - /i@ \pst@fractal@i def - n@ 3 le {/n@ 3 def} if - /cmunit {\pst@number\psunit mul} bind def % mise à l'échelle - /PSfont {\psk@PSfont} def - PSfont findfont \psk@fontscale scalefont setfont - /F1 (1) def - /F2 (0) def - n@ 2 sub{ - /Fi F2 F1 concatstrings def - /F1 F2 def - /F2 Fi def - } repeat - \ifPst@DFW - /Fi () def - 0 2 F2 length 2 sub {/i exch def - /I F2 i 2 getinterval def - I (00) eq {Fi (0) concatstrings /Fi exch def} if - I (01) eq {Fi (1) concatstrings /Fi exch def} if - I (10) eq {Fi (2) concatstrings /Fi exch def} if - } for - \fi - \ifPst@iFibonacci - /F0 (0) def - /Fi () def - i@ 1 sub { - Fi (0) concatstrings /Fi exch def - } repeat - Fi (1) concatstrings - /F1 exch def - n@ { - F1 F0 concatstrings - /Fi exch def - /F0 F1 def - /F1 Fi def - } repeat - \fi - #1 cmunit #2 cmunit moveto Fi show - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} - -% -\def\psfractal{\pst@object{psfractal}} -\def\psfractal@i{\@ifnextchar({\psfractal@ii}{\psfractal@ii(-1,-1)}}% -\def\psfractal@ii(#1){\@ifnextchar({\psfractal@iii(#1)}{\psfractal@iii(#1)(1,1)}}% -\def\psfractal@iii(#1)(#2){% - \begin@SpecialObj - \psset{unit=1pt}% - \pst@getcoor{#1}\pst@temp@A - \pst@getcoor{#2}\pst@temp@B - \pspicture(\pst@fractal@xWidth,\pst@fractal@yWidth)% - \addto@pscode{ - \pst@temp@A - \pst@temp@B - \pst@number\pst@fractal@xWidth - \pst@number\pst@fractal@yWidth - \pst@fractal@cx - \pst@fractal@cy - \pst@fractal@maxIter - \pst@fractal@dIter - \pst@fractal@maxRadius - { \pst@usecolor\pst@fractal@baseColor } - \ifx\pst@fractal@type\pst@fractal@Julia true \else false \fi - \ifPst@CMYK true \else false \fi ^^J - tx@fractalDict begin tx@Fractal end ^^J - }% end add@pscode - \endpspicture - \end@SpecialObj - \ignorespaces} -% -\def\psSier{\pst@object{psSier}} -\def\psSier@i{\@ifnextchar({\psSier@v}{\psSier@vi}} -% -\def\psSier@v(#1){\@ifnextchar({\psSier@ii(#1)}{\psSier@iii(#1)}} -\def\psSier@ii(#1)(#2)(#3){{% - \pst@getcoor{#1}\pst@temp@A - \pst@getcoor{#2}\pst@temp@B - \pst@getcoor{#3}\pst@temp@C - \begin@SpecialObj% - \addto@pscode{ - [ \pst@temp@A \pst@temp@B \pst@temp@C ] ^^J% - { \pst@usecolor\pslinecolor } ^^J% - \pst@fractal@plotpoints ^^J% - tx@fractalDict begin tx@Sierpinski end ^^J% - }% end add@pscode - \end@SpecialObj% -}} -\def\psSier@iii(#1)#2#3{% - \pst@getcoor{#1}\pst@tempA - \pst@getlength{#2}\pst@tempB - \begin@OpenObj% - \addto@pscode{ - /sierpy { - dup 1 ge - { 1 sub gsave 0.5 dup scale dup sierpy - 1 0 translate dup sierpy - -0.5 0.8660254 translate dup sierpy grestore - }{newpath - 0 0 moveto - 1 0 lineto 0.5 0.8660254 lineto closepath - gsave \pst@usecolor\pslinecolor - fill grestore } ifelse pop - } def - \pst@tempA\space translate - \pst@tempB\space dup scale - 0 setlinewidth - 0 0 moveto 1 0 lineto 0.5 0.8660254 lineto 0 setlinewidth closepath - gsave #3 0 gt { \pst@usecolor\psfillcolor }{ \pst@usecolor\pslinecolor } ifelse - fill grestore stroke - #3 dup 0 gt { sierpy } if }% - \end@OpenObj% -} -% -\def\psSier@vi{% Sierpinski curve - \addbefore@par{n=3,N=all,dotcolor=red}% - \begin@SpecialObj - \addto@pscode{ - /useFill \ifx\psk@fillstylename\@none false \else true \fi def - /fillColor { \pst@usecolor\psfillcolor } def -% \else -% /useFillColor {  -% \ifx\psk@fillstylename\@none -% \else -% gsave \pst@usecolor\psfillcolor fill grestore -% \fi -% } def - /useLineStyle { \ifx\pslinestyle\@none\else \psls@solid stroke \fi } def - /n@ \pst@fractal@n def - /NbrePts (\pst@fractal@N) def - /dotcolor { \pst@usecolor\psdotcolor } def - /cmunit { \pst@number\psunit mul } def - NbrePts (all) eq {/Npts 4 n@ 1 add exp cvi def}{/Npts NbrePts cvi def Npts 4 n@ 1 add exp gt {/Npts 4 n@ 1 add exp cvi def} if } ifelse - tx@fractalDict begin tx@SierpinskiCurve - \ifshowpoints - 0 2 Sierpinsky length 2 sub { - /i exch def - i 2 div Npts ge {exit} if - Sierpinsky i get - Sierpinsky i 1 add get - \psk@dotsize DS - 0 360 arc dotcolor fill - } for - \fi - end - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -\def\psPhyllotaxis{\pst@object{psPhyllotaxis}} -\def\psPhyllotaxis@i{\@ifnextchar({\psPhyllotaxis@ii}{\psPhyllotaxis@ii(0,0)}} -\def\psPhyllotaxis@ii(#1){{% - \pst@getcoor{#1}\pst@tempA - \begin@SpecialObj% - \addto@pscode{ - \pst@tempA - \pst@fractal@c - \pst@fractal@angle - \pst@fractal@maxIter - \ifPst@CMYK true \else false \fi ^^J% - tx@fractalDict begin tx@Phyllotaxis end ^^J% - }% end add@pscode - \end@SpecialObj% -}} -% -\def\pst@fractal@radius{0.001 } -\def\psFern{\pst@object{psFern}} -\def\psFern@i{\@ifnextchar({\psFern@ii}{\psFern@ii(0,0)}} -\def\psFern@ii(#1){{% - \addbefore@par{scale=10,linewidth=0.001pt,maxIter=20000,radius=0.001pt}% - \pst@getcoor{#1}\pst@tempA% - \begin@SpecialObj% - \addto@pscode{ - \pst@fractal@Xscale - \pst@tempA - \pst@fractal@maxIter - \pst@fractal@radius - \pst@number\pslinewidth - { \pst@usecolor\pslinecolor } - tx@fractalDict begin tx@Fern end - }% end add@pscode - \end@SpecialObj% -}} -% -\def\psHugo{\pst@object{psHugo}} -\def\psHugo@i{\@ifnextchar({\psHugo@ii}{\psHugo@ii(0,0)}} -\def\psHugo@ii(#1){{% - \addbefore@par{scale=0.1,linewidth=0.001pt,maxIter=5}% - \pst@getcoor{#1}\pst@tempA% - \begin@SpecialObj% - \addto@pscode{ - \pst@fractal@Xscale - \pst@tempA - \pst@fractal@maxIter - \pst@number\pslinewidth - { \pst@usecolor\pslinecolor } - tx@fractalDict begin tx@Hugo end - }% end add@pscode - \end@SpecialObj% -}} -% -\def\psKochflake{\pst@object{psKochflake}} -\def\psKochflake@i{\@ifnextchar({\psKochflake@ii}{\psKochflake@ii(0,0)}} -\def\psKochflake@ii(#1){{% - \addbefore@par{radius=0.25cm,maxIter=5}% - \pst@getcoor{#1}\pst@tempA% - \begin@SpecialObj% - \addto@pscode{ - gsave ^^J% - \pst@tempA translate - \pst@usecolor\pslinecolor - \pst@fractal@angle rotate ^^J - \pst@number\pslinewidth 10 div \pst@fractal@Xscale div SLW ^^J - \pst@fractal@maxIter ^^J - tx@fractalDict begin ^^J - \pst@fractal@scale ^^J - tx@Kochflake end ^^J - }% end add@pscode - \psk@fillstyle - \addto@pscode{stroke grestore } - \end@SpecialObj% -}} -% -\def\psAppolonius{\pst@object{psAppolonius}} -\def\psAppolonius@i{\@ifnextchar({\psAppolonius@ii}{\psAppolonius@ii(0,0)}} -\def\psAppolonius@ii(#1){{% - \addbefore@par{Radius=5cm,dIter=1,linewidth=0.1pt}% - \pst@getcoor{#1}\pst@tempA% - \begin@SpecialObj% - \addto@pscode{ - \pst@fractal@dIter - \pst@number\pst@fractal@Radius - \ifPst@fractal@Color true \else false \fi - \ifPst@CMYK true \else false \fi ^^J - tx@fractalDict begin ^^J - gsave ^^J - \pst@tempA translate ^^J - \pst@usecolor\pslinecolor - \pst@fractal@scale - \pst@number\pslinewidth SLW ^^J - tx@Appolonius end ^^J - }% end add@pscode - \psk@fillstyle% - \addto@pscode{stroke grestore}% - \end@SpecialObj% -}} -% -\def\psPTree{\pst@object{psPTree}} -\def\psPTree@i{\@ifnextchar({\psPTree@ii}{\psPTree@ii(0,0)}} -\def\psPTree@ii(#1){{% - \addbefore@par{xWidth=1cm,Color=false,c=0.5}% - \pst@getcoor{#1}\pst@tempA% - \begin@SpecialObj% - \addto@pscode{ - gsave ^^J% - \pst@tempA exch \pst@number\pst@fractal@xWidth 2 div sub exch translate ^^J% - \pst@usecolor\pslinecolor - \pst@fractal@scale - \pst@number\pslinewidth \pst@fractal@Xscale div SLW ^^J% - /sqrt2 1.41421356237310 def ^^J% - /minWidth \pst@number\pst@fractal@minWidth def - /r 1 def /g 0 def /b 0 def - /icount 380 def - /setWaveColor { - /icount icount dup 780 gt { pop 380 }{ \pst@fractal@dIter add } ifelse def ^^J% - tx@addDict begin icount ^^J% - \ifPst@CMYK wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor ^^J% - \else wavelengthToRGB Red Green Blue end setrgbcolor \fi ^^J% - } def ^^J% - /Alpha1 { .5 1 \pst@fractal@c sub atan } bind def - /Alpha2 { .5 \pst@fractal@c atan } bind def - /box { \@percentchar stacksize ^^J % width on stack - /w ED - newpath % - 0 0 moveto % - w 0 rlineto % w 0 move right - 0 w rlineto % 0 w move up - w neg \pst@fractal@c mul w 0.5 mul % -c*w 0.5*w - rlineto % move left up - w \pst@fractal@c 1 sub mul % -(1-c)*w - w -0.5 mul rlineto % -(1-c)*w -0.5w move left down - closepath % close - \ifPst@fractal@Color - setWaveColor fill ^^J% -% r g b setrgbcolor fill r g b /g exch def /r exch def /b exch def - \else stroke \fi % - w minWidth gt { % w w limit gt - gsave % - 0 w translate - Alpha1 rotate - w dup 0.5 mul 1 \pst@fractal@c sub w mul Pyth box % one w to leave on stack - grestore - gsave - dup dup dup % w w w w - 1 \pst@fractal@c sub mul % w w w w*(1-c) - exch 1.5 mul % w w w*(1-c) w*1.5 - translate % w w - 360 Alpha2 sub rotate - 0.5 mul exch \pst@fractal@c mul Pyth box - grestore - } if - } def - \pst@number\pst@fractal@xWidth box ^^J% - }% end add@pscode - \end@SpecialObj% -}} -% -\def\psFArrow{\pst@object{psFArrow}} -\def\psFArrow@i{\@ifnextchar({\psFArrow@ii}{\psFArrow@ii(0,0)}} -\def\psFArrow@ii(#1)#2{{% - \addbefore@par{linewidth=10pt,yWidth=5cm,maxIter=10,Color=false,scale=1,dIter=1}% - \pst@getcoor{#1}\pst@tempA% - \begin@SpecialObj% - \addto@pscode{ - gsave ^^J% - \pst@tempA translate 0 0 moveto ^^J% - \pst@usecolor\pslinecolor ^^J% - \pst@fractal@scale ^^J% - /depth 0 def ^^J% - /depth++ { /depth depth 1 add def } def ^^J% - /depth-- { /depth depth 1 sub def } def ^^J% - /icount 380 def ^^J% - /setWaveColor { ^^J% - /icount icount dup 780 gt { pop 380 }{ \pst@fractal@dIter add } ifelse def ^^J% - tx@addDict begin icount ^^J% - \ifPst@CMYK wavelengthToCMYK Cyan Magenta Yellow Black end setcmykcolor ^^J% - \else wavelengthToRGB Red Green Blue end setrgbcolor \fi ^^J% - } def ^^J% - /DoLine { \@percentchar print a vert. line ^^J% - 0 \pst@number\pst@fractal@yWidth rlineto currentpoint ^^J% - \ifPst@fractal@Color setWaveColor \fi ^^J% - stroke ^^J% - translate 0 0 moveto ^^J% - } def ^^J% - /FractArrow { ^^J% - /sc exch def ^^J% - gsave ^^J% - sc dup scale ^^J% - \pst@number\pslinewidth SLW ^^J% - depth++ DoLine ^^J% - depth \pst@fractal@maxIter le { ^^J% - 135 rotate sc FractArrow ^^J% - -270 rotate sc FractArrow ^^J% - } if ^^J% - depth-- ^^J% - grestore ^^J% - } def ^^J% - \pst@fractal@angle rotate ^^J% - #2 FractArrow ^^J% -% 180 rotate #2 FractArrow -% stroke - }% end add@pscode - \end@SpecialObj% -}} -% -\define@key[psset]{pst-fractal}{NbrIter}{\def\pst@fractal@NbrIter{#1 }} % nombre d'itérations -\define@key[psset]{pst-fractal}{tabPts}{\def\pst@fractal@tabPts{#1 }} % tableau de points -\define@key[psset]{pst-fractal}{angleH}{\def\pst@fractal@angleH{#1 }} % angle en radians -\define@key[psset]{pst-fractal}{zoom}{\def\pst@fractal@zoom{#1 }} % grossissement -\psset[pst-fractal]{NbrIter=500,angleH=1.32837,zoom=5,tabPts=0.05 0.05 -0.1 0.1 -0.2 0.2 -0.3 0.2 -0.3 0.3 -0.4 0.3 -0.4 0.324 -0.4 0.326 -0.4 0.5 -0.5 0.3 -0.5 0.5 -0.6 0.5 -0.6 0.6 -0.57 0.575 -0.7 0.7 -0.7 0.9} -\define@boolkey[psset]{pst-fractal}[Pst@]{pixelscolor}[true]{} -\psset[pst-fractal]{pixelscolor=true} % pixels en couleurs - -\def\psHenon{\pst@object{psHenon}} -\def\psHenon@i{% - \addbefore@par{dotsize=0.75pt}% - \begin@SpecialObj - \addto@pscode{ -% échelle 2=> 10 cm pour zoom=5 - /zoom \pst@fractal@zoom def - /cm {\pst@number\psunit mul zoom mul} bind def - /NbreIter \pst@fractal@NbrIter def - /Angle \pst@fractal@angleH RadtoDeg def - /CosA Angle cos def - /SinA Angle sin def - /TabPts [\pst@fractal@tabPts] def - \ifPst@pixelscolor /pixelscolor true def \else /pixelscolor false def \fi - /AttracteurHenon { - 5 dict begin - /Y exch def /X exch def /Aux X def - NbreIter { - /Aux X def - /X X CosA mul Y X X mul sub SinA mul sub def - /Y Aux SinA mul Y Aux Aux mul sub CosA mul add def - X abs 1e12 ge Y abs 1e10 ge or { exit }{ - newpath - X cm \psk@@dotsize sub Y cm \psk@@dotsize sub moveto - \psk@@dotsize 0 rlineto % bottom of square - 0 \psk@@dotsize rlineto % right side of square - -\psk@@dotsize 0 rlineto % top of square - closepath - fill - }ifelse - } repeat - end - } def - /Hsb 0 def - 0 2 TabPts length 2 sub { - /i exch def - % 0 setgray - %TabPts i get TabPts i 1 add get 2 copy - %exch 200 mul exch 200 mul 2 0 360 arc fill - pixelscolor {Hsb 1 1 sethsbcolor}{0 setgray}ifelse - TabPts i get TabPts i 1 add get - AttracteurHenon - /Hsb i TabPts length div def - } for - }% - \showpointsfalse - \end@SpecialObj - \ignorespaces} -% -\catcode`\@=\PstAtCode\relax -% -%% END: pst-fractal.tex -\endinput - -- cgit v1.2.3