Engee documentation
Notebook

Interactive visualization of the Mandelbrot set using the Genie app

Introduction

The Mandelbrot set is one of the most famous fractals, first studied by French mathematicians Pierre Fatou and Gaston Julia in the early 20th century, but widely known for the work of Benoit Mandelbrot in the 1970s and 80s. This is the set of points on the complex plane for which the iterative process remains limited when .

Mathematically, the Mandelbrot set is defined as follows. For each complex number c, consider the sequence:

Where:

  • — the current value in the iterative process, which is sequentially converted using the formula .

  • — the complex number that we are investigating (the coordinate of a point on the complex plane, checked for belonging to the Mandelbrot set).

  • — the number of the current iteration, showing how many steps have been taken in the calculation process.

If the module remains limited (does not exceed ) when , then point c belongs to the Mandelbrot set. In practice, we limit ourselves to a finite number of iterations and consider a point to belong to a set if, in a given number of steps, the sequence has not gone beyond the radius circle. .

The configuration of the set is striking in its complexity and infinite detail: the main cardioid, the kidney circle, and countless "threads" and "pollen" on the border. As the scale increases, more and more new structures are revealed that resemble the basic shape — this property of self-similarity is characteristic of fractals. This set has become a classic example of fractal geometry and is used in mathematics, physics, computer graphics and even in art.

This application implements an interactive Mandelbrot set browser. By changing the initial parameters, you can explore the fractal in real time, navigate along the complex plane, zoom in on areas of interest, and observe the infinite complexity of the boundary of the set. Different color schemes allow you to visualize the depth of the divergence of points — how many iterations it took to exceed the threshold value.

Launching the app

The script of this application is in the file mandelbrot.jl. Launch the application and open it in a new browser tab.

In [ ]:
genie_app = engee.genie.start("$(@__DIR__)/mandelbrot.jl")
display("text/html", """<a href="$(string(genie_app.url))" target="_blank">Open in a new tab</a>""")
image.png

This application is a digital model of a mathematical microscope for studying fractal structures.

image.png

By manipulating the parameters on the control panel, you control the visualization settings.:

  • The dimensions of the axes determine the resolution of the final image and allow you to optimize it for your screen (the number of pixels horizontally and vertically).

  • The number of iterations sets the maximum depth of calculations — the higher it is, the more detailed the fine structures on the boundary of the set are.

  • The coordinates of the center allow you to move along the complex plane, choosing the area to explore.

  • Zoom increases or decreases the image, allowing you to view the fractal with varying degrees of detail.

  • The color scheme determines how the number of iterations before divergence is displayed, from monochrome to rainbow palettes.

image.png

Observe how, as you approach the boundary of the set, more and more new details are revealed, repeating the basic shape in endless recursion. The gradients of the color schemes will allow you to see various aspects of the dynamics of the iterative process.

By moving the cursor to the upper-right part of the image and clicking on the camera icon, you can save an image of the fractal.

Снимок экрана 2026-03-03 191337.png

After completing the work with the application, we will close it.

In [ ]:
engee.genie.stop("$(@__DIR__)/mandelbrot.jl");

Conclusion

This application is a digital tool for researching one of the most famous objects of modern mathematics. Virtual laboratories of this type allow you to study fractal geometry without having to program visualization yourself. By modeling various areas of the complex plane and changing the calculation parameters, the user experimentally explores the properties of fractals: self-similarity, infinite detail, and boundary complexity. The application can serve as a textbook on fractal geometry, dynamical systems theory, and complex analysis. The combination of Engee and Genie opens up opportunities for creating interactive materials that make abstract mathematical concepts visual and accessible to a wide audience.