Fractal Trees

If your browser recognized the applet tag, you would see an applet here.

This program creates fractal trees, randomly picking parameters to create a new tree every time. The shapes of the trees in this applet are based on fractal canopies. First, two branches are drawn at an angle. Then, each of them is "split" into two smaller branches and the same is done to each of the four smaller branches. The splitting is continued a number of times to create a fractal at the end. The program also draws a leaf at the tip of every smallest branch to make it more realistic. Although this concept is similar to that of fractal canopies, it is somewhat different from it. First of all, the ratio of the lengths of consecutive branches is not constant, but instead randomly varies from 1 to 2. The angle between neighboring branches is also not constant, randomly varying from 0 to 90 degrees. The grate range of possible values for every branch allows this program to create an infinite variety of trees that look completely different. In order to make the program as fast and efficient as possible, we used recursion in our algorithm, which any programmer is probably familiar with.