1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Init gfx, 0.01 ' Nombre entier de millisecondes entre chaque tracé
' Insérez ici votre code
' on définit la zone que l'on dessine. Ici, la fractale en entière
x1 = -2.1
x2 = 0.6
y1 = -1.2
y2 = 1.2
zoom = 150 ' pour une distance de 1 sur le plan, on a 100 pixel sur l'image
iteration_max = 100
' on calcule la taille de l'image :
px = (x2 - x1) * zoom
py = (y2 - y1) * zoom
For x0 = -2 to 2 step 0.006
For y0 = -2 to 2 step 0.006
x = 0
y = 0
iteration = 0
while (x*x+y*y) < 4 and iteration < iteration_max
tmp = x*x -y*y + x0
y = 2*x*y +y0
x= tmp
iteration = iteration +1
wend
if iteration <> iteration_max then
c = iteration
else
c = 0
end if
plot x*50, y*50, 60
Next
Next |
Partager