Circle passing through two points and tangent to a line

analytic geometrygeometrysolution-verification

"Find the equation of the circle passing through the origin $(0,0)$, the point $(1,0)$ and tangent to the line $x-2y+1=0$."

What I have done:

The equation of a circle with radius $R$ and center $(x_0,y_0)$ is $(x-x_0)^2+(y-y_0)^2=R^2$. Since the circle passes through $(0,0)$ and $(1,0)$ it must be $$\tag{1} x_0^2+y_0^2=R^2$$ $$ \tag{2} (1-x_0)^2+y_0^2=R^2$$ and since it is tangent to the line $x-2y+1=0$ the distance from the center to this line must equal the radius $R$ hence (using the fact that the distance $d$ from a point $(x_0,y_0)$ to a line $ax+by+c=0$ is $d=\frac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}}$) we have $$R=\frac{|ax_0+by_0+c|}{\sqrt{a^2+b^2}}=\frac{|1x_0-2y_0+1|}{\sqrt{1^2+(-2)^2}}=\frac{|x_0-2y_0+1|}{\sqrt{5}} \tag{3}$$

From (1) and (2) we have

$$x_0^2 + y_0^2 = (1 – x_0)^2 + y_0^2 \Rightarrow x_0 = \dfrac{1}{2} \tag{4}$$

Equating (1) , (3) and (4) we have

$$\dfrac{1}{4}+y_0^2 = \dfrac{(\frac{3}{2}-2y_0)^2}{5} \Rightarrow y_0 = -3 \pm \sqrt{10}$$

So there are two solutions,

$$R^2 = \dfrac{1}{4}+(-3+\sqrt{10})^2 \Rightarrow (x – \dfrac{1}{4})^2+(y + 3 – \sqrt{10})^2 = \dfrac{1}{4} + (-3 + \sqrt{10})^2$$

and

$$R^2 = \frac{1}{4} + (-3 – \sqrt{10})^2 \Rightarrow (x – \frac{1}{4})^2 + (y + 3 + \sqrt{10})^2 = \dfrac{1}{4} + (-3 – \sqrt{10})^2$$.

Now, when I plot these solutions they appear to be wrong, so I would like to know which mistake(s) I have made.

WolframAlpha plot of circle

Best Answer

I plotted it on desmos, your answer does seem right. Here is the link

enter image description here The idea is that the point on which the circle touches the line can be varied. This leads to two circles satisfying the other two constraints of passing through the given points.

The mistake in OP's plot: They put $x=1/4$ instead of $x=1/2$