# Line with predefined length tangent to circle

I have one math problem which I'm trying to solve. I know it could be done but I'm a little bit "rusty" with my algebra. I'm kindly asking for help.

Problem and procedure of my solution are shown in attached image. I'm trying to find general solution for line equation (points $1$ and $2$ lie on this line) which is tangent to circle with radius $R$ and center point in $(0,a)$. Length $L$ of line from point $1$ to point $2$ is also known.

Basically I'm searching for coordinates of points $1$ and $2$ with $y_2=0$. I think that for $L>a$ there should be 4 possible solutions. I'm only interested in one which has $x_1>0$ and $x_2>0$.

I have $4$ equations, which should be enough for solving this system, but it gets complicated. Maybe someone has some pointers or is there an easier way to do it? ## 1 Answer

Here's a partial answer: recall that a tangent to a circle at $T$ from an external point $P$ is perpendicular to the radius at $T$. So using the Pythagorean Theorem, \begin{equation*} R^2+L^2 = d((x_2,0),(0,a))^2 = x_2^2 + a^2, \end{equation*} so that since you want $x_2>0$ we get $x_2 = \sqrt{R^2+L^2-a^2}$.

Note that while there are four solutions, there are only two possible values of $x_2$, since the two tangents from any external point to a circle have equal lengths.

Next, solve $x_1^2 + (y_1-a)^2 = r^2$ for $y_1$, giving $y_1 = a\pm\sqrt{r^2-x_1^2}$; again take the positive square root. Using the equation for the length of the tangent, we get \begin{equation*} (x_1-\sqrt{l^2+r^2-a^2})^2 + (a+\sqrt{r^2-x_1^2})^2 = l^2, \end{equation*} or \begin{equation*} (r^2+l^2)x_1^2 - 2r^2\sqrt{l^2+r^2-a^2}\,x_1 + r^4 - a^2r^2 = 0. \end{equation*} Solving the quadratic for $x_1$ gives \begin{equation*} x_1 = \frac{arl+r^2\sqrt{l^2+r^2-a^2}}{l^2+r^2}. \end{equation*} I don't see a simple way yet to derive $y_1$ from this, but the answer is \begin{equation*} y_1 = \frac{l}{r}x_1 = \frac{l(al+r\sqrt{l^2+r^2-a^2})}{l^2+r^2}. \end{equation*}

• This is exactly what I was looking for. Good hints. Thanks! I'm just lost at the moment how you got from: \begin{equation*} (x_1-\sqrt{l^2+r^2-a^2})^2 + (a+\sqrt{r^2-x_1^2})^2 = l^2, \end{equation*} to \begin{equation*} (r^2+l^2)x_1^2 - 2r^2\sqrt{l^2+r^2-a^2}\,x_1 + r^4 - a^2r^2 = 0. \end{equation*} I will have to look into it more accurately. – Grega Feb 18 '15 at 7:46
• I got it. I just had to revise my algebra a little bit. Thanks again. – Grega Feb 18 '15 at 10:14
• I think the last one should be:\begin{equation*} y_1 = \frac{l}{r}x_1 = \frac{al^2+rl\sqrt{l^2+r^2-a^2}}{l^2+r^2}. \end{equation*} – Grega Feb 18 '15 at 11:38
• @Grega You are right about the last one, thanks. – rogerl Feb 18 '15 at 14:53
• @Grega It sounds like you figured out the other question (the one you posed in your first comment). If not, ask again. – rogerl Feb 18 '15 at 14:54