Let $\mathcal{H}\colon\mathbf{w}\cdot\mathbf{x}+b=0$ be a hyperplane in $\Bbb{R}^n$, then
$$
d = \frac{\mathbf{w}\cdot\mathbf{x}_0+b}{\lVert\mathbf{w}\rVert}
$$
gives the signed distance (with respect to the normal vector) between a point $\mathbf{x}_0$ and the hyperplane. $\lvert d \rvert$ gives the "traditional" distance.
The signed distance takes into consideration in which halfspace the point lies.
For instance, if you have your line in the form $Ax+By+c=0$, then $\mathbf{w}=(A, B)^\top$, $b=c$, and the signed distance is
$$
d = \frac{Ax+By+c}{\sqrt{A^2+B^2}}.
$$