In a two dimensional case, the form of the linear function can be obtained if we know the coordinates of two points on the straight line. Suppose x' and x" are two given values and the corresponding y values are y' and y" .
Then the slope of the line is:
m

= 

The intercept is
a

= 

In the n dimensional case, we need the coordinates of at least n points for finding the linear functional form.
Example
Find the line relating Sales (Y) to Advertizing Expenditure (X) if
X: 20 23 26 29
Y: 160 172 184 196
If we assume that the 4 points (20, 160), (23, 172), (26, 184) and (29, 196) will fall on a straight line, then we may compute 'a' and 'm' using any pair of points.
m = (172  160)/(23  20) = 4,
a = 160  (4 x 20) = 80 and
y = 80 + 4x
One may verify that all 4 points fall on the line.
For example, consider the point (29, 196)
80 + (4 x 29) = 196