//example of least squares curve fitting //example data //x = { -3, -2, 0, 3, 4 } //y = { 18, 10, 2, 2, 5 } public class leastsqs { public static void main ( String args[] ) { //raw data int values = 5; int x[] = { -3, -2, 0, 3, 4 }; int y[] = { 18, 10, 2, 2, 5 }; System.out.println (); System.out.println ( "Raw data " ); System.out.println ( "x = -3, -2, 0, 3, 4 " ); System.out.println ( "y = 18, 10, 2, 2, 5 " ); //substitue data into equations System.out.println(); System.out.println ( "Substituting values into equation ax^2 + bx + c = y " ); for ( int i=0; i