InterpolationOrder

InterpolationOrder

is an option for Interpolation, as well as ListLinePlot, ListPlot3D, ListContourPlot, and related functions, that specifies what order of interpolation to use.

Details

  • InterpolationOrder->n specifies that polynomials of degree n should be fitted between data points.
  • For multidimensional data, the polynomials are taken to be of degree n in each variable.
  • InterpolationOrder->None specifies that data points in plots should be joined without interpolation.
  • InterpolationOrder->0 yields a collection of flat regions, with steps at each data point.
  • InterpolationOrder->1 joins data points with straight lines in 2D, and with piecewise polygonal surface elements in 3D.
  • Higher interpolation orders generally lead to increasingly smooth curves or surfaces.
  • In functions such as NDSolve, InterpolationOrder->All specifies that the interpolation order should be chosen to be the same as the order of the underlying solution method.
  • InterpolationOrder can also be used in functions like Manipulate, to specify the smoothness of animations between control points such as bookmarks.

Examples

open allclose all

Basic Examples  (3)

Use different interpolation orders for curves:

Use different interpolation orders for surfaces:

Use different interpolation orders when constructing an InterpolatingFunction:

Scope  (4)

Use piecewise quintic interpolation to approximate the sine function:

Show the approximation error:

Show the smoothing effect of higher interpolation order in plotting:

Show the smoothing effect of higher interpolation order for GCD data:

Get a solution that uses interpolation of the same order as the method from NDSolve:

This is more time consuming than the default interpolation order used:

It is much better in between steps:

Possible Issues  (1)

Very high-order interpolation can lead to large errors:

Interpolate with order 20:

Piecewise interpolation with lower order makes a much better approximation:

Show the approximation error for different interpolation orders:

Neat Examples  (1)

Zero-order interpolation, with Voronoi cells having the constant value:

Wolfram Research (1996), InterpolationOrder, Wolfram Language function, https://reference.wolfram.com/language/ref/InterpolationOrder.html (updated 2008).

Text

Wolfram Research (1996), InterpolationOrder, Wolfram Language function, https://reference.wolfram.com/language/ref/InterpolationOrder.html (updated 2008).

CMS

Wolfram Language. 1996. "InterpolationOrder." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/InterpolationOrder.html.

APA

Wolfram Language. (1996). InterpolationOrder. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InterpolationOrder.html

BibTeX

@misc{reference.wolfram_2024_interpolationorder, author="Wolfram Research", title="{InterpolationOrder}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/InterpolationOrder.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_interpolationorder, organization={Wolfram Research}, title={InterpolationOrder}, year={2008}, url={https://reference.wolfram.com/language/ref/InterpolationOrder.html}, note=[Accessed: 22-November-2024 ]}