Julia-Menge II

TUTORIAL

Julia-Menge II

.

canvasmodus()

#{ Ausschnitt
#{ [ x0, x1, y0, y1 ] = [ -2, 2, -2, 2 ]
[ x0, x1, y0, y1 ] = [ -0.5, 0.7, 0, 1.2 ]
[ cr, ci ] = [ 0.35, 0.422 ]


transform = (i,j) ->
  [ (i/600)*(x1-x0)+(x1+x0)/2, (j/600)*(y1-y0)+(y1+y0)/2 ]

iter = 60

check = (i,j) ->
  [ zr, zi ] = transform i, j
  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 weiß
    sonst
      plotfarbe [ '#444400', '#666600', '#888800', '#AAAA00', '#CCCC00', '#EEEE00' ][c % 6]
    plot i,j