Public class Interpola
Download
1 / 1

interpolacion2 - PowerPoint PPT Presentation


  • 45 Views
  • Uploaded on

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'interpolacion2' - britanni-kinney


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Interpolacion2

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]); }}


ad