def transform_array(transform_matrix, a):
    """Pad an array with 1s, transform, and return with original dimensions.

    Parameters
    ----------
    transform_matrix : 4x4 array of float
        4x4 homogenous transformation matrix
    a : Nx3 array of float
        Array of 3-D coordinates.

    Returns
    -------
    Nx3 array of float : Transformed array
    """
    return unpad_array(np.dot(transform_matrix, pad_array(a).T).T)