Math Help - slope formula for est. regression equatios

1. slope formula for est. regression equatios

How is this formula derived

slope= $\frac{\sum(x_{i}-x_{0})(y_{i}-y_{0})}{\sum(x_{i}-x_{0})^2}$

This seems to give me the average ratio of the slope
$\frac{\sum(y_{i}-y_{0})}{\sum(x_{i}-x_{0})}$

I know this is one, but why is it needed?

$\frac{\sum(x_{i}-x_{0})}{\sum(x_{i}-x_{0})}$

2. The $x_0$ should be $\bar x$
and then I really don't understand the second part because

$\sum_{k=1}^n (x_k - \bar x)=0$, as well as with the y's.

3. I'm sorry it should be $\frac{x_i-x_o}{x_i-x_o}$.
As far as the x with the bar over it, I just don't know the Latex command for that, so I subbed in the o figuring everyone would understand. I still amm unclear why it is needed. The second part is just a factor I pulled out of the slope equation from above.