June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,44 @@
prologues:=3;
outputtemplate:="%j-%c.svg";
outputformat:="svg";
def mandelbrot(expr maxX, maxY) =
max_iteration := 500;
color col[];
for i := 0 upto max_iteration:
t := i / max_iteration;
col[i] = (t,t,t);
endfor;
for px := 0 upto maxX:
for py := 0 upto maxY:
xz := px * 3.5 / maxX - 2.5; % (-2.5,1)
yz := py * 2 / maxY - 1; % (-1,1)
x := 0;
y := 0;
iteration := 0;
forever: exitunless ((x*x + y*y < 4) and (iteration < max_iteration));
xtemp := x*x - y*y + xz;
y := 2*x*y + yz;
x := xtemp;
iteration := iteration + 1;
endfor;
draw (px,py) withpen pencircle withcolor col[iteration];
endfor;
endfor;
enddef;
beginfig(1);
mandelbrot(200, 150);
endfig;
end

View file

@ -0,0 +1 @@
mpost -numbersystem="double" mandelbrot.mp