How can I find the equation of a circle given two points and a tangent line through one of the points? I was wondering whether it was possible to find the equation of a circle given two points and the equation of a tangent line through one of the points so I produced the following problem:
Find the equation of the circle which passes through $(1,7)$ and $(-6,0)$ and has a tangent with equation $2x-9y+61=0$ at $(1,7)$
This seems like it should be solvable but I cannot work out how. Clearly, the line and the circle have one point of intersection so I tried finding the point of intersection between the line and the circle using the generic circle equation $(x-a)^2 + (y-b)^2 = r^2$, the equation of the line, and the discriminant of the resulting quadratic, which must be 0, but this still produces a quadratic with two unknowns.
I also feel like the fact that the perpendicular distance between centre $(a,b)$ and the line is the radius can be used somehow. Again, trying this seems to produce equations with too many unknowns.
How can I solve this problem?
 A: You can write a linear combination using the degenerate circle with centre $(1,7)$ and radius $r=0$ and the tangent which is like a degenerate circle with "infinite" radius
You get $(x-1)^2+(y-7)^2+k(2x-9y+61)=0$
Then plugging the coordinates of the other point $(-6;\;0)$ you have
$(-7)^2+(-7)^2+k(-12+61)=0$
solving for $k$ we get $k=-2$
the wanted circle has equation $(x-1)^2+(y-7)^2-2(2x-9y+61)=0$
$\color{red}{x^2+y^2-6 x+4 y-72=0}$
centre $(3;\;-2)$ and radius $r=\sqrt{3^2+2^2-(-72)}=\sqrt{85}$
A: This solution essentially follows M. Winter's solution algebraically rather than geometrically.
Plugging $(1,7)$ into $(x-a)^2 + (y-b)^2 = r^2$, we get 
$$  (1-a)^2 + (7-b)^2 = r^2  \text{.}  $$
In the same manner, $(-6,0)$ gives
$$  (-6 - a)^2 + b^2 = r^2  \text{.}  $$
Eliminating $r^2$ between these, multiplying out the binomials, then collecting the like powers of $a$ and $b$, these reduce to 
$$  a + b = 1  \text{,}  $$
the equation of the perpendicular bisector of the segment between the given points.
The slope of the given tangent line is $2/9$, so the slope of the line through the center of the circle and $(1,7)$ is $-9/2$.  The equation of this line is
$$ (b - 7) = (-9/2)(a - 1)  \text{.}  $$
These two lines intersect at the center of the circle.  Taking $b = 1-a$, plugging into this last equation, and solving for $a$, we get 
$$ a = 3  $$
and then 
$$ b = -2  \text{.}  $$
Putting these back into either of the first two displays gives 
$$  r^2 = 85  \text{.}  $$
So the equation you requested is
$$  (x - 3)^2 + (y + 2)^2 = 85  \text{.}  $$
A: Method I: Recognize that a point on a circle satisfies its equation
Let's use the formula
$$x^2+y^2+2gx+2fy+c=0\tag{i}$$
where $(-g,-f)$ is the center of the circle.
For points $A(x_1,y_1)$ and $B(x_2,y_2)$ to fall on the circle, it must be that $A$ and $B$ are solutions to $x^2+y^2+2gx+2fy+c=0$. Thus:
$$x_1^2+y_1^2+2gx_1+2fy_1+c=0\tag{ii}$$
$$x_2^2+y_2^2+2gx_2+2fy_2+c=0\tag{iii}$$
Given the equation of the line tangent to the circle, that is, $$ax+by+d=0\tag{iv}$$ we can solve for the distance between the line and the center:
$$r=\frac{|-ag-bf-d|}{\sqrt{a^2+b^2}}$$
Since $r=\sqrt{g^2+f^2-c}$, we can set these two equations equal to one another to get:
$$\sqrt{g^2+f^2-c}=\frac{|-ag-bf+d|}{\sqrt{a^2+b^2}}$$$$g^2+f^2-c=\frac{(-ag-bf+d)^2}{a^2+b^2}\tag{v}$$
Now we just need to solve the system of equations (ii), (iii), and (v).
In your case, $A(x_1,y_1)=(1,7)$, $B(x_2,y_2)=(-6,0)$, and in equation (iv), $a=2$, $b=-9$, and $d=61$. Substituting into the above equations we get:
$$1^2+7^2+2g(1)+2f(7)+c=0$$
$$2g+14f+50+c=0\\\\\tag{iia}$$
$$(-6)^2+0^2+2g(-6)+2f(0)+c=0$$
$$-12g+2f+36+c=0\\\\\tag{iiia}$$
$$g^2+f^2-c=\frac{(-2g+9f+61)^2}{2^2+(-9)^2}=\frac{(-2g+9f+61)^2}{85}\\\\\tag{va}$$
I will leave it as an exercise to the reader to solve for $c$, $f$, and $g$ using these equations. Once you have done so, you can substitute $(-g,-f)$ back into equation (i) to get the equation of your circle.
Method Ia: Same thing, new equation
This is very similar to Method I above, except that we use the equation
$$(x-h)^2+(y-k)^2=r^2\tag{i}$$
where $(h,k)$ is the center of the circle and $r$ is the radius.
As above, if points $A(x_1,y_1)$ and $B(x_2,y_2)$ are on the circle, $A$ and $B$ must satisfy the above equation. Therefore, we can write:
$$(x_1-h)^2+(y_1-k)^2=r^2\tag{ii}$$
$$(x_2-h)^2+(y_2-k)^2=r^2\tag{iii}$$
Given the equation of the line tangent to the circle, that is, $$ax+by+d=0\tag{iv}$$ we can solve for the distance between the line and the center:
$$r=\frac{|ax_1+by_1+d|}{\sqrt{a^2+b^2}}\tag{v}$$
As above, you can substitute $A(x_1,y_1)=(1,7)$, $B(x_2,y_2)=(-6,0)$, $a=2$, $b=-9$, and $d=61$ into equations (ii), (iii), and (v) to solve for $h$, $k$, and $r$, and then plug those values back into equation (i) to get the solution to your circle. In your particular case, however, this formula for $r$ happens to yield $0$; for that reason, although it's much messier, you may wish to stick with method I for this particular problem.
Method II: The center is equidistant from all points
The radius is perpendicular to the tangent line. It is known that for lines $\overleftrightarrow A$ and $\overleftrightarrow B$ to be perpendicular, then if the slope of $\overleftrightarrow A$ is $\frac{c}{d}$, the slope of $overleftrightarrow B$ will be $-\frac{d}{c}$ - its opposite reciprocal. Using the point-slope form, we can come up with an equation for the line for which the radius is a segment. Then, we can draw two circles whose centers are on the two points specified, and we can gradually expand their radii until they intersect on the line. The point of intersection is the center of the requested circle, and the radii of all three circles are congruent.
In your case: since the tangent line $2x+9y-61=0$ can be rewritten as $y=-\frac29x-\frac{61}9\tag{i}$, we can see that the tangent line has a slope of $-\frac29$; therefore, the radius has a slope of $\frac92$. Since we know it passes through the point $(1,7)$, we can use point-slope form and convert to slope-intercept to find the equation of the radius.
$$y-(7)=\frac92(x-(1))$$$$y=\frac92x+\frac52\tag{ii}$$
For the final step, in which we gradually expand the circles until they intersect on the line, I recommend Desmos, in which you can plug in the three equations as well as an $r=$ line, and by tweaking the $r=$ line you will simultaneously expand or contract both circles.
(Note that this is just a geometric illustration of Robert Z's answer, also posted in different words by Dr. Sonnhard Graubner.
Method III: Derivative is the slope of a tangent
In method II, we used the slope of the tangent to find the radius. Here, we will use the slope of the tangent to solve for the circle itself.
By implicit differentiation and a heavy dose of chain rule:
$$(x-h)^2+(y-k)^2=r^2\tag{i}$$
$$2(x-h)(1-0)+2(y-k)^2\left(\frac{dy}{dx}-0\right)=0$$
$$\frac{dy}{dx}=\frac{-2(x-h)}{2(y-k)}=\frac{-x+h}{y-k}\tag{ii}$$
Recall that a derivative is simply the slope of a curve at a given point. On a circle, this is equivalent to the slope of the tangent line. Recall also that for a point to fall on the circle it must satisfy the equation of the circle. We can thus substitute the slope of the tangent line for $\frac{dy}{dx}$ and the point of intersection for $(x,y)$ in equation (ii). We can also substitute the two points for $(x,y)$ in equation (i).
In your case: for $x=1$ and $y=7$, we can say that $\frac{dy}{dx}=-\frac29$.
$$-\frac29=\frac{-1+h}{7-k}\tag{iia}$$
We also said that $(1,7)$ and $(-6,0)$ are solutions to the circle.
$$(1-h)^2+(7-k)^2=r^2\tag{ia}$$
$$(-6-h)^2+(0-k)^2=r^2\tag{ib}$$
By solving the system of equations (ia), (ib), and (iia), we can solve for $h$, $k$, and $r$. Once you have those numbers, you can plug them back into equation (i) for the equation of the circle.
A: let $$A(1;7)$$ and $$B(-6;0)$$ then we have the equations
$$|MB|=|MA|=r$$ where $$M(x,y)$$ and since the tangentline is orthogonal to the radius, we have $$\frac{1-x}{7-y}=-\frac{9}{2}$$ this comes from our tangent line $$y=\frac{2}{9}x+\frac{61}{9}$$
A: Here is a geometric version, not using a single formula. Start with the points $A$ and $B$ and a line $\ell$ through $A$ (see the figure below).

Construct the perpendicular line to $\ell$ through $A$ (the $\color{red}{\text{red}}$ line). Construct the perpendicular bisectors between $A$ and $B$ (the $\color{green}{\text{green}}$ line, the green dot is the midpoint of $A$ and $B$). The intersection of both constructed lines is the circle's center. The readius is the distance of the center to $A$.
You can translate every step into a formula to solve it numerically if necessary.
A: Hint. The center of such circle is on the line which is orthogonal to tangent line and passes through the point of tangency. 
Therefore, in your case, the coordinate of the center is $C=(1+2t,7-9t)$ for some $t\in \mathbb{R}$. In order to find $t$, impose that $C$ has the same distance from the given points $P=(1,7)$ and $Q=(−6,0)$:
$$|CP|^2=|CQ|^2\Leftrightarrow (4+81)t^2=(7+2t)^2+(7-9t)^2.$$
