<P> In the case of a line in the plane given by the equation ax + by + c = 0, where a, b and c are real constants with a and b not both zero, the distance from the line to a point (x, y) is </P> <Dl> <Dd> distance ⁡ (a x + b y + c = 0, (x 0, y 0)) = a x 0 + b y 0 + c a 2 + b 2 . (\ displaystyle \ operatorname (distance) (ax + by + c = 0, (x_ (0), y_ (0))) = (\ frac (ax_ (0) + by_ (0) + c) (\ sqrt (a ^ (2) + b ^ (2)))).) </Dd> </Dl> <Dd> distance ⁡ (a x + b y + c = 0, (x 0, y 0)) = a x 0 + b y 0 + c a 2 + b 2 . (\ displaystyle \ operatorname (distance) (ax + by + c = 0, (x_ (0), y_ (0))) = (\ frac (ax_ (0) + by_ (0) + c) (\ sqrt (a ^ (2) + b ^ (2)))).) </Dd> <P> The point on this line which is closest to (x, y) has coordinates: </P>

How to find the distance of a point to a line