This is an example of rendering a simple tree-like structure via recursion. The branching angle is calculated as a function of the horizontal mouse location. Move the mouse left and right to change the angle. Based on Daniel Shiffman’s Recursive Tree Example for Processing.
Related Examples
![](/_astro/07_Repetition-00_Color_Interpolation-thumbnail.CzYZT7-x_Z1kr8jn.webp)
No alt text
Color Interpolation
Fade between two colors.
![](/_astro/07_Repetition-01_Color_Wheel-thumbnail.C1vaRdoo_oYWFG.webp)
No alt text
Color Wheel
Create a visualization of the color spectrum.
![](/_astro/07_Repetition-02_Bezier-thumbnail.m5db6zrJ_ZLgvaX.webp)
No alt text
Bezier
Draw a set of curves.
![](/_astro/07_Repetition-03_Kaleidoscope-thumbnail.CF8DsOxl_Z4ylbs.webp)
No alt text
Kaleidoscope
Draw mirrored designs with the mouse.
![](/_astro/07_Repetition-04_Noise-thumbnail.DJeuUrfx_Z1KcWwv.webp)
No alt text
Noise
Generate naturalistic textures using Perlin noise.
![](/_astro/07_Repetition-05_Recursive_Tree-thumbnail.Bt-xw9xq_Z2g2AbQ.webp)
No alt text
Recursive Tree
Draw a tree using a function that calls itself.