def average(v):
    """
    This function can calculate the average of a list of vectors.

    Parameter:

    v:
        A list of (3x1) np.array. It contains several vectors

    Return:
        (3x1) tuple. The averaged vector.
    """
    n = len(v)
    if n == 0:
        return 0
    else:
        tot = [0, 0, 0]
        for i in v:
            if i[2] < 0:
                i = i * -1
            tot = tot + i
        return [tot[0] / n, tot[1] / n, tot[2] / n]
