In Lagrange interpolation in C language, x and y are defined as arrays so that a number of data can be stored under a single variable name. Then, values of x and corresponding y are asked.As the program is executed, it first asks for number of known data.In the code, interpolation is done by following the steps given below: The source code given below in C program for Lagrange interpolation is for interpolating data in which augments are unequally spaced or in cases where it is not possible to fit the curve of given data. In such case, Lagrange interpolation is one of the best options. But, all these methods fail when the spacing of ‘x’ is unequal. In case of equally spaced ‘x’ values, a number of interpolation methods are available such as the Newton’s forward and backward interpolation, Gauss’s forward and backward interpolation, Bessel’s formula, Laplace-Everett’s formula etc. For the given data, (say ‘y’ at various ‘x’ in tabulated form), the ‘y’ value corresponding to ‘x’ values can be found by interpolation. Interpolation is the process of estimation of an unknown data by analyzing the given reference data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |