The distance from the point P to the line l is the shortest distance between P and a point on l. It is equal to |PN|, where N is the point on l such that the line PN is perpendicular to l. If P has coordinates (x1,y1) and l has equation ax + by + c = 0, then the distance from P to l is equal to
where |ax1 + by1 + c| is the absolute value of ax1 + by1 + c.