Interpolation is the process of finding the values of y corresponding to the any value of x between x0 and xn for the given values of y=f(x) for a set of values of x. Out of the many techniques of interpolation, Newton’s Forward and Backward Interpolation are two very widely used formulas.
In this tutorial, we’re going to discuss a C program for Newton Forward Interpolation along with its sample output.Both of Newton’s formulas are based on finite difference calculus. These formulas are very often used in engineering and related science fields. Before going through the source code for Newton Forward Interpolation, let’s go through the forward interpolation formula and the variables used in the C program.Newton’s forward interpolation formula contains y0 and the forward differences of y0. This is used for interpolating the values of y near the beginning of a set of tabulated values and extrapolation the values of y a little backward (i.e. To the left) of y0. The formula is given below:Compared to forward interpolation, the backward interpolation formula contains yn and the backward differences of yn. This formula is used for interpolating the values of y near the end of a set of tabulated values and also for extrapolating the values of y a little ahead (i.e.
To the right) of yn.Variables Used:. MAXN – the minimum value of N.
Gaussian Interpolation
ORDER – the maximum order in the difference table. ax – an array containing values of x.
Gauss Backward Interpolation In C Function
ay – an array containing values of y. diff – a 2D array containing the difference table. h – spacing between values of x. x – value of x at which the value of y is wanted. yp – calculated value of y. nr – numerator of the terms in expansion of y.p.
dr – denominator of the terms in expansion of y.pNewton Forward Interpolation in C.