Author Topic: [Java Release] Mandelbrot set viewer  (Read 3413 times)

0 Members and 1 Guest are viewing this topic.

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
[Java Release] Mandelbrot set viewer
« on: 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:



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:




I did the same and colored the output, so I got this:



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.



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.







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


If you find some gems with the tool, share them here. :)
« Last Edit: May 30, 2014, 08:37:32 am by Deque »

Offline proxx

  • Avatarception
  • Global Moderator
  • Titan
  • *
  • Posts: 2803
  • Cookies: 256
  • ФФФ
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #1 on: July 12, 2013, 01:32:42 pm »
WOW.
I dont understand any of it but this is just awesome.
(she is married isnt she?)
+1
« Last Edit: July 12, 2013, 01:32:54 pm by proxx »
Wtf where you thinking with that signature? - Phage.
This was another little experiment *evillaughter - Proxx.
Evilception... - Phage

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #2 on: July 13, 2013, 07:51:10 pm »
Experimented a bit with the colors. Here are some more pictures:










Download link is updated to a newer version.

I am going to create a UI where you can change some color settings.
« Last Edit: July 13, 2013, 07:53:15 pm by Deque »

Offline vezzy

  • Royal Highness
  • ****
  • Posts: 771
  • Cookies: 172
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #3 on: July 13, 2013, 08:01:17 pm »
Indeed, the quintessential example of a fractal. Nice job.
Quote from: Dippy hippy
Just brushing though. I will be semi active mainly came to find a HQ botnet, like THOR or just any p2p botnet

Offline geXXos

  • Royal Highness
  • ****
  • Posts: 646
  • Cookies: 178
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #4 on: July 13, 2013, 09:06:31 pm »
@ Proxx
Neither do i, but is amazing, +1 Deque


Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: [Java Release] Mandelbrot set viewer
« Reply #5 on: July 13, 2013, 10:26:27 pm »
Damn these are some trippy images :) +1 to deque!

Offline frog

  • Knight
  • **
  • Posts: 232
  • Cookies: 16
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #6 on: July 14, 2013, 08:59:51 am »
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.

Offline Psycho_Coder

  • Knight
  • **
  • Posts: 166
  • Cookies: 84
  • Programmer, Forensic Analyst
    • View Profile
    • Code Hackers Blog
Re: [Java Release] Mandelbrot set viewer
« Reply #7 on: July 14, 2013, 07:56:31 pm »
Great article mam. By the way I found you here finally ;)
"Don't do anything by half. If you love someone, love them with all your soul. When you hate someone, hate them until it hurts."--- Henry Rollins

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #8 on: July 15, 2013, 07:49:00 pm »
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(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.

Offline Psycho_Coder

  • Knight
  • **
  • Posts: 166
  • Cookies: 84
  • Programmer, Forensic Analyst
    • View Profile
    • Code Hackers Blog
Re: [Java Release] Mandelbrot set viewer
« Reply #9 on: July 15, 2013, 08:07:18 pm »
Stalker. :D
I hope people don't mistake you for being me, because you have my previous avatar.


;) Having a little fun :)
"Don't do anything by half. If you love someone, love them with all your soul. When you hate someone, hate them until it hurts."--- Henry Rollins

Offline frog

  • Knight
  • **
  • Posts: 232
  • Cookies: 16
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #10 on: July 16, 2013, 04:11:58 am »
Hey where's all my cookies?

Offline Deque

  • P.I.N.N.
  • Global Moderator
  • Overlord
  • *
  • Posts: 1203
  • Cookies: 518
  • Programmer, Malware Analyst
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #11 on: July 16, 2013, 04:26:34 pm »

Offline frog

  • Knight
  • **
  • Posts: 232
  • Cookies: 16
    • View Profile
Re: [Java Release] Mandelbrot set viewer
« Reply #12 on: July 17, 2013, 03:19:09 am »
Shit.