MathorynMathematical Formula Database

Analytic Geometry

Distance from a Point to a Line

The shortest (perpendicular) distance from the point (x0,y0)(x_0,y_0) to the line Ax+By+C=0Ax+By+C=0. It is used in geometry problems, in computer graphics and to find the radius of a circle tangent to a line.

d=∣Ax0+By0+C∣A2+B2d=\frac{|Ax_0+By_0+C|}{\sqrt{A^2+B^2}}
LaTeXd=\frac{|Ax_0+By_0+C|}{\sqrt{A^2+B^2}}

Variables

A, B, CA,\ B,\ C
coefficients of the line (A, B not both 0)
(x0,y0)(x_0,y_0)
the point

Example

Distance from (5,5)(5,5) to 3x+4y−10=03x+4y-10=0.

  1. ∣15+20−10∣9+16=255\frac{|15+20-10|}{\sqrt{9+16}}=\frac{25}{5}.

Answer: d=5d=5.

Related formulas