Drawing a Mandelbrot thingy - problems

I wanted to do that just once, so did.

http://pastebin.com/1KbaZvfR

Problem is, my algorithm is rather crude, so the calculations take quite a bit of time - while I can live with that, my actual problem is that the right side shows very little details (after 100 iterations at least). Is that normal, or do my calculations have an error somewhere?

Image here, in case you don't have Allegro 5:

http://s305.photobucket.com/albums/nn224/Itachihro/?action=view&current=mandelbrot.png

(Oh, and the code isn't exactly a beauty to look at - I was just bored and like, "hey, let's do that fractal thing that looks funny!" *starts one person monkey typewriter experiment until result is there*).
Last edited on
The best Mandelbrot implementation for windows I have seen on this forum was by Hammurabi:

http://www.cplusplus.com/forum/windows/11607/#msg55148

(it's a total of 91 lines of code with all the details, and with different shades based on the divergence speed).
Last edited on
You're initializing the elements of discriminants to 1, but it should be 0.
In this line: if(length > 2) length is actually length_squared, so you need to compare with 4.

Problem is, my algorithm is rather crude, so the calculations take quite a bit of time

You could speed it up by an order of magnitude simply by fixing this line:
if(escapeChecker[i]) continue;
Changing the loop order would improve things further.
Damn, how did I miss that? Thanks. (what did you mean by fixing that line? What's wrong with it?)
The index should be i*h+j.
Ohhh of course
Topic archived. No new replies allowed.