Start off by finding the slope "m1" of your line. If you draw a line tangent to the circle and parallel to this line you will notice that the radius that intersects the tangent line has
theta2 = theta1 + Pi/2 or Pi
depending on what side of the circle you are on.
theta1 = arctan (m1)
Since you now know the angle of the radus that intersects the tangent, find the x and y locations of the intersection point. The equation of your circle is:
x = r*cos(theta2) + h
y = r*sin(theta2) + k
where:
h is your x offset from the origin
k is your y offset from the origin
substitue for theta and you get
x = r*cos(arctan (m1)+ Pi or Pi/2) + h
y = r*sin(arctan (m1)+ Pi or Pi/2) + k
this is one point on your line. Your slope is tan(theta1) or the same thing as you
r original line. Solve for b and you have your equation.
-Jim Kring