EvilZone
Programming and Scripting => Java => : Deque July 12, 2013, 12:47:48 PM
-
Mandelbrot set viewer
The mandelbrot set was invented by Benoit Mandelbrot in 1970, who wanted to classify the Julia sets with it.
It is the set of all complex numbers c for which the following sequence remains bounded:
(https://upload.wikimedia.org/math/1/6/8/1686ce42df2b6ee51a3ae880613ca4d9.png)
Starting with z0 = 0.
In practice you will calculate the numbers for the sequence for up to 100 or 300 iterations and if it remained bounded the pixel is colored black, otherwise white.
This will look like this. The y-axis is the imaginary part, the x-axis is the real part:
(https://upload.wikimedia.org/wikipedia/commons/5/56/Mandelset_hires.png)
I did the same and colored the output, so I got this:
(http://s1.directupload.net/images/130711/oym8599b.png) (http://www.directupload.net)
In addition the viewer allows you to zoom in. Theoretically this works indefenitely, but in practice there is a limit.
Just drag a rectangle with your mouse from up left to down right. You might find some gems this way.
(http://s1.directupload.net/images/130711/kri94de5.png) (http://www.directupload.net)
I improved the coloring and got more smooth colors. See example pictures below for the current look.
I am still working on a good colormap, though.
(http://s7.directupload.net/images/130712/wcnanupi.png) (http://www.directupload.net)
(http://s14.directupload.net/images/130712/mh7ipvjo.png) (http://www.directupload.net)
(http://s7.directupload.net/images/130712/ggle4yj8.png) (http://www.directupload.net)
Usage:
Press s to save the current pictures as png in the current folder.
Drag with the mouse to zoom in.
Press r to zoom out.
To change init hue and hue factor press the update button.
Lines of code (by now): 250
Source on github: snip
Download program: http://uppit.com/h2dxfdtnruen/mandelbrot.jar
(http://uppit.com/h2dxfdtnruen/mandelbrot.jar)
If you find some gems with the tool, share them here. :)
-
WOW.
I dont understand any of it but this is just awesome.
(she is married isnt she?)
+1
-
Experimented a bit with the colors. Here are some more pictures:
(http://s7.directupload.net/images/130713/v24myofl.png) (http://www.directupload.net)
(http://s7.directupload.net/images/130713/7kxcmqeu.png) (http://www.directupload.net)
(http://s14.directupload.net/images/130713/mce9bml6.png) (http://www.directupload.net)
(http://s7.directupload.net/images/130713/ehvrd5x5.png) (http://www.directupload.net)
Download link is updated to a newer version.
I am going to create a UI where you can change some color settings.
-
Indeed, the quintessential example of a fractal. Nice job.
-
@ Proxx
Neither do i, but is amazing, +1 Deque
-
Damn these are some trippy images :) +1 to deque!
-
I like your code deque, it's clean; easy to read. I looked at a similar program written in C on http://thoughtcrime.org(awesome site btw) and it's at least twice the code. Nice work playa.
-
Great article mam. By the way I found you here finally ;)
-
Thanks for your feedback.
I am working on a GUI, but it isn't as much fun as doing the logic.
I like your code deque, it's clean; easy to read. I looked at a similar program written in C on http://thoughtcrime.org (http://thoughtcrime.org)(awesome site btw) and it's at least twice the code. Nice work playa.
Thanks, but I think it is hard to compare. C needs more lines of code than Java because it is on a lower level.
I counted them with cloc, there are 590 LOC for the C project.
Great article mam. By the way I found you here finally ;)
Stalker. :D
I hope people don't mistake you for being me, because you have my previous avatar.
-
Stalker. :D
I hope people don't mistake you for being me, because you have my previous avatar.
;) Having a little fun :)
-
Hey where's all my cookies?
-
Hey where's all my cookies?
(https://sanseverything.files.wordpress.com/2007/11/cookie-monster3.jpg)
-
Shit.