3D Spline interpolation

628 Views Asked by At

I have 3D data i need to interpolate via Spline. My data is a set of (x,y,z) on an irregular grid. I have to find the z of some x,y not on the grid. I can't use any library since i have to manually port the code into different languages. I have previous experience with 2D splines but i struggle to extend the concept to 3D. I've seen some related answers on this site but none of them it's enough, for me, to start to understand the issue and create the script. Thanks

1

There are 1 best solutions below

0
On

Take the 2D points $(x_i , y_i)$ and perform Delaunay triangulation to get a triangular mesh. Each point on the $(x, y)$ plane is either at a vertex $(x_i , y_i)$, on the edge between two vertices $(x_j , y_j)$ and $(x_k , y_k)$, or in the triangle between three vertices. (Delaunay triangulation gives you the edges and triangles.)

On an edge between two vertices you linearly interpolate between the two points. Within a triangle you interpolate between three points.

This gives you a linear interpolation.