linear interpolation and constant extrapolation