split <line> into multiple sublines
    using intersection with <lines>

def split(line, lines):
    """
    split <line> into multiple sublines
    using intersection with <lines>
    """
    out = empty((len(lines) + 1, 4))

    p1 = line[:2]
    for n, l2 in enumerate(lines):
        p2 = intersection(line, l2)
        out[n][:2] = p1
        out[n][2:] = p2
        p1 = p2
    out[n + 1][:2] = p2
    out[n + 1][2:] = line[2:]
    return out