def METHOD_NAME(line, pts, result, gates, tolerance):
    '''calculate all distances with mathuutils'''
    line_origin = V(line[0])
    line_end = V(line[-1])
    local_result = [[], [], [], [], []]
    for point in pts:
        data = compute_distance(V(point), line_origin, line_end, tolerance)
        for i, res in enumerate(local_result):
            res.append(data[i])
    for i, res in enumerate(result):
        if gates[i]:
            res.append(local_result[i])