I need to interpolate a smooth surface from a 3D point cloud (z=f(x,y)
) and I've found that scipy's interp2d function gives very satisfactory results, using cubic splines. Unfortunately, the software I'm working on is written in C# and it would be inefficient to call a Python program every time I need to process data.
I've looked through scipy's source code and it seems that interp2d relies on some FITPACK routines written in Fortran. I've used wrappers for BLAS/LAPACK in the past but here I've been unable to find any C#/.NET library providing 3D spline interpolation, either relying on FITPACK or directly implemented in C#. Actually, I've been unable to find any implementation at all for such computations (except in scipy), which is quite surprising.
Math.NET Numerics provides spline-based interpolation, but only in 2D (y=f(x)
). ILNumerics seems to provide 3D interpolation, but it's a paid library.
I feel like I'm missing something. Is there any open-source library in C# (or even in C, Java, any language at this point) that implements the algorithm used by scipy's interp2D?