![]() ![]() In practice, to draw the Mandelbrot set you should: it does not go to infinity, is the Mandelbrot set (the black set in the figure on the Wikipedia page). The set of those constants C for which the sequence z 1, z 2, z 3. you compute z 1 = f(0), z 2 = f(z 1), z 3 = f(z 2) and so on. Now you iterate it starting from z = 0, i.e. Where z is a complex variable and C is a complex constant. You start with a function of complex variable ![]() You should indeed start with the Mandelbrot set, and understand what it really is. Screen.Plot(x,y, iterations % maxColors) //depending on the number of iterations, color a pixel.ġ.) Learn exactly what the Square of a Complex number is and how to calculate it.Ģ.) Figure out how to translate the (-2,2) rectangular region to screen coordinates. While(Complex.Abs(Z) < 2 & iterations <</a> maxIterations) Int maxColors = 256 // Change as appropriate for your display. Int maxIterations = 10 // increasing this will give you a more detailed fractal public void MBrot()įloat epsilon = 0.0001 // The step size across the X and Y axis When done, color the original pixel depending on the number of iterations you've done. If the distance from the origin is greater than 2, you're done. If you reach the Maximum number of iterations, you're done. = ^2 + while keeping track of two things:Ģ.) the distance of from the origin. So, start by scanning every point in that rectangular area.Įach point represents a Complex number (x + yi). The Mandelbrot-set lies in the Complex-grid completely within a circle with radius 2. My quick-n-dirty code is below (not guaranteed to be bug-free, but a good outline).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |