A. Long way:
- Calculate the equation of the perpendicular line to the line L:
- Calculate the coordinates of the point of intersection of L and the normal to L:
- Calculate the distance
Let denote a point and a straight line then the distance d of P from L is calculated by:
With your problem: The line
Plug in the values of A, B, C and the coordinates of P and you'll get the same result.
I'll leave the second example for you.