Exploring the Pythagoras Tree

How can a simple formula create an infinite fractal world?

How can a tree grow from a square?

People seeing the Pythagoras tree for the first time often find it quite remarkable.

It relies on no models of trunks or leaves, nor on data from any real plant; it begins simply as a single square.

Yet, as the same rule is applied repeatedly, a pattern emerges that grows increasingly complex and tree-like.

Creating a complex tree does not necessarily require a complex drawing method; sometimes, all it takes is the repeated execution of a simple process.

This is the Pythagoras tree—one of the most classic and easily understood recursive figures in fractal geometry.

Try adjusting the parameters yourself:

How does it 'grow'?

The Pythagoras tree begins very simply: start with a square, generate two smaller squares on top of it, and then repeat the same process for each new square.

Two become four, four become eight. The eight continue to branch out...

As the number of layers increases, a tree of growing complexity gradually takes shape. Each layer follows the exact same rules; the only things that change are position, orientation, and size.

Every branch stems from the one before it

If you look closely, you will notice that every branch resembles a smaller tree, while the entire tree is composed of countless such branches. This characteristic—where the part resembles the whole—is one of the defining features of fractals.

Traces of recursion and fractals can be found in many complex forms in nature: tree branches fork repeatedly, blood vessels branch out, and rivers converge. Even when magnified, the smaller sections retain a branching structure similar to that of the whole.

The complete tree
Magnified branch

The complete tree

Magnified branch

Even when magnified, the smaller sections retain a branching structure similar to that of the whole.

Why is it called the 'Pythagoras Tree'?

Although it resembles a tree, its name actually derives from the famous Pythagorean theorem.

As each layer of branches is generated, new squares are arranged according to the geometric relationships of a right-angled triangle, ensuring the entire figure maintains a rigorous mathematical structure. However, one does not need to understand these geometric derivations. What matters more is observing how a simple rule evolves, step by step, into a tree.

Try Out Different Trees

By changing a few simple parameters, the entire tree takes on a completely different style: some appear tall and upright, others have spreading branches, some resemble bare winter trees, while others look like dense forest growth.

Even with the generation rules unchanged, simply adjusting the angles or the number of layers can create a wide variety of forms.

You can click the 'Next' button to view a selection of preset trees, or try adjusting the parameter controls below the image to generate your own unique tree styles.

Mathematics can also draw trees

The Pythagoras tree is not only a beautiful pattern, it is also a famous example of recursion in computer graphics.

The program only needs to describe:"How to generate the next layer. " instead of drawing all the branches one by one.

This idea was later widely used in procedural generation, natural scene simulation, and computer graphics. Complex forests, rich canopies, and even natural environments in games are often based on similar ideas.

What is recursion?

The most important concept behind the Pythagoras tree is recursion.

Recursion can be simply understood as: having a process repeatedly repeat itself.

It is like looking into a mirror where your reflection faces another mirror, creating a repeating sequence. Or consider tree branches: a single branch sprouts two new ones, and those new branches continue to sprout even smaller ones. Although each individual step is simple, continuous repetition creates a complex and rich structure.

The Pythagoras tree is one of the most classic visual examples of this concept.

A Classic Figure Spanning a Century

The Pythagoras tree was first proposed by Dutch mathematics teacher Albert E. Bosman in the mid-20th century and was named for the close relationship between its geometric construction and the Pythagorean theorem. For decades, it has served as a classic example in mathematics education, recursive algorithms, and fractal geometry.

To this day, it continues to help people grasp an important concept: complexity does not necessarily arise from complex rules; sometimes, all it takes is repeating a simple process many times.

Continue Exploring the World of Fractals

If you would like to see another type of math-driven tree structure, you can explore the Fibonacci tree. Instead of relying on geometric replication, it utilizes the proportional relationships found in the Fibonacci sequence to create natural-looking growth patterns.

If you enjoy observing the processes of natural growth, why not explore the Barnsley fern? If you want to experience the surprises of infinite variation, try the Julia set; meanwhile, the Mandelbrot set reveals the underlying principles governing the entire fractal world. Some fractals depict nature, others showcase change, and some demonstrate recursion. Yet, they all share a common message: simple rules, when repeated endlessly, can create breathtaking worlds.

You can also explore more fascinating mathematical shapes or read more about the Pythagoras tree on Wikipedia.

Want to see these stunning mathematical visuals every time you open a new tab? Install the Chrome extension now and set "Math Wonder Box" as your new tab page.🚀

Learn More