point to straight line distance calculation

straight line: X +  Y = 
point:  , 
distance

the length of a perpendicular segment from a point outside a straight line to the straight line is called the distance from the point to the straight line.

suppose the equation of straight line l is ax+by+c=0, and the coordinates of point p are (xo, yo), then the distance from point p to straight line l is: d=│axo+byo+c│/√(a²+b² ).