def vertices2line(points):
    """ Perform a simple linear interpolation on
    two points.

    Parameters:
        points (list of np.ndarray): list of two 2D numpy arrays.
            of form [[x1, E1], [x2, E2]].

    Returns:
        (float, float): a tuple containing the gradient and
            intercept of the line intersecting the two points.

    """
    energy_pair = [points[0][1], points[1][1]]
    comp_pair = [points[0][0], points[1][0]]
    gradient = (energy_pair[1] - energy_pair[0]) / (comp_pair[1] - comp_pair[0])
    intercept = ((energy_pair[1] + energy_pair[0]) -
                 gradient * (comp_pair[1] + comp_pair[0])) / 2

    return gradient, intercept