# How to calculate the approximate gradient of a series of points?

The situation is this: a series of points are randomly located, a line is needed to represent the gradient of those points.

  ./
/  .


. / ./ / .

I am a programmer but not math expert, I need the method to find such a line. Can anyone give me some direction?

-

There is a technique called "least squares linear fit." Those keywords should help you find a discussion in a textbook or on the web.

-
Cool, this looks like what I need, thanks a lot! – Truman's world Jan 28 '13 at 13:25
You have the option of "accepting" the answer, by clicking in the check mark next to it. – Gerry Myerson Jan 28 '13 at 22:30