Find the center of the circle given two tangent lines and one point of tangency

1.6k Views Asked by At

I'm attempting to find the center of the purple circle (and/or the radius) given the following information:

  • A point of tangency and the slope of the line (orange line)
  • A point on a line that is tangent to the circle and the slope of the line (green line)

I cannot solve this trigonometrically because it is possible for the tangent lines to be at any angle to each other (i.e. including parallel). Edit: just to clarify, the diagram below is not intended to show the exact values, just to illustrate the information that is available (i.e. one tangent line with a point definitely on the circle, and another tangent line with a known point not on the circle). The tangent lines could be intersecting or parallel.

My intuition says I can use the equation of a circle and plug in the fixed tangency point and the equation of the other line to get a set of two equivalent circle equations, but I seem to be stuck there, and this is a bit out of the limit of my skillset (apologies if I'm making basic errors here):

$$(6 - h)^2 + (4 - k)^2 = r^2 = (1x - h)^2 + (0y - k)^2$$

Which seems to me to be equivalent to:

$$(6 - h)^2 + (4 - k)^2 = (1x - h)^2 + (0y - k)^2$$

But I'm not totally sure where to go from there.

enter image description here

5

There are 5 best solutions below

1
On BEST ANSWER

The centers ($R$ and $S$ below) of the target circles lie on the parabola whose focus is the tangent point ($T$) and directrix is the "other" tangent line (through some point $U$).

enter image description here

As the figure shows, one readily determines that the corresponding radii ($r$ and $s$) satisfy $$r(1+\cos\theta) = d = s(1-\cos\theta) \quad\to\quad \{r,s\}=\frac{d}{1\pm\cos\theta}\tag{1}$$ where $d$ is the focus-directrix distance (ie, the distance from the tangent point to the "other" tangent line) and $\theta$ is the angle between direction vectors of the two lines (equivalently, between normal vectors).

Now, if $t$ and $u$ are the unit normal vectors to the tangent lines through $T$ and $U$, then we can write $$d = |(U-T)\cdot u| \qquad \cos\theta = t\cdot u \tag2$$ so that $$\{R,S\} = T \pm_1 \frac{|(U-T)\cdot u|}{1\pm t\cdot u} \;t \tag3$$ where $\pm_1$ is a hedge on my part in case of a sign error due to reversing a vector somewhere. Barring an error, you "should" be able to leverage the signed distance $d$ to write $$\{R,S\} = T \pm \frac{(U-T)\cdot u}{1\pm t\cdot u}\;t \tag4$$ where the two $\pm$s match.

(Sanity check: Changing the direction of $t$ effectively reverses each $\pm$, so that's consistent. Likewise for $u$. So the only question is whether I should've written $T-U$ instead of $U-T$, but I believe my GeoGebra sketch bears me out on that one.)

Note that, if the lines are parallel, then $t\cdot u = \pm 1$ (with the sign depending upon how the normals are chosen), so that one of the centers $R$, $S$ lies halfway between the lines, and the other shoots off to infinity, as expected. $\square$

5
On

Given:

$\text{Point of tangency on}\color{orange}{\text{ Orange Line: }}(X_1,Y_1)\\ \text{Slope of}\color{orange}{\text{ Orange Line: }}m_1\\ \text{Point on}\color{green}{\text{ Green Line: }}(X_2,Y_2)\\ \text{Slope of}\color{green}{\text{ Green Line: }}m_2$


Deductions:

$\text{Equation of }\color{orange}{\text{Orange Line }} l_1:\mathbf r=(X_1,Y_1)+k(1,m_1)\\ \text{Equation of normal to }\color{orange}{\text{Orange Line }} l_2:\mathbf r=(X_1,Y_1)+k\left(\frac{-m_1}{\sqrt{1+m_1^2}},\frac1{\sqrt{1+m_1^2}}\right)\\ \text{Equation of }\color{green}{\text{Green Line }} l_3:m_2(x-X_2)-(y-Y_2)=0$


The centre of the circle lies on $l_2$, so assume it has the position vector $(X_1,Y_1)+r\left(\frac{-m_1}{\sqrt{1+m_1^2}},\frac1{\sqrt{1+m_1^2}}\right)$. Its distance from $(X_1,Y_1)$ and $l_2$ is $|r|$. We require that its distance from tangent line $l_3$ also be $|r|$, i.e.$$|r|=\left|m_2\left(X_1-X_2-\frac{rm_1}{\sqrt{1+m_1^2}}\right)+\left(Y_2-Y_1-\frac r{\sqrt{1+m_1^2}}\right)\right|$$ and if my calculations are correct, this reduces to the explicit expression for $r$ given below:$$r=\frac{m_2(X_1-X_2)-(Y_1-Y_2)}{\frac{1+m_1m_2}{\sqrt{1+m_1^2}}\pm1}$$ All you need to do is find $r$: $|r|$ would be the radius of the circle. Plug it into the position vector of the centre.

0
On

Convert the equations of the two lines to the form \begin{align} ax + by &= c, \tag1\\ px + qy &= r \tag2 \end{align} where $a^2 + b^2 = p^2 + q^2 = 1.$ In this form the left hand side of the equation gives the distance of the point $(x,y)$ from a line through the origin parallel to the given line.

Now consider these two equations: \begin{align} (a + p)x + (b + q)y &= c + r, \tag3\\ (a - p)x + (b - q)y &= c - r, \tag4 \end{align} which are formed from the sum or difference of equations $(1)$ and $(2)$. If the lines in equations $(1)$ and $(2)$ intersect, then equations $(3)$ and $(4)$ are the equations of the two angle bisectors of lines $(1)$ and $(2)$; but if lines $(1)$ and $(2)$ are parallel then one of the equations $(3)$ or $(4)$ is the equation of the line midway between lines $(1)$ and $(2)$ and the remaining equation is unsolvable. (In the parallel case, one of the second pair of equations is of the form $0x + 0y = k$.)

Suppose the given point of tangency is on line $(1)$. Find the line through the point of tangency perpendicular to line $(1)$, and find the intersections of that line with lines $(3)$ and $(4)$. (In the parallel case, just find the intersection with whichever of the lines $(3)$ or $(4)$ exists.) The intersections that you find in this last step are the centers of the circles that solve the problem--and indeed if the original two lines are not parallel, there are two circles, one on each side of the line with the given point of tangency.

You can handle the "practically parallel" case (where the numeric values of the equations are so close that it you cannot tell whether they are actually parallel within the precision of your computations) by discarding any "bisector" line whose coefficients are too small.

0
On

We can solve this in the general case, and then you should be able to plug in your specific values (or even write a function in the programming language of your choice to do it for you).

First, I'm going to cheat by making a couple of assumptions that I know are not guaranteed to be true, namely:

  1. The two tangent lines are reflections of each other in the $x$ axis, so their gradients are a factor of -1 from each other;
  2. The point of intersection of the lines is the origin;
  3. The circle is sitting to the right of the lines; and
  4. The known tangent point is the one sitting above the circle.

So it looks something like this:

A sketch of the system as described, including equations for the two tangent lines and coordinates for the known tangent point.

It should be clear that the centre of the circle will lie on the $x$-axis, so we just have to draw a perpendicular to the top tangent line and find out where it intersects that axis. The gradient of that perpendicular will be $-\frac{1}{m}$ and hence its equation will be

$$\begin{eqnarray}y - y_Q & = & -\frac{1}{m}(x - x_Q) \\ y - m x_Q & = & -\frac{1}{m} x + \frac{1}{m} x_Q \\ y & = & -\frac{1}{m} x + \left( 1 + \frac{1}{m} \right) x_Q\end{eqnarray}$$

and solving for $y_C = 0$ gives $x_C = (m + 1) x_Q$.

So then finding the radius is as simple as finding the distance between $C$ and $Q$, which is just

$$\begin{eqnarray} r & = & \sqrt{(x_Q - x_C)^2 + (y_Q - y_C)^2} \\ & = & \sqrt{(x_Q - (m + 1) x_Q)^2 + (m x_Q - 0)^2} \\ & = & x_Q \sqrt{m^2 + m^2} \\ & = & x_Q m \sqrt{2} \end{eqnarray}$$

Which is all well and good, but what about all those assumptions we made? Well, as long as the lines aren't parallel (in which case you just find the perpendicular distance between them and halve it) we can transform our coordinates in a way that preserves all the distances but satisfies those assumptions. Here's how to make those adjustments:

  • If the known tangent point is below the circle, we can flip the tangent lines by swapping the signs of their gradients, and in fact we can just write $r = |x_Q m \sqrt{2}|$ and it's fine.

  • To rotate the co-ordinate system about the origin by the angle $\theta$, apply the transformation:

$$\begin{bmatrix} x' \\ y' \end{bmatrix} = \begin{bmatrix} \cos \theta & \sin \theta \\ -\sin \theta & \cos \theta \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} x \cos \theta - y \sin \theta \\ x \sin \theta + y \cos \theta \end{bmatrix}$$

where the angle you'll need to apply is the one that achieves assumptions 1 and 3, noting that a line of gradient $m$ going through the origin makes an angle $theta$ with the positive $x$-axis where $m = \tan \theta$, so you should be able to find a suitable angle that will adjust the two lines to the right position.

  • To translate the coordinates so that the intersection is at the origin, you can find the intersection point by solving the pair of equations $(y_0 - y_i) = m_i(x_0 - x_i)$ for $(x_0, y_0)$ based on the known points and gradients, then performing the transformation $(x', y') = (x - x_0, y - y_0)$$.

You can work all of that into the necessary algebra by working backwards, and then solve for the required $r$.

Caution: There are, in fact, two circles! In this method, the second solution will be found by putting an extra $90^{\circ}$ into the rotation transformation, which mixes the signs of a few things up and acts similarly to the other answers here that give you quadratic equations for $r$.

0
On

In yet another approach, we can keep the calculations at the level of systems of two linear equations, except for the place where we locate the "equidistant tangent point." We will call line $ \ L_1 \ $ the line of slope $ \ m_1 \ $ containing the known tangent point $ \ (a,b) \ $ and line $ \ L_2 \ $ the line of slope $ \ m_2 \ $ containing the point $ \ (c,d) \ $ not on the circle; the second tangent point, which we will call $ \ (t,u) \ , $ lies on $ \ L_2 \ \ . $

Your concern about whether there would be enough equations to solve for all of the variables is a reasonable consideration, but will not be an issue, since it is possible to find such the circle in question entirely by ruler-and-straightedge construction. The problem is sufficiently well-defined to permit solution.

The "parallel tangent lines" case is the easy one as the slopes are $ \ m_1 = m_2 = m \ \ . $ The second tangent point is the intersection of line $ \ L_2 \ $ with the line perpendicular to $ \ L_1 \ $ through $ \ (a,b) \ \ . $ So we have

$$ u - b \ = \ -\frac{1}{m} · (t-a) \ \ , \ \ u - d \ = \ m · (t- c) \ \ \rightarrow \ \ \begin{array}{cc} -mu & + \ \ mb & = \ \ t \ - \ a \\ u & - \ \ d & = \ \ mt \ - \ mc \end{array} \ \ , $$

which you may solve for $ \ t \ $ and $ \ u \ $ by your preferred linear-equations method. (If the tangent lines are horizontal or vertical, one will not be able to make use of $ \ m \ $ , but the calculation becomes even simpler, since the second tangent point and the center of the circle will share one coordinate with the known tangent point. This is also applicable in the general case if one of the tangent lines is horizontal or vertical.)

The center $ \ (h,k) \ $ of the circle is then found from $ \ h \ = \ \frac{a + t}{2} \ , \ k \ = \ \frac{b + u}{2} \ \ $ and the radius of the circle is given by $ \ 2r \ = \ \sqrt{(a-t)^2 \ + \ (b-u)^2} \ \ . $

The general case requires the additional work of finding the intersection point $ \ (p,q) \ $ of $ \ L_1 \ $ and $ \ L_2 \ $ . Using their line equations, we obtain $$ q - b \ = \ m_1 · (p-a) \ \ , \ \ q - d \ = \ m_2 · (p- c) \ \ \rightarrow \ \ \begin{array}{cc} q & - \ \ b & = \ \ m_1p \ - \ \ m_1a \\ q & - \ \ d & = \ \ m_2p \ - \ m_2c \end{array} \ \ , $$

solving this pair for the coordinates of the intersection. As the two tangent points are equally distant from $ \ (p,q) \ \ , $ we can write

$$ (a - p)^2 \ + \ (b - q)^2 \ \ = \ \ (t - p)^2 \ + \ (u - q)^2 \ \ , $$

the left side of which has a known numerical value. Now this equation looks like it presents a difficulty, since it has both unknown coordinates of the second tangent point. But because we "know" two points on $ \ L_2 \ , $ we may express its slope as $ \ m_2 \ = \ \frac{u \ - \ q}{t \ - \ p} \ \ ; $ inserting this into our "distance equation" produces $$ (a - p)^2 \ + \ (b - q)^2 \ \ = \ \ [ m^2_2 \ + \ 1 ] · (t - p)^2 \ \ , $$ from which we may then determine $ \ t \ $ and consequently $ \ u \ \ . $ [Note that this is the one quadratic equation we encounter in this argument. There are in fact two solutions, as observed in the other posted answers: the "other circle" has its second tangent point on $ \ L_2 \ $ but beyond the intersection point $ \ (p,q) \ \ . $ When the two tangent lines are parallel, this tangent point has "retreated" infinitely far from the "near circle", with this circle's radius "exploding" to an infinite value; thus, this second circle "disappears" from the solution.]

Finally, with the tangent point $ \ (t,u) \ $ located, we can extend perpendiculars from $ \ L_1 \ $ and $ \ L_2 \ $ at the appropriate tangent points, with the center of the circle being the intersection of these lines. We thus solve for $ \ (h,k) \ $ in the system

$$ k - b \ = \ -\frac{1}{m_1} · (h-a) \ \ , \ \ k - u \ = \ -\frac{1}{m_2} · (h- t) \ \ \rightarrow \ \ \begin{array}{cc} -m_1k & + \ \ m_1b & = \ \ h \ - \ \ a \\ -m_2k & + \ \ m_2u & = \ \ h \ - \ t \end{array} \ \ . $$

The radius of the circle(s) can now be obtained from either $$ \ r \ = \ \sqrt{(a-h)^2 \ + \ (b-k)^2} \ \ \ \text{or} \ \ \ \sqrt{(t-h)^2 \ + \ (u-k)^2} . $$