If the line is tangent, the solution to the system of equations has a single solution.
(x-a)^2 + (y-b)^2 = r^2
(x-a)^2 + (mx+c-b)^2 = r^2
x^2 - 2ax + a^2 + m^2x^2 + 2m(c-b)x + (c-b)^2 = r^2
(m^2+1)x^2 + (2mc-2mb-2a)x + a^2+(c-b)^2-r^2 = 0
To have a single solution, the discriminant must be zero. So, you need
(2mc-2mb-2a)^2 - 4(m^2+1)(a^2+(c-b)^2-r^2) = 0
double-check my math before you try to simplify that monster!
Given that the line y=mx+c is a tangent to the circle
(x-a)^2+(y-b)^2 = r^2
show that:
(1-m^2)r^2=(c-b+ma)^2
2 answers
Or, try this way. The tangent line must be perpendicular to the radius which meets it. Also, the distance from the center to the line must be r. Since the center of the circle is at (a,b), if it touches the line at (h,k), we have
m = (a-h)/(mh+c-b)
That must have a single solution, so its discriminant is zero. So,
(c-b)^2 - 4h(b-a) = 0
The distance must equal the radius, so
(h-a)^2 + (mh+c-b)^2 = r^2
Try solving those two equations.
Or google your question. I found several explanations, starting with this one:
https://answers.yahoo.com/question/index?qid=20130528073141AATqi4D
m = (a-h)/(mh+c-b)
That must have a single solution, so its discriminant is zero. So,
(c-b)^2 - 4h(b-a) = 0
The distance must equal the radius, so
(h-a)^2 + (mh+c-b)^2 = r^2
Try solving those two equations.
Or google your question. I found several explanations, starting with this one:
https://answers.yahoo.com/question/index?qid=20130528073141AATqi4D