added interp() function for linear, quadratic, cubic interpolation, 1d