Results 1 to 2 of 2
Thread: Zooming in on fractal
- 04-18-2009, 05:36 AM #1
Zooming in on fractal
I'm trying to create an animated fractal generating program. However I've run into a bit of a roadblock when it comes to animating the fractals. I'm trying to create a colored animation of the Mandelbrot set.
The following picture is simply panning to the left and zooming in.
I don't see how I can zoom in when the coordinate plane can only consist of integers.
Even if I had a coordinate plane made of rational numbers, I could't zoom but so much. How can I get around to being able to infinitely zoom. Any ideas?
Thank you for your time and effort,
Last edited by Mr.Beans; 04-18-2009 at 05:38 AM.
- 04-18-2009, 06:00 AM #2
Firstly, you must remember to distinguish between the fractal coordinate plane and the image coordinate plane. Each pixel (denoted by integers) maps to a point in the fractal, which will be some real-valued coordinate. When you zoom, you change this mapping. The image coordinates always stay the same.
For example, in a 64x64 pixel image you can map 0 to -2 and 63 to 2 with 1 pixel = 0.625 to show the whole fractal, or zoom in by mapping 0 to -0.2 and 63 to -0.1 with 1 pixel = 0.0015625.
You can never zoom infinitely - even if you used BigDecimal you would eventually run out of memory. The animation above uses the fact that the fractal repeats itself and just loops roughly 12 frames.Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
How To Ask Questions The Smart Way
- By Raghavansat in forum AWT / SwingReplies: 0Last Post: 02-04-2009, 09:35 AM