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.
Recursive Tree by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.