Mandelbrot set: Difference between revisions

→‎{{header|TeX}}: Separated solutions by language and minimalised.
(→‎{{header|TeX}}: Separated solutions by language and minimalised.)
Line 8,561:
The <code>pst-fractal</code> package includes a Mandelbrot set drawn by emitting [[PostScript]] code (using [[PSTricks]]), so the actual work done in the printer or PostScript interpreter.
 
<lang TeX>%\input Plain TeXpst-fractal
\psfractal[type=Mandel,xWidth=14cm,yWidth=12cm,maxIter=30,dIter=20] (-2.5,-1.5)(1,1.5)
\input pst-fractal
\psfractal[type=Mandel,xWidth=14cm,yWidth=12cm,maxIter=30,dIter=20]
(-2.5,-1.5)(1,1.5)
\end</lang>
 
The coordinates are a rectangle in the complex plane to draw, scaled up to <code>xWidth,yWidth</code>. More iterations with <code>maxIter</code> is higher resolution but slower. <code>dIter</code> is a scale factor for the colours.
 
More iterations with <code>maxIter</code> is higher resolution but slower.
 
<code>dIter</code> is a scale factor for the colours.
 
=={{header|LaTeX}}==
The <code>pstricks-examples</code> package which is samples from the PSTricks book includes similar for [[LaTeX]] (<code>25-02-6.ltx</code> and <code>33-02-6.ltx</code>).
 
{{libheader|PGF}}
The PGF <code>shadings</code> library includes a Mandelbrot set. In PGF 3.0 the calculations are done in [[PostScript]] code emitted, so the output size is small but it only does 10 iterations so is very low resolution.
 
In PGF 3.0 the calculations are done in [[PostScript]] code emitted, so the output size is small but it only does 10 iterations so is very low resolution.
<lang TeX>\documentclass{article}
 
<lang TeXLaTeX>\documentclass{articleminimal}
\usepackage{tikz}
\usetikzlibrary{shadings}
\begin{document}
\begin{tikzpicture}
\shade[shading=Mandelbrot set] (0,0) rectangle (4,4);
\end{tikzpicture}
\end{document}</lang>
 
=={{header|LuaTeX}}==
{{libheader|LuaTeX}}
[[LuaLaTeX]] plus pgfplots code can be found at [http://texwelt.de/wissen/fragen/3960/fraktale-mit-pgfplots http://texwelt.de/wissen/fragen/3960/fraktale-mit-pgfplots]. The calculations are done by inline [[Lua]] code and the resulting bitmap shown with a PGF plot.
 
The calculations are done by inline [[Lua]] code and the resulting bitmap shown with a PGF plot.
 
=={{header|TI-83 BASIC}}==