A bit about the beauty of T-fractals


    In 1977, Benoit Mandelbrot wrote the book Fractal Geometry of Nature. In it, he described in detail how, guided by simple rules, to draw a complex and beautiful self-similar pattern. And before Mandelbrot, and after, and to this day, fractal patterns attract the attention of mathematicians, programmers, artists and other beauty lovers.

    There are many fractal families. Today I’ll talk about one of them, surprisingly easy to build in your browser window, and beautiful enough to want to explore its properties.





    The fractal family described here does not have its own name, but it grew out of a T-square. Standing a T-square is very simple, using the principles of layering described in the article about cicadas . We take a small square, like this,only smaller, 4px * 4px in size, and tiling the plane with it. Please note - the border pixels of the square are transparent. Anyone who has read an article about the principle of cicadas will immediately understand why this is necessary.
    Then we enlarge the square four times - two per side - and pave the plane one more time. We repeat. We repeat. After several iterations, the squares will become large - and their mutual overlapping on each other forms a fractal.

    But what if we take not such a square pattern , but such ?
    And make visible pixels translucent so that the layers shine through each other?

    And here is what.



    And with another pattern (you can guess which one?) The result will be this:



    The most interesting thing is that you can not always predict what will come out of the pattern.

    I think it will be interesting for you to ask yourself a couple of fractals. Don’t bring me down the server!

    Sorry for the minimalism. By the way, if you run the source code yourself, there will be more functions.

    Well, now apologize not only for minimalism, but also a bad code. Everything is written in php, and you need gc to process the pictures - I think you already have it.

    Discover your beautiful fractal!

    PS The picture at the beginning is made like this .

    PPS kumankov added a little color to black and white pictures .

    Also popular now: