Home▸Articles▸Drawing with Maths

The 2D Chaos Game: A Mathematical Journey into Fractals

A simple yet profound method to generate complex fractal patterns through a series of random and deterministic steps.

mysimulator teamUpdated June 2026≈ 3 min read▶ Open the simulation

What is the 2D Chaos Game?

The 2D Chaos Game is an iterative process that involves repeatedly jumping from one point to another within a polygon, based on a set of simple rules. This game was popularized by mathematician Michael Barnsley and has become a classic example in the study of fractals and chaos theory.

Starting with a random initial point inside a polygon, you choose a vertex at random and move a fraction r of the distance towards it. Repeating this process creates a pattern that converges to a specific fractal shape.

Why Does It Matter?

The 2D Chaos Game is not just an abstract mathematical exercise; it has practical applications in fields such as computer graphics, cryptography, and even in understanding natural phenomena like the distribution of galaxies.

Moreover, this game provides a tangible way to explore complex systems and their emergent behaviors, making it a valuable educational tool for students and researchers alike.

live demo · related simulation● LIVE

How Does It Work?

The key to understanding the 2D Chaos Game lies in its iterative nature. Each step involves selecting a vertex at random from the polygon and moving a fraction r of the distance towards it, where 0 < r < 1. This process is repeated many times, with each new point added to the growing pattern.

The choice of N (the number of vertices) and r (the jump ratio) significantly influences the resulting fractal shape. For example, a triangle (N=3) always generates a Sierpinski triangle, while other values can produce more complex patterns.

Real-World Applications

The principles behind the 2D Chaos Game have been applied in various fields. In computer graphics, it is used to create realistic textures and shapes. In cryptography, similar iterative processes are employed for generating secure keys.

In nature, similar patterns can be observed in the distribution of leaves on a stem or the branching of trees, illustrating how simple rules can lead to complex structures.

Frequently asked questions

How does changing N affect the fractal pattern?

Changing N alters the number of vertices in the polygon. For example, a triangle (N=3) always generates a Sierpinski triangle, while other values can produce more complex patterns like the Sierpinski carpet or the Vicsek fractal.

What is the significance of the jump ratio r?

The jump ratio r determines how far you move towards the chosen vertex at each step. A smaller r means a slower convergence to the fractal pattern, while a larger r can lead to more chaotic and less predictable results.

Can the 2D Chaos Game be used for anything other than generating fractals?

Yes, the principles of the 2D Chaos Game are applied in various fields such as computer graphics, cryptography, and even in modeling natural phenomena. It provides a simple yet powerful framework for understanding complex systems.

Is there any way to predict the final fractal pattern before starting the game?

While it is challenging to predict the exact pattern without running the game, certain patterns can be predicted based on N and r. For example, a triangle (N=3) always generates a Sierpinski triangle.

Try it live

Everything above runs in your browser — open 2D Chaos Game and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open 2D Chaos Game simulation

What did you find?

Add reproduction steps (optional)