How to Draw the Mandelbrot Set by Hand

Table of contents:

How to Draw the Mandelbrot Set by Hand
How to Draw the Mandelbrot Set by Hand
Anonim

The Mandelbrot ensemble is made up of points drawn on a complex plane to form a fractal: an impressive geometric figure where each part is a miniature copy of the whole. It was possible to see the fascinating images hidden in the Mandelbrot ensemble as early as the 16th century, thanks to Rafael Bombelli's understanding of imaginary numbers … but it was only after Benoit Mandelbrot and others began to explore fractals with the help of computers that this secret universe was revealed.

Now that we know of its existence, we can deal with it in a more "primitive" way: by hand! Here is a way to visualize a rough representation of the whole, with the sole purpose of understanding how it is made; you will then be able to better evaluate the representations that you can obtain using the many open source programs available, or that you can view on CD-ROM and DVD.

Steps

217503 1
217503 1

Step 1. Understand the basic formula, often expressed as z = z2 + c.

It simply means that, for every point in the Mandelbrot universe that we want to see, we continue to calculate the value of z until one of the two conditions is met; then we color it to show how many calculations we have done. Do not worry! It will all become clear in the following steps.

217503 2
217503 2

Step 2. Get three different colored pencils, crayons or markers, plus a black pencil or pen to trace the pattern

The reason we need three colors is that we will make a first approximation with no more than three iterations (or steps: in other words, applying the formula up to three times for each point):

217503 3
217503 3

Step 3. Draw with the marker black a large table for the tris of three squares by three, on a piece of paper.

217503 4
217503 4

Step 4. Mark (always in black) the central square (0, 0)

This is the constant value (c) of the point in the exact center of the square. Now let's say that each square is 2 units wide, so add and / or subtract 2 to / from the x and y values of each square, x and y being the first and second numbers respectively. Once this is done, the result will be the one shown here. Following the cells horizontally, the values of y (the second number) will be unchanged; instead following them vertically, the values of x (the first number) will be.

Step 5. Calculate the first pass, or iteration, of the formula

Like the computer (in fact, the original meaning of this word is "person who computes"), you are able to do it yourself. Let's start with these assumptions:

  • The starting value of z of each square is (0, 0). When the absolute value of z for a given point is greater than or equal to 2, that point (and its corresponding square) is said to have escaped from the Mandelbrot set. In this case, you will color the square according to the number of iterations of the formula you applied at that point.

    217503 5a
    217503 5a
  • Choose the colors you will use for steps 1, 2 and 3. Let's assume that, for the purposes of this article, they are red, green, and blue, respectively.

    217503 5b
    217503 5b
  • Calculate the value of z for the upper left corner of the table for tic-tac-toe, assuming a starting value of z of 0 + 0i or (0, 0) (see Tips for a better understanding of these representations). We are using the formula z = z2 + c, as described in the first step. You will soon realize that, in this case, z2+ c it's simply c, because zero squared is always zero. And stuff c for this square? (-2, 2).

    217503 5C
    217503 5C
  • Determines the absolute value of this point; the absolute value of a complex number (a, b) is the square root of a2 + b2. Since we will compare it with the known value

    Step 2., we can avoid calculating the square roots by comparing to2 + b2 with 22, which we know is equivalent

    Step 4.. In this calculation, a = -2 and b = 2.

    217503 5D
    217503 5D
    • ([-2]2 + 22) =
    • (4 + 4) =
    • 8, which is greater than 4.
  • After the first calculation he escaped from the Mandelbrot set, because its absolute value is greater than 2. Color it with the pencil you chose for the first step.

    217503 5e
    217503 5e
  • Mandelbrot_set_419
    Mandelbrot_set_419

    Do the same for each square on the table, except for the central one, which will not escape the Mandelbrot set by the third step (nor will it ever). So you only used two colors: that of the first pass for all the outer squares and that of the third pass for the middle square.

217503 6
217503 6

Step 6. Let's try a square three times larger, 9 by 9, but keep a maximum of three iterations

Step 7. Start with the third row from the top, because this is where it gets interesting right away

  • The first element (-2, 1) is greater than 2 (because (-2)2 + 12 turns out to be 5), so let's color it red, since it escapes from the Mandelbrot set in the first pass.

    217503 7a
    217503 7a
  • The second element (-1, 5, 1) is not greater than 2. Applying the formula for the absolute value, x2+ y2, with x = -1, 5 and y = 1:

    217503 7b
    217503 7b
    • (-1, 5)2 = 2,.25
    • 12 = 1
    • 2.55 + 1 = 3.25, less than 4, so the square root is less than 2.
  • We then proceed with our second step, calculating z2+ c through the shortcut (x2-y2, 2xy) for z2 (see Tips to understand where this shortcut comes from), again with x = -1, 5 and y = 1:

    217503 7c
    217503 7c
    • (-1, 5)2 - 12 becomes 2, 25 - 1, which becomes '' 1, 25 ;
    • 2xy, since x is -1, 5 and y is 1, it becomes 2 (-1, 5), from which it results '' '-3, 0' '';
    • This gives us a z2 of (1.25, -3)
    • Now add c for this box (sum x to x, y to y), obtaining (-0, 25, -2)
  • Now let's check if its absolute value is greater than 2. Calculate x2 + y2:

    217503 7d
    217503 7d
    • (-0, 25)2 = 0, 0625
    • -22 = 4
    • 0.0625 + 4 = 4.0625, whose square root is greater than 2, so it escaped after the second iteration: our first green!
    • Once you are familiar with the calculations, you will sometimes be able to recognize which numbers escape the Mandelbrot set with a simple glance. In this example, the element y has a magnitude of 2, which, after being squared and added to the square of the other number, will be greater than 4. Any number greater than 4 will have a square root greater than 2. See the Tips below for a more detailed explanation.
  • The third element, with c having the value of (-1, 1), does not escape the first step: since both 1 and -1, squared, are always 1, x2+ y2 is 2. So we calculate z2+ c, following the shortcut (x2-y2, 2xy) for z2:

    217503 7e
    217503 7e
    • (-1)2-12 becomes 1-1, which is 0;
    • 2xy therefore is 2 (-1) = -2;
    • z2 = (0, -2)
    • adding c we get (0, -2) + (-1, 1) = (-1, -1)
  • This is always the same absolute value as before (the square root of 2, approximately 1.41); continuing with a third iteration:

    217503 7f
    217503 7f
    • ([-1]2)-([-1]2) becomes 1-1, which is 0 (again) …
    • but now 2xy is 2 (-1) (- 1), which is positive 2, which gives z2 the value of (0, 2).
    • adding c we get (0, 2) + (-1, 1) = (-1, 3), which has an a2 + b2 than 10, much greater than 4.
  • Therefore this number also flees. Color the box with your third color, blue, and since we've completed three iterations with this point, proceed to the next.

    217503 7g
    217503 7g

    Limiting ourselves to using only three colors clearly becomes a problem here, since something that escapes after only three iterations is colored as (0, 0), which never escapes; obviously, at this level of detail, we will never see anything that comes close to the Mandelbrot "bug"

217503 8
217503 8

Step 8. Continue calculating each box until it has escaped or you have reached the maximum number of iterations (the number of colors you are using:

three, in this example), the level at which you will color it. This is what the 9 by 9 matrix looks like after three iterations in each square… Apparently, we're discovering something!

Step 9. Repeat the same matrix with other colors (iterations) to show the next few levels, or better yet, draw a much larger matrix for a longer-term project

You can get more accurate pictures:

  • Mandelgen_81_81_0_0_1_rgb_fast_533
    Mandelgen_81_81_0_0_1_rgb_fast_533

    By increasing the number of boxes; this one has 81 on each side. Note the similarity to the 9 by 9 matrix above, but also the more rounded edges of the circle and oval.

  • Mandelgen_81_81_0_0_1_rgb2black_fast_797
    Mandelgen_81_81_0_0_1_rgb2black_fast_797

    Increasing the number of colors (iterations); this has 256 shades of red, green and blue, for a total of 768 colors instead of 3. Note that in this case you can see the line of the well known "lake" (or "bug", depending on how you look at it) of Mandelbrot. The downside is the amount of time it takes; if you can calculate each iteration in 10 seconds, it will take about two hours for each cell in or near Mandelbrot Lake. Even though it's a relatively small part of the 81 by 81 matrix, it would probably take a year to complete, even if you work several hours a day on it. Here's where silicon computers come in handy.

Advice

  • Why z2 = (x2-y2, 2xy)?
    • To multiply two complex numbers like (a, b) with (c, d), use the following formula, explained in this Mathworld article: (a, b) (c, d) = (ac - bd, bc + ad)
    • Remember that a complex number is made up of a "real" and an "imaginary" part; the latter is a real number multiplied by the square root of negative 1, often called the. The complex number (0, 0), for example, is 0 + 0i, and (-1, -1) is (-1) + (-1 * i).
    • Are you still following us? Remember the terms to And c they are real, while b And d they are imaginary. So when the imaginary terms are multiplied together, the square root of negative 1 multiplied by itself gives negative 1, nullifying the result and making it real; on the contrary, the numbers to And bc remain imaginary, because the square root of negative 1 is still a term of such products. Consequently, ac - bd constitute the real part, while bc + to the imaginary one.
    • Since we are squaring the numbers instead of multiplying two different ones, we can simplify a bit; since a = c and b = d, we have as product (a2-b2, 2ab). And, since we are associating the "complex plane" with the "Cartesian plane", with the axis x representing the "real" and the axis y representing the "imaginary", we will also describe it as (x2-y2, 2xy).
  • If you are repeatedly calculating a square and you find that a result matches exactly one you have already obtained for the same square, you know that you have entered an infinite circle; that square will never escape! You can then take a shortcut, color the box with your final color and move on to the next; (0, 0) is, of course, one of these boxes.
  • Want to know more about determining the absolute value of a complex number without struggling with calculations?
    • The absolute value of a complex number (a, b) is the square root of a2 + b2, the same as the right triangle formula, because to And b they are represented on the Cartesian lattice (the x and y coordinates, respectively) at right angles to each other. Consequently, since we know that the Mandelbrot set is limited to the value of 2, and that the square of 2 is 4, we can avoid thinking about square roots simply by seeing if x2+ y2 >= 4.
    • If one of the legs of a right triangle is of length> = 2, then the hypotenuse (diagonal side) must also be longer than 2. If you don't understand why, draw a few right triangles on a Cartesian lattice and it will become obvious; or see it this way: 22= 4 and, if we add another positive number to this (squaring a negative number always results in a positive number), we can't get something less than 4. So, if the x or y component of a complex number is magnitude equal to or greater than 2, the absolute value of that number is equal to or greater than 2, and has escaped from the Mandelbrot set.
  • To calculate the "virtual width" of each box, divide the "virtual diameter" by the "number of cells minus one". In the examples above we use a virtual diameter of 4, because we want to show everything within the radius of 2 (the Mandelbrot set is limited by the value of 2). For the approximation of side 3, it coincides with 4 / (3 - 1), which is 4 / 2, which in turn corresponds to

    Step 2.. For the square of side 9, it is 4 / (9 - 1), which is 4 / 8, which in turn corresponds to '' '0, 5' ''. Use the same virtual box size for both height and width, even if you make one side longer than the other; otherwise, the whole will be deformed.

Recommended: