def to_matrix_vector(transform):
    """Split a transform into it's matrix and vector components.

    The tranformation must be represented in homogeneous coordinates
    and is split into it's rotation matrix and translation vector
    components.

    Parameters
    ----------
    transform : ndarray
        NxM transform matrix in homogeneous coordinates representing an 
        affine transformation
        from an (N-1)-dimensional space to an (M-1)-dimensional space
        Example, a 4x4
        transform representing rotations and translations in 3
        dimensions. A 4x3 matrix can represent a 2-dimensional plane 
        embedded in 3 dimensional space.

    Returns
    -------
    matrix, vector : ndarray
        The matrix and vector components of the transform matrix.  For
        an NxM transform, matrix will be N-1xM-1 and vector will be
        1xN-1.

    See Also
    --------
    from_matrix_vector

    """
    
    ndimin = transform.shape[0] - 1
    ndimout = transform.shape[1] - 1
    matrix = transform[0:ndimin, 0:ndimout]
    vector = transform[0:ndimin, ndimout]
    return matrix, vector