🌿 Pythagoras Tree

Depth 9
Branch Angle 45°
Lean
Style
Branches: 0
...

🌿 Pythagoras Tree — Recursive Fractal

A beautiful fractal tree built from the Pythagorean theorem. At each branch, two smaller squares sprout at an angle, forming a self-similar tree that grows exponentially with each level of recursion.

🔬 What It Demonstrates

Each generation adds two squares whose sides satisfy a² + b² = c² (the Pythagorean theorem). The total area of all squares at any level equals the initial square — a visual proof!

🎮 How to Use

Adjust branch angle, recursion depth and lean ratio. Toggle animation to watch the tree grow level by level.

💡 Did You Know?

The Pythagoras tree was first described by Albert Bosman in 1942. With symmetric 45° branching, at depth 10 there are 1,024 leaf squares — and they perfectly tile without overlap up to depth 7.

About the Pythagoras Tree

The Pythagoras tree is a plane fractal built from squares and right triangles. Starting from a single square trunk, a right triangle sits on top of each square with the square's edge as its hypotenuse, and a new, smaller square is built on each of the triangle's two legs. Repeating this rule recursively on every new square produces a branching, tree-like figure. This simulation draws it on a canvas where you can set the recursion depth, the branch angle and a lean, choose a colour style, and animate the tree growing one level at a time.

The construction is a vivid visual demonstration of the Pythagorean theorem, a² + b² = c²: at every split the two child squares have a combined area exactly equal to their parent square, so the total leaf-square area at any level equals the original trunk square. With a branch angle θ, the child sides are c·cosθ and c·sinθ. Beyond pure mathematics, this recursive branching mirrors patterns found throughout nature — tree canopies, lung airways, blood vessels and river networks — and illustrates how self-similar fractals arise from one simple rule applied at every scale.

Frequently Asked Questions

What is the Pythagoras tree?

It is a fractal built from squares and right triangles. Each square sprouts two smaller squares on the legs of a right triangle placed on its top edge, and the rule repeats recursively to form a self-similar, tree-like shape.

How does it relate to the Pythagorean theorem?

At every branch a right triangle splits one square into two child squares on its legs. By the theorem a² + b² = c², the combined area of the two children equals the parent square, making the figure a visual proof of the theorem.

How do I use the controls?

Adjust the depth slider to change how many recursion levels are drawn, the branch-angle slider to reshape the canopy, and the lean slider to tilt the tree. Pick a colour style, then press Grow! to animate it level by level or Reset to restore the defaults.

What does the branch angle do?

The branch angle sets the shape of the right triangle at each split, which controls how wide or narrow the two child squares are. A symmetric 45° angle gives a balanced tree, while other angles produce leaning or lopsided canopies.

Why does the tree grow so quickly?

Each level doubles the number of branches, so growth is exponential: depth 10 produces 1,024 leaf squares. This is why deeper recursion rapidly fills the canopy and why high depths involve drawing thousands of segments.

What is a fractal?

A fractal is a shape that repeats the same pattern at every scale, so zooming in reveals smaller copies of the whole. The Pythagoras tree is a classic example because the same square-and-triangle rule is applied recursively without end.

What does the lean control change?

The lean adds an offset to the branching angles, tilting the entire tree to the left or right. It breaks the left-right symmetry and makes the canopy look more like a windswept or naturally irregular tree.

Does the total area stay the same at each level?

Yes. Because each pair of child squares has the same combined area as its parent, the total area of all squares at any single level equals the area of the original trunk square — a direct consequence of the Pythagorean theorem.

Where do fractal branching patterns appear in nature?

Recursive branching like the Pythagoras tree appears in real tree canopies, the airways of the lungs, networks of blood vessels and the tributaries of river systems, all of which efficiently fill space using self-similar rules.

Who first drew the Pythagoras tree?

It was first drawn in 1942 by Dutch mathematics teacher Albert Bosman using a simple drafting set. At a symmetric 45° angle the whole figure fits neatly inside a 6×4 rectangle no matter how deep the recursion goes.