def pivot(v):
    """
    :param v: vector or list
    :return: max in absolute value with original sign or max from origin.
    Corresponds to the main direction for each column of an orientation matrix.
    """
    return v[list(abs(v)).index(abs(v).max())]