def get_pp_grid(cv, vals):
    """
    Return a point that gives a particular CV, when the collective variables are defined through a grid.

    Parameters
    ----------
    cv : array
        The target cv.
    vals : list
        A list of the line vectors defining the CV. 

    Returns
    -------
    pp : array
        The value of the point.
    """ 
    v1,v2,v3 = vals

    pp = v1 + cv[0]*(v2-v1) + cv[1]*(v3-v1)
    
    return pp