Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6892843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:35:07+00:00 2026-05-27T06:35:07+00:00

I have a general question with the Mandelbrot set zoom view and the math

  • 0

I have a general question with the Mandelbrot set “zoom” view and the math pertaining to it. I have implemented the mandelbrot set for the 256 X 256 window size with values

  // ImageWidth = ImageHeight = 256;

  double MinRe = -2.0;
  double MaxRe = 1.0;
  double MinIm = -1.2;
  double MaxIm = 1.8;

  ComputeMandelbrot();

Next, I select a region of square and these are the coordinates for the upper left most tip (76,55), and rightmost bottom tip (116, 99) (square of side 44 is chosen)

so , I choose x2 = x1 + 44 ; y2 = y1 + 44;

How do I translate these new coordinates to the complex plane ? and how would the new real and imaginary values change in order to compute it for the new set of values ?

This is what I have tried so far..

double Re_factor = (MaxRe-MinRe)/(ImageWidth-1);
double Im_factor = (MaxIm-MinIm)/(ImageHeight-1);

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

// and then I compute c - real and c- imag values

  for(unsigned y=0; y<ImageHeight; ++y) 
{ 
  double c_im = newMaxIm - y*Im_factor;
  for(unsigned x=0; x<ImageWidth; ++x)
    {
      double c_re = newMinRe + x*Re_factor;

      // ComputeMandelbrot();

     }

 }

I am having a hard time figuring out the math, and also with regards to generating a ‘zoom’ view and any help is appreciated !!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:35:07+00:00Added an answer on May 27, 2026 at 6:35 am

    It’s a linear scaling. Let’s doing it in 1D. You have the screen space (screen coordinates), and the image space (the complex plane, in your case)

    • screen space => [0, 255]
    • image space => [-2, 1]

    So to convert a coordinate X from screen space to image space X’

    X’ = (X / 255) * (1 – (-2)) + (-2)

    To make it more generic

    • screen space => [SMin, SMax]
    • image space => [IMin, IMax]

    X’ = ((X – SMin) / (SMax – SMin)) * (IMax – IMin) + IMin


    In your code, you do

    double newMinRe = MinRe + (Re_factor* x1);
    

    which is equivalent to what I show. But then you do

    double newMaxRe = MaxRe + (Re_factor* x2);
    

    which is not correct, and should be

    double newMaxRe = MinRe + (Re_factor* x2);
    

    Same problem in your loop, it should be

    for(unsigned y=0; y<ImageHeight; ++y)  { 
      double c_im = MinIm + y*Im_factor;
      for(unsigned x=0; x<ImageWidth; ++x) {
        double c_re = MinRe + x*Re_factor;
        // ComputeMandelbrot();
      }
    }
    

    Additional detail for extra-goodness : to sample properly the image space , I suggest this

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

    The +0.5 term is to sample right in the middle of the pixel…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a general question. I would like to have a window containing some
I just have a general question: has anyone successfully implemented a way to show
I have a general question - regarding testing of values, I have run into
I have a general question that is rather open-ended (i.e. depends on platform, application
I have a general question for the group. I am about to start a
I have a general question about the way that database indexing works, particularly in
i have a general question about how sql server evaluates the joins.The query is
i have a general question about properties and ivars. ive seen many different examples
I have a general question with regards to immutable collections. I will use Java
I'm a bit of a javascript noob, but I have a general question that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.