Exact Fit:
Polynomial Fitting
Polynomial fitting gives one variable as a function of another. If n is the degree of the polynomial then n + 1 data points are needed to find the equation.
Linear Equation (First Degree Polynomial)
y = f (x) = a0 + a1 x
i.e., y0 = a0 + a1 x0 and y1 = a0 + a1 x1
Therefore a0 and a1 values can be obtained by using 2 data points. If the two data points are P1 (x1 y1) and P2 (x2 y2).
a0 = (x1 y2 + y1 x2 )/(x2-x1 ) ; a = ( y2 - y1 )/ (x2 - x1)
Quadratic Equation (Second Degree)
y = a0 + a1 x + a2 x2.
The same in the matrix form is
The result of this set of three simultaneous equations shall yield values of a0, a1 and a2.