一些帮助渲染 Mandelbrot 集

发布于 2024-09-30 05:04:59 字数 264 浏览 1 评论 0原文

我接受了一些有关曼德尔布罗特集的分形可视化的工作。

我不是在寻找完整的解决方案(自然),我正在寻求有关复数轨道的帮助。

假设我有一个从复平面上的点导出的给定复数。我现在需要迭代其轨道序列并根据轨道是否增加数量级来绘制点。

如何收集复数的轨道?非常感谢任何指导(链接等)。测试轨道序列所需的数学函数上的任何指针,例如 Math.pow()

我正在使用 Java,但这在这里并不是特别相关。

再次感谢, 亚历克斯

I have been given some work to do with the fractal visualisation of the Mandelbrot set.

I'm not looking for a complete solution (naturally), I'm asking for help with regard to the orbits of complex numbers.

Say I have a given Complex number derived from a point on the complex plane. I now need to iterate over its orbit sequence and plot points according to whether the orbits increase by orders of magnitude or not.

How do I gather the orbits of a complex number? Any guidance is much appreciated (links etc). Any pointers on Math functions needed to test the orbit sequence e.g. Math.pow()

I'm using Java but that's not particularly relevant here.

Thanks again,
Alex

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

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

发布评论

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

评论(4

筑梦 2024-10-07 05:04:59

当您显示 Mandelbrot 集时,您只需将实平面和虚平面分别转换为 x 和 y 坐标即可。

例如,复数 4.5 + 0.27i 会转换为 x = 4.5, y = 0.27

Mandelbrot 集是方程 Z = Z² + C 永远不会达到 |Z| 值的所有点。 >= 2,但实际上,您包括在特定迭代次数(例如 1000)内值不超过 2 的所有点。为了获得您通常看到的集合的彩色渲染,您可以为点分配不同的颜色超出设定范围取决于他们达到极限的速度。

由于它是复数,因此方程实际上是 Zr + Zi = (Zr + Zi)² + Cr + Ci。你可以将其分为两个方程,一个用于实平面,一个用于虚平面,然后它就是简单的代数。 C是要测试的点的坐标,Z的初始值为零。

这是我的多线程 Mandelbrot 生成器的图像:)

Mandelbrot set

When you display the Mandelbrot set, you simply translate the real and imaginaty planes into x and y coordinates, respectively.

So, for example the complex number 4.5 + 0.27i translates into x = 4.5, y = 0.27.

The Mandelbrot set is all points where the equation Z = Z² + C never reaches a value where |Z| >= 2, but in practice you include all points where the value doesn't exceed 2 within a specific number of iterations, for example 1000. To get the colorful renderings that you usually see of the set, you assign different colors to points outside the set depending on how fast they reach the limit.

As it's complex numbers, the equation is actually Zr + Zi = (Zr + Zi)² + Cr + Ci. You would divide that into two equations, one for the real plane and one for the imaginary plane, and then it's just plain algebra. C is the coordinate of the point that you want to test, and the initial value of Z is zero.

Here's an image from my multi-threaded Mandelbrot generator :)

Mandelbrot set

金兰素衣 2024-10-07 05:04:59

实际上,曼德尔布罗特集是迭代收敛的复数集。

所以曼德尔布罗集合中唯一的点就是中间那个大而无聊的颜色。你看到的所有漂亮的颜色只不过代表了边界附近(但错误的一侧)的点旋转到无穷大的速率。

用数学术语来说,

M = {c in C : lim (k -> inf) z_k = 0 } where z_0 = c, z_(k+1) = z_k^2 + c

即选择任何复数 c。现在要确定它是否在集合中,请重复迭代 z_0 = c、z_(k+1) = z_k^2 + c,z_k 将接近零或无穷大。如果它的极限(当 k 趋于无穷大时)为零,则它是 in。否则不是。

可以证明一旦 |z_k| > 2、不会收敛。这是一个很好的优化练习:IIRC |Z_k|^2 > 2 就足够了...无论哪种方式,平方都会为您节省昂贵的 sqrt() 函数。

Actually the Mandelbrot set is the set of complex numbers for which the iteration converges.

So the only points in the Mandelbrot set are that big boring colour in the middle. and all of the pretty colours you see are doing nothing more than representing the rate at which points near the boundary (but the wrong side) spin off to infinity.

In mathspeak,

M = {c in C : lim (k -> inf) z_k = 0 } where z_0 = c, z_(k+1) = z_k^2 + c

ie pick any complex number c. Now to determine whether it is in the set, repeatedly iterate it z_0 = c, z_(k+1) = z_k^2 + c, and z_k will approach either zero or infinity. If its limit (as k tends to infinity) is zero, then it is in. Otherwise not.

It is possible to prove that once |z_k| > 2, it is not going to converge. This is a good exercise in optimisation: IIRC |Z_k|^2 > 2 is sufficient... either way, squaring up will save you the expensive sqrt() function.

往事随风而去 2024-10-07 05:04:59

Wolfram Mathworld 有一个不错的网站,讨论 Mandelbrot 集。

复杂的课程将是最有帮助的。

也许像这样的示例会激发一些思考。我不建议使用Applet。

除了正弦、余弦、指数等函数之外,您还必须知道如何对复数进行加、减、乘、除和幂运算。如果您不知道这些,我会从那里开始。

我学的书是Ruel V. Churchill“复杂变量”

Wolfram Mathworld has a nice site talking about the Mandelbrot set.

A Complex class will be most helpful.

Maybe an example like this will stimulate some thought. I wouldn't recommend using an Applet.

You have to know how to do add, subtract, multiply, divide, and power operations with complex numbers, in addition to functions like sine, cosine, exponential, etc. If you don't know those, I'd start there.

The book that I was taught from was Ruel V. Churchill "Complex Variables".

尤怨 2024-10-07 05:04:59
/d{def}def/u{dup}d[0 -185 u 0 300 u]concat/q 5e-3 d/m{mul}d/z{A u m B u
m}d/r{rlineto}d/X -2 q 1{d/Y -2 q 2{d/A 0 d/B 0 d 64 -1 1{/f exch d/B
A/A z sub X add d B 2 m m Y add d z add 4 gt{exit}if/f 64 d}for f 64 div
setgray X Y moveto 0 q neg u 0 0 q u 0 r r r r fill/Y}for/X}for showpage
/d{def}def/u{dup}d[0 -185 u 0 300 u]concat/q 5e-3 d/m{mul}d/z{A u m B u
m}d/r{rlineto}d/X -2 q 1{d/Y -2 q 2{d/A 0 d/B 0 d 64 -1 1{/f exch d/B
A/A z sub X add d B 2 m m Y add d z add 4 gt{exit}if/f 64 d}for f 64 div
setgray X Y moveto 0 q neg u 0 0 q u 0 r r r r fill/Y}for/X}for showpage
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文