How a computer draws a fractal tree on a pixel grid.
Mathematica
Visit on X@mathemetica82K followers
16,560 views
How a computer draws a fractal tree on a pixel grid.
The tree is recursive: every branch splits into two children, turned by ±θ and scaled by a fixed ratio. Each level doubles the branches.
Each branch is a line, and a screen only has whole pixels. Bresenham's algorithm picks them using integers only: step x by one and keep a decision value D = 2Δy − Δx. If D > 0, step y and subtract 2Δx; always add 2Δy.
D tracks which side of the true line the next pixel midpoint falls on.
Comments
Comments from the original post on X (Twitter)
No comments yet
