TeX джерело:
d=\frac{\left|Ax_0+By_0+C\right |}{\sqrt{A^2+B^2}}.