def center(coords, center_point):
    """Center coordinates at the origin based on a center point.

    If idxs are given the center of mass is computed only from those
    coordinates and if weights are given a weighted center of mass is
    computed.

    Parameters
    ----------

    coords : arraylike
       The coordinates you wish to center.

    center_point : arraylike of float of 1 dimension
       The point to center all other coordinates around. Should have
       one element for each dimension of coords

    Returns
    -------

    centered_coords : arraylike
        Transformed coordinates.

    """
    assert len(coords.shape
        ) == 2, 'coordinates should be rank 2 array, this function operates on individual frames not trajectories.'
    assert coords.shape[1] == 3, 'coordinates are not of 3 dimensions'
    assert len(center_point) == 3, 'center point is not of 3 dimensions'
    return coords - center_point
