If $M(x_2,y_2)$ is the foot of a perpendicular drawn from $P(x_1,y_1)$ on the line $ax+by+c=0$, then $$\frac{x_2-x_1}{a}=\frac{y_2-y_1}{b}=\frac{-(ax_1+by_1+c)}{a^2+b^2}.$$
This is given as a formula in my module without any explanation. I can understand the first equality since the product of the slopes of two perpendicular lines is $-1$. But I cannot understand what $\large\frac{-(ax_1+by_1+c)}{a^2+b^2}$ means and how the last equality holds. Please explain.