# How do I implement thin plate splines with barriers?

I want to implement thin spline interpolation of scattered elevation data $\{z_i(x_i,y_i)\}_{i=1..n}$ in C++.

This seems fairly simple using Radial Basis Functions:

$$z(x,y) = p(x,y) + \sum_i l_i\phi(r)$$ where p(x,y) is a polynomial and $\ \phi= r^2\ln(r)$ .

Requiring the interpolated surface to go exactly trough the n datapoints + ortogonality of polynomials leads to a matrix equation. This is then solved to find the coefficients $l_i$.

However I want the implementation to take into account "barriers":

As you can see in this figure: points on one side of the "barrier" should not be influenced by points on the other side of the "barrier".

As an example consider this simple form of interpolation: the elevation in a grid node is found as an average over the elevation of points within a circle of radius R. Now consider a grid node very close to the "barrier". This would be influenced by points on both side of the "barrier" and as a result the interpolated elevation would be somewhere in between. The resulting surface would not show a discontinuity ("cliff") instead it would show a "hill". In this case things could be remedied by only using points from the same side of the "barrier" as the grid node when doing the averaging.

NB! The "barriers" do not necessarily split the data into two sets like in the image.

How do I do this?

• I don't know from your description what a "barrier" is supposed to be. Can you describe it in words? – Wolfgang Bangerth Jun 24 '13 at 4:02
• I have added some more description. – Andy Jun 24 '13 at 7:39
• Use "compactly supported radial basis functions"? – André Jun 24 '13 at 12:21
• Would it be feasible to put extra weight on the barrier points? You can perhaps "enforce" a strong "ridge" by putting a second interpolation point very close to the barrier. But all this depends a little on the desired continuity or smoothness – André Jun 24 '13 at 12:23