def matrix2vec(m, axis='x'):
    """Calculate axis vector from rotation matrix

    Parameters
    ----------
    m : numpy.ndarray
        rotation matrix
    axis : str, optional
        axis x, y, z, by default 'x'

    Returns
    -------
    vec : numpy.ndarray

    Raises
    ------
    ValueError
        axis shoule be x, y, z
    """
    if axis == 'x':
        vec = m[:, 0]
    elif axis == 'y':
        vec = m[:, 1]
    elif axis == 'z':
        vec = m[:, 2]
    else:
        raise ValueError("Valid axis are 'x', 'y', 'z'")
    return vec