Multilinear interpolation for ndarrays