Fix interpolation function.
Fix interpolation function.

This is not a particularly fast but it can be optimized later for
particular cases in 2D.

DO-CV/sara,DO-CV/sara,DO-CV/sara,DO-CV/sara,DO-CV/sara,DO-CV/sara