Line interpolation function and tests