[pstricks] Mandelbrot with pstricks

Poul Riis Poul.Riis at skolekom.dk
Wed Apr 4 20:49:33 CEST 2007


The example below is for demonstration only - I have no intentions to make
extremely detailed pictures of the Mandelbrot set with PSTricks. However,
just for fun I would like to see how far one can go. Increasing the
parameters of the \mandelbrot command to for instance 60 and 30 gives the
following message:
TeX capacity exceeded, sorry [main memory size=2000001].
How can I increase the amount of available memory and/or decrease the
memory consumption of PSTricks?

Yours,
Poul Riis



\documentclass[a4paper,12pt]{article}
\usepackage{pstricks-add}
\usepackage{geometry}
\usepackage{multido}


\definecolor[ps]{bl}{rgb}{tx at addDict begin Red Green Blue end}%
%%%%%%%%%%%%\mandelbrot{Number of intervals on x-axis}{Number of intervals
on positive part of y-axis (same length as on x-axis)}
\newcommand{\mandelbrot}[2]{%
\centering
\psset{unit=40mm}%
\begin{pspicture}(-2.2,-2.2)(2.2,2.2)%
\SpecialCoor%
\multido{\nn=0+2}{#2}{\multido{\nm=0+1}{#1}{\pstVerb{/nnn \nm\space def
/jjj 0 def /cx nnn 2 mul 1 add #1 div 1 sub 2 mul def /cy \nn\space 1 add
#1 div 2 mul def /dcxh 4 #1 div 2 div def /xold cx def /yold cy def 200
{/xnew xold dup mul yold dup mul sub cx add def /ynew xold yold mul 2 mul
cy add def /modc xnew dup mul ynew dup mul add def /xold xnew def /yold
ynew def /jjj jjj 1 add def modc 4 gt {exit} if} repeat /colorno jjj 2 mul
400 add def colorno tx at addDict begin wavelengthToRGB end}
\psset{linecolor=bl}\psframe*(!cx dcxh sub cy dcxh sub)(!cx dcxh add cy
dcxh add)\psframe*(!cx dcxh sub cy dcxh sub neg)(!cx dcxh add cy dcxh add
neg)}}
\NormalCoor
\end{pspicture}
}


\begin{document}
\mandelbrot{60}{20}
\end{document}



-------------- next part --------------


###########################################
Denne meddelelse med evt. vedlagte filer er scannet af SkoleKoms F-Secure virusscanner.

For yderligere information,
http://forside.skolekom.dk/indhold/punkt1/viruspolitik


More information about the PSTricks mailing list