def ftree(iter,origin,t,r,theta,dtheta):
    """\
    def ftree(iter,origin,t,r,theta,dtheta):

    Extend the fractal tree one iteration.
    iter:     The iteration number (we stop when iter == 0)
    origin:   The x,y coordinates of the start of this branch
    t:        The current trunk length
    r:        The amount to contract the trunk each iteration
    theta:    The current orientation
    dtheta:   The angle of the branch
    """
    if iter == 0: return []
    x0,y0 = origin
    x,y = x0+t*cos(theta),y0+t*sin(theta)
    lines = [((x0,y0),(x,y))]
    lines.extend(ftree(iter-1,(x,y),t*r,r,theta+dtheta,dtheta))
    lines.extend(ftree(iter-1,(x,y),t*r,r,theta-dtheta,dtheta))
    return lines
    def ftree(iter,origin,t,r,theta,dtheta):

    Extend the fractal tree one iteration.
    iter:     The iteration number (we stop when iter == 0)
    origin:   The x,y coordinates of the start of this branch
    t:        The current trunk length
    r:        The amount to contract the trunk each iteration
    theta:    The current orientation
    dtheta:   The angle of the branch
    
recipes/Python/347736_MandelbrotFrame_Binary_Fractal/recipe-347736.py