/* From: "COMPUTATIONAL PHYSICS, 2nd Ed" by RH Landau, MJ Paez, and CC Bordeianu Copyright Wiley-VCH, 2007. Electronic Materials copyright: R Landau, Oregon State Univ, 2007; MJ Paez, Univ Antioquia, 2007; & CC Bordeianu, Univ Bucharest, 2007 Support by National Science Foundation */ // Fit.java: Least square fit to tabulated data public class fit { static int data = 12; // Number of data points public static void main(String[] argv) { int i, j; double s, sx, sy, sxx, sxy, delta, inter, slope; double x[] = new double[data]; double y[] = new double[data]; double d[] = new double[data]; // Input data x for (i = 0; i