# Lagrange Interpolation

Lagrange interpolator is a polynomial of order $N - 1$, where $N$ is the number of discrete points to interpolate in one dimension.

It is a linear combination of Lagrange polynomials:
$$L_i(x_j) = \delta_{ij};$$ where:
$$\delta_{ij} = \left\{ \begin{array}{l l} 0 & \quad i \neq j \\ 1 & \quad i = j \end{array} \right.$$ The terms are obtained by the following formula:
$$L_i(x) = \prod_{\substack{ i=1 \\ i \neq j }}^N \frac{x - x_j}{x_i - x_j};$$ and combined linearly such that:
$$I_{Lagr.}(x) = I_{Lagr.}\left(f(x)\right) = \sum_{i=1}^N f(x_i)L_i(x).$$ The relevant Matlab code can be found at the end of 1-D discrete data analysis section.