Mandelbrot
So I got sent Jonathan Coulton’s Mandelbrot Set song. This got me thinking about fractals (again), and I ended up first on Wikipedia, then buried in some books. I decided to make a Mandelbrot fractal generator, just for fun (and possibly to procrastinate the boring scientific programming coursework I had to do). As I don’t know any graphics stuff in Java or C, I decided the easiest option would be to code in PHP. So, boys and girls, here you have it: The PHP Mandelbrot Fractal Generator!
Here is a sample picture:
And another with centre: 0.001643721971153, 0.822467633298876 and zoom: 200,000


Edit0r:
I’ve just realised my fractal is drawn upside down. There’s a * -1 in the conversion from pixels to coordinates which I think should be in there, but apparently should not. My reasoning for it is that the picture starts at pixel (0,0) at the top left, but the coordinates of this point would be (-1,1), given the correct zoom and center. At the top right, the pixel is (300,0) and the actual point is (1,1). However, the other two corners are (0,300) and (300,300) respectively, but their actual points are (-1,-1) and (1,-1) respectively. That’s why I put a * -1 in on the y axis. Can anyone explain this to me? Am I right about this and everybody else just draws it upside down, or vice versa?
1 November 2007, 5:18 am