Mandelbrot set: Difference between revisions
Content added Content deleted
m (→Python with and without NumPy (no optimizations): Line break added) |
(→{{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> |
<lang TeX>\input pst-fractal |
||
⚫ | |||
\input pst-fractal |
|||
⚫ | |||
(-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> |
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 |
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. |
|||
⚫ | |||
⚫ | |||
\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] |
[[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}}== |