Day 151: Deriving the Algorithm for Fractal Trees

In AP Computer Science, we are finishing our last unit before the AP exam. The summative lab is the Fractal Tree Lab. This year, students are provided much less direction. However, today, I did offer to work through the derivation of the algorithm with those students, who after working on it for most of day, wanted some assistance. They really just needed some help enumerating the key parameters for the recursive method and the geometry necessary to derive them. Here’s what we came up with:


I think the key idea is that the angle of the previous branch relative to the coordinate system needs to be passed as a parameter. This facilitates the calculation for the endpoints of the new branch. I’m excited to see if this year’s class is as creative as last year’s given that they have to struggle much more to derive the basic recursive algorithm.


Leave a Reply