Linear interpolation and extrapolation