Viewing a saved revision (read-only)
1a135670c6564a90aeab8ee3b9eb2f0f
Tree Fractal with Randomness
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 descriptionInteractive 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.