yeah for 2D:
line: Ax + By + C = 0
Point: (x1, y1)
[saving you the gory details]
Code:
|Ax1 + By1 + C|
distance between point and line: D = -----------------
square root (A^2 + B^2)
notation: | | is absoute value, ^2 is raised to power 2
For 3D, it takes a little more...
Slick.