Computer Science Canada Mandelbrot Fractal |
Author: | ericfourfour [ Sun Dec 03, 2006 12:39 am ] | ||
Post subject: | Mandelbrot Fractal | ||
Here is a mandelbrot fractal. The algorithm is straight from the mandelbrot fractal page on wikipedia (look at my updateMandelbrot () procedure in the Mandelbrot class). You can set the magnification and the offsets (offsets have not been perfected but it gets the job done). I made it update one pixel at a time so you can add stuff in between (you could even have 2 mandelbrots going at once!). Since this is Turing it will go very slow when the magnification is high. By the way, a magnification of 1 is very boring. Start at 10 and work your way up.
|
Author: | ericfourfour [ Sun Dec 03, 2006 10:10 pm ] | ||||||
Post subject: | |||||||
I updated it and now you can use the mouse with it while it is running. Controls: Left Mouse - Centre fractal around mouse coordinates. Middle Mouse - Clear the screen and refresh the fractal. Right Mouse - Stop drawing the fractal and go back to the settings. You can do all of the above commands while it is generating the fractal because I thought it would get boring if you have to wait until it is done before you can move it around to view other parts. It also now shows the current line (on the y axis) that it is generating so you can have an idea of how long it is going to take. If you are wondering a bit about the Mandelbrot class here is a few of its procedures it uses (new version):
I made it an attachment because the code is around 200 lines now. |