Draw a Canopy Fractal screenshot

Draw a Canopy Fractal

Grow a binary tree fractal from one stem, two branches per node, with the angle and shrink factor under your control.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab

A tree drawn by two rules

One vertical stem is the trunk. At its tip the page draws two branches of the same length multiplied by the shrink factor, one turned left by the branch angle and one turned right. Each of those tips does the same, so level n holds 2^(n+1) - 1 segments. Angle and shrink are the only inputs; the stem is always vertical and always centred.

The angle decides how wide the canopy spreads and the shrink decides how fast it narrows. A shrink near one makes a dense thicket where the twigs overlap; a small shrink makes a sparse, wide tree. Both are applied to the parent length, so the geometry is self-similar at every level.

Depth is capped at 12, which is 8,191 segments. Past that the twigs are shorter than a pixel and the recursion allocates sixteen thousand segments for a redraw nobody can see. The page redraws from the same two numbers every time, so a reload reproduces the identical tree.

Grow a branching canopy: every node forks into two children scaled by your shrink factor and mirrored about the stem, to a depth you set.

It is a deterministic recursive drawing on a canvas in this tab — the same depth, angle and shrink always produce the same tree — and nothing is uploaded.

How to use it

Set the depth, the branch angle and the shrink, then press Draw for one frame or Animate to grow it. Stop halts the animation, and the status line names the branch count at the depth drawn.

The rule

Each branch is the parent multiplied by the shrink factor and turned by the branch angle, with a mirrored copy on the other side. A shrink of 0.72 keeps the canopy open while 0.85 crowds it, which is the trade the control exists to show.

Where it stops

Depth is capped at 12, because two children per node make the segment count double at every level and the twigs are already smaller than a pixel below that. There is no seed, no colour control and no export.

What to Expect

Best for

  • seeing how a shrink factor changes a tree's density
  • producing a decorative branching figure

What this tool keeps

  • The recursion and the drawing happen in this tab, so the page works offline and keeps no image.

Frequently asked questions

What does the shrink factor do?

It multiplies every child's length by that factor. At 0.72 the canopy stays open; at 0.85 the branches crowd each other, and the drawing shows the difference directly.

Why is the depth capped at 12?

Because each node has two children, so the count doubles at every level and the twigs fall below one pixel. A deeper drawing would cost time without adding anything visible.

Is the tree random?

No. There is no seed: the geometry is a function of the depth, the angle and the shrink, so the same settings always grow the same figure.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.