Mandelbrot set: Difference between revisions

Content added Content deleted
(→‎{{header|TeX}}: Separated solutions by language and minimalised.)
Line 8,561: 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.
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>% Plain TeX
<lang TeX>\input pst-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>
\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.
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.

=={{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>).
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}}
{{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.
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.
<lang TeX>\documentclass{article}

<lang LaTeX>\documentclass{minimal}
\usepackage{tikz}
\usepackage{tikz}
\usetikzlibrary{shadings}
\usetikzlibrary{shadings}
\begin{document}
\begin{document}
\begin{tikzpicture}
\begin{tikzpicture}
\shade[shading=Mandelbrot set] (0,0) rectangle (4,4);
\shade[shading=Mandelbrot set] (0,0) rectangle (4,4);
\end{tikzpicture}
\end{tikzpicture}
\end{document}</lang>
\end{document}</lang>


=={{header|LuaTeX}}==
{{libheader|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.
[[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.


=={{header|TI-83 BASIC}}==
=={{header|TI-83 BASIC}}==