I can create a 400x400 Mandelbrot set image from minReal to maxReal and from minImaginary to maxImaginary. In this way,
makeMandel(minReal, maxReal, minImaginary, maxImaginary);
I need to change it so that I can
makeMandel(centerX, centerY, Zoomlevel); // generates a region of the mandelbrot set centered at centerX,centerY at a zoom level of Zoomlevel
(Given that the zoom level is the distance between the pixels and is given by the formula Zoom level n = 2 ^ (-n), so zoom level 1 means that the pixels are at a distance of 0.5 units, zoom level 2, 0.25 and so Further...)
My question is: how to calculate the arguments of the first makeMandel function from the arguments of the second? I know that the first function is able to scale and move, but I do not know how to calculate the correct numbers for any given center and zoom level.
I am trying to get this work to work for more than three days, and I'm really confused. I tried to draw tables, etc. On paper and work out. I read most of the documents you found on Google when looking for the mandelbrot suite and a couple of past stack questions, but I still don't get it. Please help me.
source share