Lines tangent to two circles

I'm trying to find the lines tangent to two circles. I've seen several examples but with poorlyy explained methods. Given the circle

$(x-x_{0})^2+(y-y_{0})^2=r_{1}^2$

and the the line equation

$y=ax+b$

one of the method is based on the relation

$(ax_{0}+b-y_{0})^2=(a^2+1)r_{1}^{2}$

Can you tell me what relation is this? How it was obtained? Thank you.

migrated from mathematica.stackexchange.comJun 13 '16 at 0:56

This question came from our site for users of Wolfram Mathematica.

• I'm voting to close this question as off-topic because of no mathematica related content – george Jun 12 '16 at 23:46
• As posed this seems more a question about the math than about Mathematica, so it may not be appropriate for this forum. Even then, you may want to clarify your question: what is the exact relationship between the line and the two circles? As posed, there are infinite lines that are tangent to two arbitrary circles, so the problem seems underdetermined. – MarcoB Jun 12 '16 at 23:47
• Let $C: (x-x_{0})^2+(y-y_{0})^2=r_{1}^2$ and $L: y=ax+b$. Putting L into C, we get a new quadratic equation in x. Since L is tangent to C, the discriminant of it should be equal to 0. I think, after simplification, we should get the mentioned expression, which is then the condition for tangency. – Mick Jun 13 '16 at 4:10