Tree Fractal with Randomness
✓ Published0🌍 Public
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.
MIT Licensed