TUTORIAL
Mandelbrot-Menge |
|
|
|
. |
canvasmodus()
#{ Ausschnitt
[ x0, x1, y0, y1 ] = [ -2.1, 0.9, -1.5, 1.5 ]
#{ [ x0, x1, y0, y1 ] = [-1.49, -1.46, -0.015, 0.015 ]
transform = (i,j) ->
[ (i/600)*(x1-x0)+(x1+x0)/2, (j/600)*(y1-y0)+(y1+y0)/2 ]
iter = 300
check = (i,j) ->
[ cr, ci ] = transform i, j
zr = zi = 0
ctr = 0
während (ctr < iter) und (zr*zr + zi*zi < 5)
ctr += 1
[ zr, zi ] = [ zr*zr - zi*zi + cr, 2*zr*zi + ci]
ctr
für i in [-300..300]
für j in [-300..300]
c = check i,j
wenn c == iter
plotfarbe schwarz
sonst
plotfarbe [ '#444444', '#666666', '#888888', '#AAAAAA', '#CCCCCC', '#EEEEEE'][c % 6]
plot i,j |