Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Tree Fractal

Public visualization

Viewing a saved revision (read-only)

c7ed248458694ea887202774fde71607

Tree Fractal

0 stars0🌍 Public
Yyakupermurat
Last edited Jun 5, 2020
Created on Jun 5, 2020
Forked from Tree Fractal

This interactive visualization renders a branching tree fractal on an HTML5 Canvas. Mouse movement dynamically changes the branch length ratio and angle difference, altering the tree's shape in real time. The code uses the Canvas API’s `getContext('2d')`, `moveTo`, `lineTo`, and `stroke` methods to draw recursive branches. The tree structure emerges from a recursive `drawTree` function that splits into left and right branches until reaching a depth of zero, with each branch’s length and angle determined by cursor position.

AI-generated description

Interactive tree fractal with Canvas.

Move the mouse to change the branching!

Draws from HTML5 Examples.