Mandelbrot set Generator
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
turtles-own [x0 iteration y0 xtemp x y Zoom-factor mousex mousey] To Startup ca create-turtles 1 ask turtles [ht] ask turtles [setxy -500 500] ask turtles [facexy -499 500] ask turtles [set Zoom-factor 1 set mousex 0 set mousey 0] end To Main Startup Draw loop [Zoom] end to Draw ask turtles [while [ycor >= -499] [fd 1 Calculate if not can-move? 1 [setxy -500 ycor - 1]]] end to Calculate set x0 (xcor / 250) set y0 (ycor / 250) set x (0) set xtemp (0) set y (0) set iteration (0) while [((x * x) + (y * y)) < 2 * 2 and iteration < maxiteration] [set xtemp ((x * x) - (y * y) + x0) set y ((2 * x * y) + y0) set x (xtemp) set iteration (iteration + 1)] set pcolor (iteration / (maxiteration / 10)) + (color-scheme * 10) end to Zoom while [not mouse-down?] [] cp ask turtles [set mousex (mouse-xcor + (mousex * zoom-factor)) / zoom-factor set mousey (mouse-ycor + (mousey * zoom-factor)) / zoom-factor set zoom-factor (zoom-factor * 4) Draw-Zoom show zoom-factor] end to Calculate-Zoom set x0 ((xcor + (zoom-factor * mousex)) / (250 * zoom-factor)) set y0 ((ycor + (zoom-factor * mousey)) / (250 * zoom-factor)) set x (0) set xtemp (0) set y (0) set iteration 0 while [((x * x) + (y * y)) < 2 * 2 and iteration < maxiteration] [set xtemp ((x * x) - (y * y) + x0) set y ((2 * x * y) + y0) set x (xtemp) set iteration (iteration + 1)] set pcolor (iteration / (maxiteration / 10)) + (color-scheme * 10) end to Draw-Zoom setxy -500 500 while [ycor >= -499] [fd 1 Calculate-Zoom if not can-move? 1 [setxy xcor - 1000 ycor - 1]] end
There is only one version of this model, created over 10 years ago by Apollo Albright.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Mandelbrot set Generator.png | preview | Preview for 'Mandelbrot set Generator' | over 10 years ago, by Apollo Albright | Download |
This model does not have any ancestors.
This model does not have any descendants.