0

Basically I have a set of data like

var data = [
    {idx: 0, value: 10},
    {idx: 20, value: 15},
    {idx: 45, value: 24},
    {idx: 100, value: 55},
];

I'm looking for a way to interpolate/estimate what the value of an unmapped point (such as an idx of 32) would be. I'm a little out of my element here, and would love to learn more about how to tackle this problem, so some direction would be greatly appreciated!

vector
  • 1
  • 1
  • 1
    I'd say that's a more general math problem, not a specific programming problem. This might be a good starting point: http://en.wikipedia.org/wiki/Linear_interpolation – Felix Kling Oct 09 '14 at 21:36
  • look here: http://stackoverflow.com/a/26137003/2521214 if you have always just 4 points then single interpolation cubic suffice just change t parameter to idx and cover with it whole curve. if you have many points then use piecewise interpolation as in the link ... – Spektre Oct 10 '14 at 07:37

0 Answers0