def linearInterpolation(x1, x2, y1, y2, x):
    """
    A default linear interpolation functions for the value x between two points
    p1 = (x1,y1) and p2 = (x2,y2). 

    Parameters
    ----------
    x : float
        The input x value

    Returns
    -------
    y : float
        the output y value.

    """

    dx = (x2 - x1)
    if dx == 0:
        y = y1
    else:
        y = ((y2 - y1) / (dx))*(x - x1) + y1
    
    return y