WOLFRAM

Interpolation[{f1,f2,}]

constructs an interpolation of the function values fi, assumed to correspond to x values 1, 2, .

Interpolation[{{x1,f1},{x2,f2},}]

constructs an interpolation of the function values fi corresponding to x values xi.

Interpolation[{{{x1,y1,},f1},{{x2,y2,},f2},}]

constructs an interpolation of multidimensional data.

Interpolation[{{{x1,},f1,df1,},}]

constructs an interpolation that reproduces derivatives as well as function values.

Interpolation[data,x]

find an interpolation of data at the point x.

Details and Options

  • Interpolation returns an InterpolatingFunction object, which can be used like any other pure function.
  • The interpolating function returned by Interpolation[data] is set up so as to agree with data at every point explicitly specified in data.
  • The function values fi can be real or complex numbers, or arbitrary symbolic expressions.
  • The fi can be lists or arrays of any dimension.
  • The function arguments xi, yi, etc. must be real numbers.
  • Different elements in the data can have different numbers of derivatives specified.
  • For multidimensional data, the n^(th) derivative can be given as a tensor with a structure corresponding to D[f,{{x,y,},n}].
  • Partial derivatives not specified explicitly can be given as Automatic.
  • Interpolation works by fitting polynomial curves between successive data points.
  • The degree of the polynomial curves is specified by the option InterpolationOrder.
  • The default setting is InterpolationOrder->3.
  • You can do linear interpolation by using the setting InterpolationOrder->1.
  • Interpolation[data] generates an InterpolatingFunction object that returns values with the same precision as those in data.
  • Interpolation allows any derivative to be given as Automatic, in which case it will attempt to fill in the necessary information from other derivatives or function values.
  • The following options can be given:
  • InterpolationOrder Automaticset the order of the interpolation
    Method Automaticset a specifc method to use
    PeriodicInterpolation Automaticspecify if an interpolation is periodic
  • Interpolation supports a Method option. Possible settings include "Spline" for spline interpolation and "Hermite" for Hermite interpolation.

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Construct an approximate function that interpolates the data:

Out[1]=1

Apply the function to find interpolated values:

Out[2]=2

Plot the interpolation function:

Out[3]=3

Compare with the original data:

Out[4]=4

Find the interpolated value immediately:

Out[1]=1

Scope  (4)Survey of the scope of standard use cases

Interpolate between points at arbitrary values:

Out[1]=1
Out[2]=2

Create data with Table:

Out[1]=1

Form the interpolation:

Out[2]=2

Plot the interpolated function:

Out[3]=3

Create a list of multidimensional data:

Out[1]=1

Create an approximate interpolating function:

Out[2]=2

Plot the interpolating function:

Out[3]=3

Form an interpolation from data given as a TimeSeries:

Out[2]=2
Out[3]=3

Plot the interpolated function:

Out[4]=4

Generalizations & Extensions  (5)Generalized and extended use cases

Create data that includes derivatives at each point:

Out[1]=1

Construct an interpolation:

Out[2]=2

Plot the interpolation:

Out[3]=3

Create 2D data that includes a gradient vector at each point:

Out[1]=1
Out[2]=2
Out[3]=3

Compare with data that does not include gradients:

Out[4]=4
Out[5]=5
Out[6]=6

Also include tensors of second derivatives:

Out[1]=1
Out[2]=2
Out[3]=3

Create a vector-valued InterpolatingFunction of one variable from unstructured vector-valued data:

Out[2]=2

The value is a vector:

Out[3]=3

Plot will show both components:

Out[4]=4

Unstructured data can be used in the one-variable case.

Create a vector-valued InterpolatingFunction of two variables from structured vector-valued data:

Out[2]=2

The value is a vector:

Out[3]=3

Plot3D will show all three components:

Out[4]=4

A single component may be plotted using Part:

Out[5]=5

Derivatives may also be included for Hermite interpolation:

Out[6]=6
Out[8]=8

Options  (5)Common values & functionality for each option

InterpolationOrder  (3)

Make a zerothorder interpolation:

Out[1]=1

Make a linear interpolation:

Out[1]=1

Make a quadratic interpolation:

Out[1]=1

Method  (1)

Compare splines with piecewise Hermite interpolation for random data:

Out[2]=2
Out[3]=3

The curves appear close, but the spline has a continuous derivative:

Out[4]=4

PeriodicInterpolation  (1)

Make an interpolating function that repeats periodically:

Out[1]=1

Applications  (3)Sample problems that can be solved with this function

Interpolate random data:

Out[1]=1
Out[2]=2

Find a continuous interpolation of the GCD function:

Out[1]=1
Out[2]=2

Interpolate through a set of points with a spline:

Create a spline interpolation:

Out[2]=2

Visualize the interpolation and the set of points:

Out[3]=3

Properties & Relations  (2)Properties of the function, and connections to other functions

The interpolating function always goes through the data points:

Out[2]=2
Out[3]=3

Find the integral of an interpolating function:

Out[1]=1
Out[2]=2

Plot the interpolating function and its integral:

Out[3]=3
Out[4]=4

Possible Issues  (3)Common pitfalls and unexpected behavior

Extrapolation is attempted to go beyond the original data:

Out[1]=1
Out[2]=2

With the default choice of order, at least 4 points are needed in each dimension:

Out[1]=1

With a lower order, fewer points are needed:

Out[2]=2

The interpolation function will always be continuous, but may not be differentiable:

Out[1]=1
Out[2]=2

Neat Examples  (1)Surprising or curious use cases

Interpolate the sequence of primes:

Out[1]=1
Out[2]=2
Wolfram Research (1991), Interpolation, Wolfram Language function, https://reference.wolfram.com/language/ref/Interpolation.html (updated 2008).
Wolfram Research (1991), Interpolation, Wolfram Language function, https://reference.wolfram.com/language/ref/Interpolation.html (updated 2008).

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_interpolation, author="Wolfram Research", title="{Interpolation}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/Interpolation.html}", note=[Accessed: 25-July-2025 ]}

@misc{reference.wolfram_2025_interpolation, author="Wolfram Research", title="{Interpolation}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/Interpolation.html}", note=[Accessed: 25-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_interpolation, organization={Wolfram Research}, title={Interpolation}, year={2008}, url={https://reference.wolfram.com/language/ref/Interpolation.html}, note=[Accessed: 25-July-2025 ]}

@online{reference.wolfram_2025_interpolation, organization={Wolfram Research}, title={Interpolation}, year={2008}, url={https://reference.wolfram.com/language/ref/Interpolation.html}, note=[Accessed: 25-July-2025 ]}