曼德布罗缩放难度

发布于 2024-12-17 16:39:28 字数 881 浏览 0 评论 0原文

我不确定这个问题与哪个领域相关,但我会尝试一下。 我正在尝试计算曼德尔布罗特集。最大的区别是我的输出是 3D 模型。该集的计算是精确完成的,但是一旦我尝试缩放到 ax,y 点(位于 2D 平面上),它就无法按预期工作。 这里的主要概念是通过提取下一个缩放点,我将能够计算我的集合的新边界边缘。当

xru,yru = top right point of the set
xld yld = buttom left button
direction = 1 = zoom in
constVal = the original size of the set : 2X2
constVal[0] = xru , yru (at beginning)
constVal[1] = xld, yld (at beginning)

结果缩放到未知点时。我猜计算有问题。我尝试做以下事情:

int direction = 1;
double ratiox = foundPointOnHost.x / ((constVal[1][0] - constVal[0][0]));
double ratioy = foundPointOnHost.z / ((constVal[1][1] - constVal[0][1]));
double xrange = xru-xld;
double yrange = yru-yld;

xld += direction*0.01*ratiox*xrange;
xru -= direction*0.01*(1.-ratiox)*xrange;
yld += direction*0.01*(1.-ratioy)*yrange;
yru -= direction*0.01*ratioy*yrange; 

编辑:我回顾了您给我的一些示例,但我仍然没有找到最适合我的情况的任何合适的答案。

I'm not sure to which area this question is related , but I will give it a go.
I'm trying to calculate the Mandelbrot set. The big difference is that my output is a 3D model. The set's calculation is done precisely, but once I try to zoom to a x,y point (which is located on the 2D plane) it doesn't work as expected.
The main concept here is by the extract next zooming point, I will be able to calculate my set's new border edges. When

xru,yru = top right point of the set
xld yld = buttom left button
direction = 1 = zoom in
constVal = the original size of the set : 2X2
constVal[0] = xru , yru (at beginning)
constVal[1] = xld, yld (at beginning)

the result is zooming to unknown point. I guess that something is wrong with the calculation. I tried to do the following thing :

int direction = 1;
double ratiox = foundPointOnHost.x / ((constVal[1][0] - constVal[0][0]));
double ratioy = foundPointOnHost.z / ((constVal[1][1] - constVal[0][1]));
double xrange = xru-xld;
double yrange = yru-yld;

xld += direction*0.01*ratiox*xrange;
xru -= direction*0.01*(1.-ratiox)*xrange;
yld += direction*0.01*(1.-ratioy)*yrange;
yru -= direction*0.01*ratioy*yrange; 

EDIT : i reviewed some of the examples you gave me , but i still haven't found any suitable answer which fits best to my situation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

善良天后 2024-12-24 16:39:28

好吧,我设法找到了正确的解决方案。
由于轴全部恢复,我写了以下内容:

double ratiox = foundPointOnHost.x / (constVal[1][0] - constVal[0][0]);
double ratioy = 1-foundPointOnHost.z / (constVal[1][1] - constVal[0][1]);
double xrange = xru-xld;
double yrange = yru-yld;

Well, I managed to find the right solution.
Since the axis are all reverted, I wrote the following:

double ratiox = foundPointOnHost.x / (constVal[1][0] - constVal[0][0]);
double ratioy = 1-foundPointOnHost.z / (constVal[1][1] - constVal[0][1]);
double xrange = xru-xld;
double yrange = yru-yld;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文