Skip to main content
100%

Tree Fractal with Randomness

✓ Published0🌍 Public
CCurran Kelleher
Last edited Oct 9, 2025
Created on Mar 27, 2024
Forked from Tree Fractal

This interactive tree fractal grows recursively from a trunk, splitting into branches whose length and angle change with mouse position. The Canvas API renders the structure, while a seeded pseudo-random number generator introduces stochastic variation, causing some branches to continue straight while others bifurcate. The drawing updates on mousemove events, with horizontal position controlling branch length ratio and vertical position adjusting angle difference. The code scales the canvas for high pixel density displays using devicePixelRatio.

AI-generated description

Interactive tree fractal with Canvas.

Move the mouse to change the branching!

Draws from HTML5 Examples.

Extended to use high resolution Canvas for high pixel density displays.

MIT Licensed

Similar vizzes