LagrangeAlgorithm.txt Given n points (X_0), Y_0) ... (X_n, Y_n) We consider this a tabulation of function values Y_i = f(X_i) X_i < X_i+1 Compute coefficients C_i i=0..r such that the function g(X) = C_n X^n + C_n-1 X^n-1 + ... + C_1 X + C_0 all Y_i-g(X_i) =0, is a Lagrange Fit of the points. Algorithm: Find g(X) = sum k=0 to n f(X) L_n,k(x) for discrete points Find g(X) = sum k=0 to n Y_k L_n,k(X) Collect C_i from sum of polynomials L_n,k(X) is nth Lagrange Polynomial at point k. L_n,k(X) = product i=0 to n (X - X_i)/(X_k - X_i) See "Evaluate" and "Integrate" for the uses of the coefficients.