src/bvhtoolbox/bvhtransforms.py
def reorder_axes(xyz, axes='zxy'):
    """Takes an input array in xyz order and re-arranges it to given axes order.

    :param xyz: array with x,y,z order.
    :param axes: output order for Euler conversions respective to axes.
    :return: array in axes order.
    :rtype: numpy.ndarray
    """
    if xyz.shape[-1] != 3 or len(xyz.shape) > 2:
        print("ERROR: Frames must be 1D or 2D array with 3 columns for x,y,z axes!")
        raise ValueError
    # If the output order is the same as the input, do not reorder.
    if axes == 'xyz':
        return xyz
    
    i, j, k = _get_reordered_indices(axes)
    # 1-D arrays.
    if len(xyz.shape) == 1:
        res = np.array([xyz[i], xyz[j], xyz[k]])
    # 2-D arrays: multiple frames.
    elif len(xyz.shape) == 2:
        # Todo: is something like data[:,1], data[:,2] = data[:,2], data[:,1].copy() faster/more efficient?
        res = np.array([xyz[:, i], xyz[:, j], xyz[:, k]]).T
    return res
Takes an input array in xyz order and re-arranges it to given axes order.

    :param xyz: array with x,y,z order.
    :param axes: output order for Euler conversions respective to axes.
    :return: array in axes order.
    :rtype: numpy.ndarray
    
Takes an input array in xyz order and re-arranges it to given axes order.
Takes an input array in xyz order and re - arranges it to given axes order .
def reorder_axes(xyz, axes='zxy'):
    if xyz.shape[-1] != 3 or len(xyz.shape) > 2:
        print("ERROR: Frames must be 1D or 2D array with 3 columns for x,y,z axes!")
        raise ValueError
    if axes == 'xyz':
        return xyz
    i, j, k = _get_reordered_indices(axes)
    if len(xyz.shape) == 1:
        res = np.array([xyz[i], xyz[j], xyz[k]])
    elif len(xyz.shape) == 2:
        res = np.array([xyz[:, i], xyz[:, j], xyz[:, k]]).T
    return res
def reorder_axes ( xyz , axes = 'zxy' ) : if xyz . shape [ - 1 ] != 3 or len ( xyz . shape ) > 2 : print ( "ERROR: Frames must be 1D or 2D array with 3 columns for x,y,z axes!" ) raise ValueError if axes == 'xyz' : return xyz i , j , k = _get_reordered_indices ( axes ) if len ( xyz . shape ) == 1 : res = np . array ( [ xyz [ i ] , xyz [ j ] , xyz [ k ] ] ) elif len ( xyz . shape ) == 2 : res = np . array ( [ xyz [ : , i ] , xyz [ : , j ] , xyz [ : , k ] ] ) . T return res
Takes an input array in xyz order and re-arranges it to given axes order.
Takes an input array in xyz order and re - arranges it to given axes order .
"""Takes an input array in xyz order and re-arranges it to given axes order.

    :param xyz: array with x,y,z order.
    :param axes: output order for Euler conversions respective to axes.
    :return: array in axes order.
    :rtype: numpy.ndarray
    """ # If the output order is the same as the input, do not reorder. # 1-D arrays. # 2-D arrays: multiple frames. # Todo: is something like data[:,1], data[:,2] = data[:,2], data[:,1].copy() faster/more efficient?
array in axes order.
array in axes order .
numpy.ndarray
xyz
array with x,y,z order.
array with x y z order .
axes
output order for Euler conversions respective to axes.
output order for Euler conversions respective to axes .