The L-systems: Fractal tree generator

Manipulate[Module[{m1={Reverse[pt1],{-1,1} pt1},m2={Reverse[pt2],{-1,1} pt2}},Graphics[MapIndexed[{Thickness[0.01 th^#2[[1]]],Line[#]}&,NestList[Flatten[Map[{{#[[2]],#[[2]]+m1.(#[[2]]-#[[1]])},{#[[2]],#[[2]]+m2.(#[[2]]-#[[1]])}}&,#],1]&,{{{0,-1},{0,0}}},gen]],PlotRange->{{-3,3},{-1,5}},ImageSize->{500,400}]],{{gen,7,"Iterates"},3,10,1},{{th,0.7,"thickness ratio"},0.01,1.2},{{pt1,{-0.25,0.75}},{-3,-1},{3,3},Locator},{{pt2,{0.25,0.75}},{-3,-1},{3,3},Locator}]

Credit: Theodore Gray

Creation of this notebook was supported by IT Academy program of Information Technology Foundation for Education (HITSA).