The distance from the point $P(x_0,y_0)$ to the line $Ax+By+C=0$ is $$d=\dfrac{|Ax_0 + By_0 + C|}{\sqrt{A^2+B^2}}$$