We use the system called "LSystem" for tree genaration.
The LSystem
The lsystem or Lindenmayer system is a string rewriting system
that can be used to generate fractals with dimension between 1 and 2 ^{[1]} The most powerful
part of the lsystem is the rewriting mechanism. The complex string can be generated by using the simple string and rewriting rules.
It consists of the set of variable, set of constants, and rules for replacing the variable. The lsystem can defined as follow,
Variable: A,B
Constant: +,
Rules:
A>A+B
B>A
The rule A>A+B means that the variable A will be replaced by a string "A+B" and B>A means that the variable B will be replaced
by a string "A". Using a string "A" as a start string, the result of each iteration is shown below
0 : A
1 : A+B
2 : A+B+A
3 : A+B+AA+B
4 : A+B+A+A+BA+B+A
The LSystem for tree generation
For generating the tree, we use this definition ^{[2]}:
Variable: A,B
Constant: f,l,[,],+,,^,v,<,>
Constant definition:
f : Create branch
l : Create leaf
[ and ] : For define the local area
+ and  : For rotation in xaxis
^ and v : For rotation in yaxis
< and > : For rotation in zaxis
Moreover, we need some other parameters for generating the tree. These parameter are listed below.
angle : define the rotion of branches for constant +,,^,v,<,>
iteration: number of iteration for rewriting the string
radius: the redius of the branches
radius reduction: the rate to decrease redius of the branches
height: length of each branches
Tree Example

Rules:
A>^fB>>>B>>>>>B
B>[^^f>>>>>>A]
initial string : fA
angle : 25
iteration: 5
radius: 0.2
radius reduction: 0.7
height: 0.05


Rules:
A>fB[[A]+A]+fB[+fBA]A
B>fB
initial string : fA
angle : 25
iteration: 5
radius: 0.2
radius reduction: 0.7
height: 0.05

Figure 7. Sample Tree Generate by LSystem with Parameters