Jump to content
• Advertisement

# Parabolic interpolation?

This topic is 5013 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

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.

#### Share this post

##### Share on other sites
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?

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites
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!

#### Share this post

##### Share on other sites
Quote:
 Original post by GrizwaldWell 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.

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
3. 3
Rutin
18
4. 4
5. 5
JoeJ
12
• Advertisement

• 14
• 22
• 9
• 31
• 18
• ### Forum Statistics

• Total Topics
632617
• Total Posts
3007475
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!