Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some help rendering the Mandelbrot set

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

like image 303
Alex Avatar asked Dec 22 '22 21:12

Alex


1 Answers

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

like image 149
Guffa Avatar answered Dec 31 '22 12:12

Guffa