def ave_list_v3 ( vec_list ) : vec = Vec3 ( 0 , 0 , 0 ) for v in vec_list : vec += v num_vecs = float ( len ( vec_list ) ) vec = Vec3 ( vec . x / num_vecs , vec . y / num_vecs , vec . z / num_vecs ) return vec
how to get the average of vectors from python
Return the average vector of a list of vectors .
def ave_list_v3(vec_list):
    """Return the average vector of a list of vectors."""

    vec = Vec3(0, 0, 0)
    for v in vec_list:
        vec += v
    num_vecs = float(len(vec_list))
    vec = Vec3(vec.x / num_vecs, vec.y / num_vecs, vec.z / num_vecs)
    return vec