【发布时间】:2011-12-05 22:06:41
【问题描述】:
我有一个关于 Mandelbrot 设置“缩放”视图和与之相关的数学的一般性问题。我已经用值实现了 256 X 256 窗口大小的 mandelbrot 集
// ImageWidth = ImageHeight = 256;
double MinRe = -2.0;
double MaxRe = 1.0;
double MinIm = -1.2;
double MaxIm = 1.8;
ComputeMandelbrot();
接下来,我选择一个正方形区域,这些是最左上角 (76,55) 和最右下角 (116, 99) 的坐标(选择了 44 边的正方形)
所以,我选择x2 = x1 + 44 ; y2 = y1 + 44;
如何将这些新坐标转换为复平面?以及新的实部和虚部将如何变化以便为新的一组值计算它?
这是我迄今为止尝试过的......
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();
}
}
我很难弄清楚数学,以及关于生成“缩放”视图的任何帮助!
【问题讨论】:
标签: c++ mandelbrot