Linear Interpolation

function linearinterpolation(x0, y0, x1, y1, xp)
    yp = y0 + ((y1 - y0)/(x1-x0)) * (xp - x0)
end