Sunday, 25 August 2013

1-D Interpolation between any number of points

1-D Interpolation between any number of points

How would I go about finding an interpolated value from any number of
given points? These are one-dimensional values, and not coordinates. This
is why I am asking, because oddly enough all of the interpolation methods
I have seen seem to talk about 2-D interpolation. Hopefully 1-D
interpolation is simpler. Let's say I have three points:
1, 0, 0.5
A percentage controls what the value is. 100% = 1, 50% = 0, 0% = 0.5. So
75% should be perfectly between value A and value B, which means 75% = 0.
This should also work with 4 values, or 2, or 7:
1, 0, 1, 2, 0.5
Would yield 0 at 75% and 1 at 12.5%.
1, 0
Would yield 0.3 at 30%.
What sort of algorithm, if any, can calculate a new value based on a
percentage and a set of ordered values, such as this?

No comments:

Post a Comment