fix linear interpolation computation