<Dl> <Dd> d = (x 0 − m) 2 + (y 0 − n) 2 = a x 0 + b y 0 + c a 2 + b 2 . (\ displaystyle d = (\ sqrt ((x_ (0) - m) ^ (2) + (y_ (0) - n) ^ (2))) = (\ frac (ax_ (0) + by_ (0) + c) (\ sqrt (a ^ (2) + b ^ (2)))).) </Dd> </Dl> <Dd> d = (x 0 − m) 2 + (y 0 − n) 2 = a x 0 + b y 0 + c a 2 + b 2 . (\ displaystyle d = (\ sqrt ((x_ (0) - m) ^ (2) + (y_ (0) - n) ^ (2))) = (\ frac (ax_ (0) + by_ (0) + c) (\ sqrt (a ^ (2) + b ^ (2)))).) </Dd> <P> This proof is valid only if the line is not horizontal or vertical . </P> <P> Drop a perpendicular from the point P with coordinates (x, y) to the line with equation Ax + By + C = 0 . Label the foot of the perpendicular R. Draw the vertical line through P and label its intersection with the given line S. At any point T on the line, draw a right triangle TVU whose sides are horizontal and vertical line segments with hypotenuse TU on the given line and horizontal side of length B (see diagram). The vertical side of ∆ TVU will have length A since the line has slope - A / B . </P>

How to calculate distance from point to line