Pythagoras tree


A Pythagoras tree is a fractal, first discovered by the Dutch electrical design engineer and mathematics teacher Albert E. Bosman. In 1942, he was a forced laborer in Nazi Germany, where he was ordered to design parts for submarines. He sabotaged by stalling, but making it look like he was busy working on tasks that were forced upon him. Instead, he secretly drew smaller and smaller right-angled triangles with squares sharing sides with the triangles. After many triangles and squares, his drawing revealed a remarkable figure.

Pythagoras squares Draw on each side of a right-angled triangle a square. So each square shares a side with the triangle. The sum of the areas of the two smaller squares equals the area of the third square. Area A Area B Area C a b c α Area A + Area B = Area C a 2 + b 2 = c 2
Fig.1. The Pythagorean theorem.

This fractal later became known as the "Pythagoras tree", as the areas of the squares relate to each other according to the Pythagorean theorem. Bosman drew his tree with angle α = 45°, which results in a bilaterally symmetrical tree, i.e. having a left and a right side that are mirror images of each other. But, of course, the angles can be anything between 0 and 90 degrees.

With this JavaScript web application you can construct Pythagoras trees with a variety of angels, scales and colors. You can also select the "level" at which you want the drawing to stop. All triangles (and consequently the squares) at the same level are of the same size (when α = 45°). The higher the level, the smaller the squares and the more squares and triangle you can track back to the trunk.

Application canvas

Control panel

Number of iterations: