Parabolic interpolation?

Started by
4 comments, last by Puzzler183 19 years, 3 months ago
if I have a series of discrete points, would it be possible to interpolate with a parabola with its vertex at the point, and opening up or down depending on the point? I've seen cosine interpolation, and cubic interpolation, but wouldn't a parabolic interpolation be a bit faster? Almost as fast as linear? Just curious.
I love me and you love you.
Advertisement
There appears to be SOME info about parabolic interpolation out there. You just need to know 3 points, determine the extrema and fit a parabola. Apparently there are some problems with differentiating these, but that wouldn't be a problem. The only problem is that It seems to be a lot like the cubic method, so the real question is, what is the speed difference?
I love me and you love you.
You can use the method of least squares to derive a best-fit equation for ANY curve from a series of data points, then you can use this equation for interpolation. For instance for a parabola:

NOTE: sum_all = sigma(from i=1 to n) of known points (x1, y1) ... (xn, yn)(general form) y = a + bx + cx^2(general least squares) sum_all[yi - f(xi)]^2(1) (partial deriv by a) 2*sum_all[     (yi - (a + bxi + cxi^2))] = 0(2) (partial deriv by b) 2*sum_all[xi  *(yi - (a + bxi + cxi^2))] = 0(3) (partial deriv by c) 2*sum_all[xi^2*(yi - (a + bxi + cxi^2))] = 0Expansion of 1-3 yields (remember that xi, yi are your input points):sum_all(yi)      = a*sum_all(xi^0) + b*sum_all(xi^1) + c*sum_all(xi^2) sum_all(xi*yi)   = a*sum_all(xi^1) + b*sum_all(xi^2) + c*sum_all(xi^3)sum_all(xi^2*yi) = a*sum_all(xi^2) + b*sum_all(xi^3) + c*sum_all(xi^4)


Then simply solve for a, b, and c and you have the best-fit interpolation equation. You could probably optimize this process pretty well, although the linear interpolation method would be faster due to many powers xi must be raised to.
h20, member of WFG 0 A.D.
Well i'll be sampling noise at all those points too, So I'm pretty sure that method is out. Cosine interpolation is smooth and fast for my needs right now. Thanks though!
I love me and you love you.
Quote:Original post by Grizwald
Well i'll be sampling noise at all those points too, So I'm pretty sure that method is out. Cosine interpolation is smooth and fast for my needs right now. Thanks though!


If you have exactly 3 points and are fitting a parabola, the least-squares fit should interpolate the 3 points exactly.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
Well, three values: these can also be derivatives. That's why cubic interpolation is so great: you need four values, usually the two end point and their derivatives so you can have C1 continuity.

This topic is closed to new replies.

Advertisement