D= y - a + bx + cx^2 + dx^3 + ex^4 + fx^5 +..

where you have guessed the coefficients abcd..

This would give a 'distance', D, from the line for each point; add the absolute values of these together to get a score for the set of guessed coefficients. you then guess different sets of coefficients until you minimise D - such that the points are as close to the line as you can get.

I think Excel has a function that does it, you will get better results with more powers in the equation, because, I believe, you can always fit n points exactly to a nth - order polynomial.

further reading:

http://en.wikipedia.org/wiki/Curve_fitting

http://zunzun.com/