# Which spline interpolation method can incorporate slope information at the support points?

Let be given a set of measurements $\left\{(x_1,y_1), (x_2,y_2),\ldots, (x_n,y_n)\right\}$. For these points, we further are given the slopes $y'_i$ measured at the support points $x_i$ for $i \in \{1,\ldots,n\}$.

I am looking for a common interpolation method that can incorporate this information efficiently. What I need is an interpolation function $y=f(x)$ with values $y_i$ and first derivatives $y'_i$ at the support points $x_i$.

I first checked for cubic splines, but these just assure that the splines have the same first and second order derivative at the support points (knots). Prescribing the actual slope (for all knots) is not foreseen.

Hints on existing implementations in Python, Matlab, C++, ... would be highly appreciated too.

• Thanks, this was of help. You can find here sample code of mine in python that demonstrates how this can be achieved with scipy.interpolate.BPoly.from_derivatives. Commented Dec 29, 2017 at 18:28
• @normanius. Your question here was about an interpolation scheme that produces a real-valued function, of the form $y=f(x)$. Your code does interpolation in 2D, so it produces a function $\mathbf{X} = \mathbf{X}(t)$ with values in $\mathbb{R}^2$. These are somewhat different problems, because the second one involves a somewhat arbitrary choice of parameterization. You chose chordal parameter values, but there are several other choices that work just as well, if not better. Commented Dec 31, 2017 at 4:19
• @bubba. Thanks for checking out. You're right, I solved a slightly different problem in the implementation, but it still demonstrates how BPoly.from_derivatives can be used to compute cubic Hermite splines. The code computes multiple interpolation curves $x_d(t)$ ($d=1,2$ and $\mathbf{X}=(x_1, x_2)$ in my 2D example) with knots at $t_i$ and $x_d(t_i)=x_{d,i}$ and $x'(t_i)=x'_{d,i}$. This resembles the original problem posted here. But you're right in that I do more than just this. Commented Dec 31, 2017 at 6:40