1

I'm trying to use Boost c++ library for Hermite interpolation, but it's not well documented and I'm not well understand.

My case is to calculate y values at some x position from data points such as:

X: 0.9, 1.7, 2.55, 3.39...
Y: 0.9, 0.8, 0.85, 0.84...

And get result with equal x spaces (x space 0.5):

X: 0.5, 1.00, 1.5, 2.00, 2.5, 3.0,...
Y: 0.8, 0.95, 0.8, 0.85, 0.9, 0.9,...

Can boost be helpful for me? I had found more implementations of Hermite in web, but examples and it's result output was not what I'm looking for. I think thats because I don't understand how it works. When I read about Hermite I tought that algorithm should ask for some points, spacing value and might few other input values and then calculate and return new points, but I was wrong and now lost..

http://www.boost.org/doc/libs/1_47_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_poly/hermite.html

Maybe someone has experience using Hermite and had similar case?

2 Answers2

1

Well, first of all, Hermite was a prolific mathematician, so Hermite polynomials (an orthogonal family) are unrelated to Hermite interpolating polynomials that arise in the interpolation method.

Second, Hermite interpolation is applied when you have values of first few function derivatives as well as function values at each point, so it's not really applicable in your case.

In Boost specifically, I could find only this algorithm for non-uniform interpolation: http://www.boost.org/doc/libs/1_65_0/libs/math/doc/html/math_toolkit/interpolate/barycentric.html —hopefully it is good enough for your purposes.

lomereiter
  • 356
  • 1
  • 5
  • Thanks for your answer. I will read more about Hermite. Yes there is plenty of other interpolation methods and algorithms, but I have to use Hermite. I will mark your answer accepted. Maybe you have suggestions what other lib to use to apply my case? I need to calculate derivates first, right? – Arnoldas Liudžius Sep 27 '17 at 06:45
  • 1
    @Iomereiter: Boost has new tools for interpolation landing in 1.65/1.66, including barycentric rational interpolation, cubic B-splines, and a Chebyshev transform. – user14717 Sep 29 '17 at 00:11
0

Boost provides barycentric rational interpolation for non-uniform spaced interpolation. This change landed in 1.65, so it's fairly new and you might have to update your boost. If you need uniform spacing and derivatives, evaluate this interpolant and equal spaced points and use the cubic_b_spline interpolation.

user14717
  • 4,757
  • 2
  • 44
  • 68