Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I read this question and I don't understand the answer: http://stackoverflow.com/questions/8381675/how-to-perform-simple-zoom-into-mandelbrot-set?rq=1. Especially how can I aim for the center of the pixel like so:

  for(unsigned SX = SMin; x < SMax; ++x) {
     double k = (double(SX + 0.5) - SMin) / (SMax - SMin);
     double IX = (k * (IMax - IMin)) + IMin;
  }

Is k then the real factor and ix the imaginary factor?

I've made an example here: http://www.phpdevpad.de/index.php?id=190 but how can I find the corner pixel when I want to zoom into it like so:

 double Re_factor = (MaxRe-MinRe)/(ImageWidth-1);
 double Im_factor = (MaxIm-MinIm)/(ImageHeight-1);
 double newMinRe = MinRe + (Re_factor* x1);
 double newMaxRe = MinRe + (Re_factor* x2);
 double newMinIm = MinIm + (Im_factor* y1);
 double newMaxIm = MinIm + (Im_factor* y2);

In my example the zoomed image is a bit tall in the y-axis. Why is this?

Update: IX is the x-value in the imaginary space hence my first question is answered.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I would use Im_factor = Re_factor (assuming square pixels on your screen). In other words, $(MaxRe-MinRe):(MaxIm-MinIm)$ should equal $(ImageWidth-1):(ImageHeight-1)$.

share|improve this answer
    
Do you mean 16:10? How would I do this? Because the default mandelbrot image seems to work and I use exactly the same real and imaginary steps with the formula in the linked post? –  Phpdna Nov 29 '12 at 19:35
    
Thank you. That seems to work. But how can zoom out the area? –  Phpdna Nov 29 '12 at 21:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.