TITLE: Why two formulas for a in a linear function are equal
QUESTION [6 upvotes]: Sorry if this is an easy question for some, but I have tried and failed for a while now, so I need someone else to help me. 
I want to figure out why $$a=\frac{f(x)-b}{x_1}$$ is equal to $$a=\frac{y_2-y_1}{x_2-x_1}$$
For example in a task where you know to points in a linear graph, you use the second formula to find $a$.
$$A: (2, 10)\\
B: (8, 130)$$
Then $a=20$.
But why is the flipped version of $f(x)=ax+b$ equal to the direct formula $a=\frac{y_2-y_1}{x_2-x_1}$? Are they even the same? What I mean is that can the two formulas be flipped/multiplied and stuff like that to be the same?

REPLY [7 votes]: What is meant by all this is that if You consider an affine-linear function ( actually just the first part $x\mapsto ax$ is linear but by abuse of language one calls the affine function $f$ linear too):
$$f(x)=ax+b$$
You can compute $a$ by computing for any $x_0\neq 0$:
$$a=\frac{f(x_0)-b}{x_0}$$.
On the other hand You know that given two points $A(x_1|y_1)$ and $B(x_2|y_2)$ and $x_1\neq x_2$ there is exactly one affine-linear function $f$ thats graph passes through these points and since the slope of an affine-linear function is everywhere the same You can compute it by the difference-quotient:
$$a=\frac{y_2-y_1}{x_2-x_1}.$$
And if the above function $f$ is this one affine-linear function that has a graph passing through $A$ and $B$ then of course You have:
$$\frac{y_2-y_1}{x_2-x_1}=\frac{f(x_0)-b}{x_0}$$
for any $x_0\neq 0.$