Windmill — Fantastic Fractal Explorer

Windmill

Euclid's windmill is the picture behind one proof of the Pythagorean theorem: a right triangle with a square standing on each of its two legs, and copies of the triangle turning around the corners like the sails of a mill. Repeating the picture on the smaller triangles it creates gives a fractal tree, the Pythagoras tree.

The construction here works on any triangle. Its three vertices are the points you drag. The longest side is the base, and a square stands on it, away from the apex. On each of the two shorter sides a second square stands outward, away from the base. On the far edge of each square sits a smaller copy of the whole triangle, similar to the first, with its base on that edge. Each of those copies repeats the same construction, level by level. Only the squares are drawn; the triangles between them are left empty.

Scaled to the base of length 1, with the apex at the complex number , the two child triangles are the images of the base triangle under

where and point outward from the squares on the legs. Their scales and are below 1 because the base is the longest side. For a right triangle the two children do not overlap; for other triangles they can, and then the copy drawn later shows. Copies are drawn level by level, so a copy of a deeper level covers one of a shallower level, including the larger copy it came from. Of two copies of the same level, the one on the side of the triangle where their paths part covers the other. (The deepest levels are drawn from a stored picture of each subtree, and there this order holds within each subtree.)

The number of levels is the depth slider. Deeper levels show finer detail, and the deepest allowed is set by the budget of triangles and squares.