Pythagoras Tree (Fractals)
22 Nov 2019
Sorry, your browser does not support Canvas.
VariableValue RangeValue
Angle1 - 135

Drawing a fractal tree involves the following
  1. Draw the trunk
  2. At the end of the trunk, split at an angle and draw two branches. In the above demo, the angle is adjustable. This makes for an interesting effect while adjusting and its surprising to see each angle make for a different looking tree. Also note that each branch is one third (1/3) smaller than its trunk.
  3. The end of each branch we designate it as a trunk essentially recur from point 1 until a sufficient level of branching is reached. In the demo above I have stopped branching when the length of each branch reaches 2.
1. fractals.js - Download, index.html
//Code goes here

Javascript Demos

Here's a bunch of javascript... things I wrote over the years whenever time permitted.