Generate a function which interpolates between any given data of any dimension