dave
March 23rd, 2003, 3:53 AM
it looks like this particular forum hasn't had many posts in general, which i think is a shame considering that the topic of it (fractals and chaos theory) is such an interesting and diverse topic.
so, i decided to write my own mandelbrot set generator, even though there are hundreds around i suppose, and i've included the source code which is available here (http://davep120.tripod.com/mandelbrot.tar.bz2). you'll need a linux machine to compile and run the program, but a Makefile is included. You'll also the need the png and gd libraries and header files for gd.
program usage: ./mandelbrot x1 x2 y1 y2 width iterations/pixel
it's a fairly simple program to use. the mandelbrot set is defined in the complex plane, so the first four values you can input are the x and y co-ordinates on the plane for which you want to generate the image. the point (x1, y1) is measured from the top left hand corner. so the co-ordinates -2, 1, 1, -1 would generate the familiar picture of the mandelbrot set.
the other two parameters speak for themselves; the width of the image you want (the height will be automatically calculated) and the iterations/pixel. it takes ~30 seconds to generate a 600x400 png with 1000 iterations/pixel on my Pentium II 400MHz. output file is mandelbrot.png.
bugs/other stuff
the colour is a bit crappy atm, i haven't worked out a decent way of doing a palette.
if the mandelbrot.png file exists already, then it can cause problems when trying to generate another image, and it might segfault. just delete the old image file.
happy mandelbrot set generating.
so, i decided to write my own mandelbrot set generator, even though there are hundreds around i suppose, and i've included the source code which is available here (http://davep120.tripod.com/mandelbrot.tar.bz2). you'll need a linux machine to compile and run the program, but a Makefile is included. You'll also the need the png and gd libraries and header files for gd.
program usage: ./mandelbrot x1 x2 y1 y2 width iterations/pixel
it's a fairly simple program to use. the mandelbrot set is defined in the complex plane, so the first four values you can input are the x and y co-ordinates on the plane for which you want to generate the image. the point (x1, y1) is measured from the top left hand corner. so the co-ordinates -2, 1, 1, -1 would generate the familiar picture of the mandelbrot set.
the other two parameters speak for themselves; the width of the image you want (the height will be automatically calculated) and the iterations/pixel. it takes ~30 seconds to generate a 600x400 png with 1000 iterations/pixel on my Pentium II 400MHz. output file is mandelbrot.png.
bugs/other stuff
the colour is a bit crappy atm, i haven't worked out a decent way of doing a palette.
if the mandelbrot.png file exists already, then it can cause problems when trying to generate another image, and it might segfault. just delete the old image file.
happy mandelbrot set generating.