do you know what the distance from the point $(x_p,y_p)$ to the point $(a,b)$ is?
do you know what the distance from the point $(x_p,y_p)$ to the line $y=mx+c$ is?