[Home]CosineInterpolation

HomePage | RecentChanges | Preferences | TableOfContents | AboutTheWiki

Cosine interpolation is a simple method for approximating curvature while interpolating between two points. Similar to linear interpolation, this method is useful for when a straight-line interpolation is not adequate, yet a full cubic interpolation method might be inappropriate.

Like linear interpolation, cubic interpolation takes a parameter t, and evaluates that parameter to an intermediate location between two points, p0 and p1. Unlike linear interpolation, a little bit of math is tossed in to give the function a little but of curvature. It is not realistic curvature; the function, evaluated over a continuous set of control points, will exhibit peaks and discontinuities. But those discontinuities are typically small, and may not be noticable.

The method for cosine interpolation is:

pi=3.1415927 f = t * pi g = (1 - cos(f)) * 0.5 P(t)=p0+g*(p1-p0)

As you can see, g is calculated as a fudge-factor based on t, then is plugged straight in as a linear interpolant between p0 and p1. The cos() operation imparts it a bit of a curve.

Related Topics

LinearInterpolation CubicInterpolation

For a graph showing the differences between these 3 types of interpolation, see InterpolationComparison.


HomePage | RecentChanges | Preferences | TableOfContents | AboutTheWiki
This page is read-only | View other revisions
Last edited January 11, 2005 4:34 pm CDT by BradDaBug (diff)
Search:
Creative Commons License
All articles licensed under a Creative Commons License.