User Rating 0.0
Total Usage 0 times
Is this tool helpful?

Your feedback helps us improve.

About

A canopy fractal is a binary branching structure where a single trunk splits recursively into two sub-branches at each node. The geometry is governed by the split angle θ, the branch length ratio r, and the recursion depth n. Small changes in θ produce dramatically different topologies: at 60° the canopy resembles a deciduous oak, while 25° produces a narrow conifer. The total number of terminal branches equals 2n, so a depth of 14 yields 16,384 endpoints. This tool computes exact trigonometric positions for every segment and renders them on a hardware-accelerated Canvas surface. An optional jitter parameter perturbs each angle by a seeded pseudo-random offset, producing organic asymmetry without losing reproducibility.

Fractal dimension of the canopy boundary depends on r and θ. When 2 r cos(θ) < 1, branches do not overlap and the Hausdorff dimension is ln(2)ln(1 / r). When branches overlap the structure self-intersects, creating denser fill patterns. This generator approximates but does not clip overlapping geometry. All rendering is deterministic for a given seed value.

fractal canopy fractal tree fractal recursive tree fractal generator binary tree fractal L-system generative art

Formulas

Each branch segment is computed recursively. Given a starting point (x0, y0), current angle α, and current length L, the endpoint is:

x1 = x0 + L cos(α)
y1 = y0 L sin(α)

At each node, two recursive calls are made with updated angles:

αleft = α + θ + ε
αright = α θ + ε

where ε is a jitter value drawn from a seeded PRNG in the range [J, +J]. The next branch length is:

Lnext = L r

The total number of terminal segments at depth n:

Nterminals = 2n

The fractal (Hausdorff) dimension when branches do not overlap:

D = ln(2)ln(1 / r)

Where: θ = split angle (degrees), r = branch length ratio (0 < r < 1), n = recursion depth, J = maximum jitter angle, ε = random perturbation per branch, L = current branch length, α = current branch angle from vertical, D = fractal dimension.

Reference Data

Preset NameAngle θDepth nBranch Ratio rJitterTerminal BranchesVisual Character
Symmetric Oak45°120.700°4,096Balanced deciduous crown
Narrow Conifer20°130.750°8,192Tall, narrow spruce
Wide Elm70°110.650°2,048Broad spreading canopy
Wind-swept35°120.688°4,096Organic, asymmetric
Minimal Sapling40°60.720°64Simple, few branches
Dense Thicket30°150.733°32,768Very dense fill
Right-leaning55°100.6612°1,024Asymmetric, windblown
Fractal Dust90°140.500°16,384Cantor-set boundary
Golden Angle137.5°100.720°1,024Phyllotaxis-inspired spiral
Binary Symmetric60°100.500°1,024Self-similar, non-overlapping
Coral Fan25°140.805°16,384Dense, fan-shaped
Lightning15°140.7815°16,384Jagged, electric discharge
Weeping Willow80°110.746°2,048Drooping, wide arcs
Asymmetric Bonsai50°90.6010°512Irregular, sculpted look
Maximum Density35°160.712°65,536Near-solid canopy fill

Frequently Asked Questions

At depth n, the generator draws 2n+11 line segments. At n = 14 that is 32,767 segments. At 16 it reaches 131,071. Canvas 2D stroke calls are not batched by default, so each lineTo/stroke pair incurs GPU overhead. For depths above 14, expect 200-500 ms render time on mid-range hardware.
The Hausdorff dimension is D = ln(2) / ln(1/r). At r = 0.5, D = 1.0 - the canopy boundary is a curve. At r = 0.7, D1.94 - nearly area-filling. At r0.75, branches overlap heavily and the formula is only an upper bound.
The seed initializes a Mulberry32 pseudo-random number generator. The same seed always produces the same jitter pattern, so a specific organic-looking tree is reproducible. Changing the seed while keeping all other parameters fixed produces a structurally similar but visually distinct tree. Setting jitter to 0° disables the PRNG entirely and yields a perfectly symmetric fractal.
Self-intersection occurs when 2r ⋅ cos(θ) ≥ 1. For r = 0.7, the critical angle is θcrit = arccos(1/(2 × 0.7)) ≈ 44.4°. Below this angle, branches from adjacent nodes overlap, producing denser visual patterns.
The fractal is generated entirely by your parameter choices and rendered client-side. No copyrighted assets are involved. The output is a mathematical object parameterized by your inputs. You own the resulting image. Export at the highest resolution your display supports by maximizing the browser window before downloading.
If r is very low (below 0.4) and depth is modest (below 8), terminal branches become sub-pixel in length and invisible. Similarly, θ near 180° causes branches to fold back on the trunk. The generator does not clip these degenerate cases. Adjust r above 0.5 or increase depth to compensate.