1 / 1

interpolacion2

Download Presentation

interpolacion2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. public class Interpola{ private static double D[][], xn[]; private static int orden; public static double newton(double x) { // cálculo del polinomio, se invoca las veces que una quiera double f = D[0][0]; double xterm = 1; for(int i = 1; i <= orden;i++) { xterm = xterm * (x - xn[i - 1]); f = f + D[0][i] * xterm; } return f; } public static void newton(double x[], double f[], int n) { // cálculo de las diferencias finitas, se invoca una vez: int i, j; D = new double[n + 1][n + 1]; xn = new double[n + 1]; orden = n; xn[0] = x[0]; for(i = 0; i <= orden;i++) { D[i][0] = f[i]; xn[i] = x[i]; } for(j = 1; j <= orden;j++) for(i = 0; i <= n - j;i++) D[i][j] = (D[i + 1][j - 1] - D[i][j - 1]) / (x[i + j] - x[i]); }}

More Related