Question: IN C LANGUAGE! Create a program that interpolate a polynomial using lagrange interpolation by satisfying all these requirement: a.Using function: double lagrange (double x_int[ ],
IN C LANGUAGE!
Create a program that interpolate a polynomial using lagrange interpolation by satisfying all these requirement:
a.Using function:
double lagrange(double x_int[ ], double y_int[ ], int n, double x) which calculates the value of the n-th order lagranges polynomial Pn(x) defined for the set of nodes
, for a given value of x.
b. Create an input file interpolation_data.ini on the disk containing :
5 // order of P n (x)
0.0 1.0 // x_int(0) , y_int(0)
1.0 3.0
3.0 -2.0
5.0 -5.0
8.0 -1.0
10.0 2.0 // x_int(n) , y_int(n)
c. In the main function, write the following actions:
? It opens and reads the file interpolation_data.ini
? It calculates the interpolation polynomial
at 101 equally spaced points in the closed interval [x(0),x(n)].
? It opens and writes the output disk file interpolation_results.dat in the following manner:


![interpolation by satisfying all these requirement: a.Using function: double lagrange(double x_int[ ],](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/12/675071c40c7ec_251675071c3abed0.jpg)
......................................

(0), y (0), n), y(n) (0), y (0), n), y(n)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
