Let be the line passing through and perpendicular to line .

The slope of line is:

Then the slope of line is .

The equation of line is

The intersection point of the two lines is .

Then the distance between the point P0 and the line l is the distance between the points P0 and P1. Use the formula of distance between two points and you'll get the result you want to prove.