Pythagoras tree
Explore a tree of squares built on right triangles, with adjustable angle and a planar or extruded view.
About this tool
Starting from one square, build a right triangle on its top edge and a square on each leg. The two child areas sum to the parent area: cos²θ + sin²θ = 1. A 45° angle gives equal branches.
- Choose 1–14 levels and an angle from 5° to 85°, then Draw. One level is the root square; each new level adds two children per parent. No hidden depth or minimum-size cutoff.
- The displayed percentages are the left and right child areas relative to their parent. Squares can overlap; summed areas do not mean uncovered area.
- 2D preserves equal axis scales and grows upward. Extruded 3D uses the same planar tree, with square thickness 3% of its side; it is not a spatial branching rule. Drag to rotate, Ctrl/Meta+wheel to zoom; plain wheel scrolls the page.
- Colours show generation. View and colour changes reuse the computed geometry. Changing angle or levels invalidates it; resize only repaints.
- PNG saves the current view with its parameters, including the 3D camera. SVG exports the sharp 2D polygons. All geometry is computed locally.