The formula you need is
d = (Ax0 + By0 + C)/sqrt(A2 + B2),
where the equation of the line is Ax + By + C =0 and the point is (x0,y0).
You may need to take the absolute value of the answer...although the sign of the answer has something to do with the side of the line on which the point lies.