# Interpolate between two data sets

Dear Root-Users

I have two data sets, describing measurements at different energies, each data set contains a length(position) and an arbitrary value (of interest). The number of data points within these sets can be different (different positions as well).

I want to interpolate values at an energy in between these two.
To use the Interpolator function I would basically need to create a third data set at this energy.

What I found so far: I could implement it in the following way:
Use Interpolator class to interpolate data set A to get a fixed number of data points at the same position as in data set B, do the same with data set B. Now call the Interpolator for every data point in A and B to get the new data set.
This sounds quite inefficient to me. Is there a better way to do that?

Example (I just made up the values, no real interpolation was done)
A(@100MeV)
length value
0.15 23
0.25 26
0.35 43
0.45 44
0.55 50

B(@200MeV)
length value
0.17 24
0.27 27
0.37 44
0.57 52

wanted
C(@150MeV)
length value
0.1 20
0.28 24
0.3 41
0.448 42
0.51 48

Any help would be greatly appreciated.

Cheers,
Hermann