/* 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.c: Least square fit #include #include #define data 12 // number of data points main() { int i, j; double s, sx, sy, sxx, sxy, delta, inter, slope; double x[data], y[data], d[data]; // input data for (i = 0; i