分形生长树的分形规则为:
其中a-e代表的是树枝,()代表的是向左生长,[ ]代表的是向右生长
用python实现的代码为:
__author__ = 'Lili'
#coding: utf-8
import matplotlib.pyplot as plt
import Queue
import math
import time
##---------- Setup two queque, NodeQue is stored the nodes that are printed this time. -----
##---------- NewNodeQue is stored the nodes that will be printed the next time. ------
NodeQue = Queue.Queue()
NewNodeQue = Queue.Queue()
##---------- Initialize the parameter ------------------------
length = 30 # setup the branch length
angle = 45 # setup the branch angle
lineWidth = 10 # setup the branch width
##------