How can I find the points at which two circles intersect?
Solution 1:
This can be done without any trigonometry at all. Let the equations of the circles be $$(x-x_1)^2 + (y-y_1)^2 = r_1^2, \tag{1}$$ $$(x-x_2)^2 + (y-y_2)^2 = r_2^2. \tag{2}$$ By subtracting $(2)$ from $(1)$ and then expanding, we in fact obtain a linear equation for $x$ and $y$; after a little rearranging it becomes $$-2x(x_1 - x_2) - 2y(y_1 - y_2) = (r_1^2 - r_2^2) - (x_1^2 - x_2^2) - (y_1^2 - y_2^2).$$ (If the circles intersect, this is the equation of the line that passes through the intersection points.) This equation can be solved for one of $x$ or $y$; let's suppose $y_1 - y_2 \ne 0$ so that we can solve for $y$: $$y = -\frac{x_1 - x_2}{y_1 - y_2} x + \dotsc. \tag{3}$$ Substituting this expression for $y$ into $(1)$ or $(2)$ gives a quadratic equation in only $x$. Then the $x$-coordinates of the intersection points are the solutions to this; the $y$-coordinates can be obtained by plugging the $x$-coordinates into $(3)$.
Solution 2:
Easy solution is to consider another plane such that the centers are along an axis.
Given the points $(x_1,y_1)$ and $(x_2,y_2)$. We focus on the center point of both circles given by $$ \left( \frac{x_1+x_2}{2}, \frac{y_1+y_2}{2} \right). $$
The distance between the centers of the circles is given by $$ R = \sqrt{ (x_2-x_1)^2 + (y_2-y_1)^2}. $$
We can consider the following orthogonal vectors $$ \vec{a} = \left( \frac{x_2-x_1}{R}, \frac{y_2-y_1}{R} \right), \vec{b} = \left( \frac{y_2-y_1}{R}, - \frac{x_2-x_1}{R} \right). $$
In the $(\vec{a},\vec{b})$ plane we get the equations $$ \big( a + R / 2 \big)^2 + b^2 = r_1^2,\\ \big( a - R / 2 \big)^2 + b^2 = r_2^2. $$
Whence $$ a = \frac{r_1^2 - r_2^2}{2R},\\ b = \pm \sqrt{ \frac{r_1^2+r_2^2}{2} - \frac{(r_1^2-r_2^2)^2}{4R^2} - \frac{R^2}{4}}. $$ The intersection points are given by $$ (x,y) = \frac{1}{2} \big( x_1+x_2, y_1+y_2 \big) + \frac{r_1^2 - r_2^2}{2R^2} \big( x_2-x_1, y_2-y_1 \big)\\ \pm \frac{1}{2} \sqrt{ 2 \frac{r_1^2+r_2^2}{R^2} - \frac{(r_1^2-r_2^2)^2}{R^4} - 1} \big( y_2-y_1, x_1-x_2 \big), $$ where $R$ is the distance between the centers of the circles.
Solution 3:
A nice way to look at this is to first consider the case when one point is at the origin and the other lies on the x-axis. Let the points be at $(0,0)$, $(d,0)$ and the radii be $r_1$, $r_2$. The two equations simplify to $$x^2+y^2=r_1^2$$ and $$(x-d)^2+y^2=r_2^2$$ Use the first to find $y^2$ and substitute in the second. $$(x-d)^2+r_1^2-x^2=r_2^2$$ expand and simplify $$-2xd+d^2+r_1^2=r_2^2$$ so $$x=\frac{r_1^2-r_2^2+d^2}{2d}$$ and from Pythagorus $$y=\sqrt{r_1^2-x^2}.$$ This part came from mathworld.
For the general position case with points $(x_1,y_1)$ $(x_2,y_2)$ let $$\begin{align} d&=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}\\ l&=\frac{r_1^2-r_2^2+d^2}{2d}\\ h&=\sqrt{r_1^2-l^2} \end{align}$$ Now $\left(\tfrac{x_2-x_1}{d},\tfrac{y_2-y_1}{d}\right)$ $\left(\tfrac{y_2-y_1}{d},-\tfrac{x_2-x_1}{d}\right)$ are two orthogonal unit vectors and we can rotate and translate to get the general solution $$\begin{align} x&=\frac{l}{d}(x_2-x_1) \pm \frac{h}{d}(y_2-y_1) + x_1,\\ y&=\frac{l}{d}(y_2-y_1) \mp \frac{h}{d}(x_2-x_1) + y_1.\\ \end{align}$$
Solution 4:
Let $C_1 = (x_1,y_1), C_2 = (x_2,y_2)$ be the centers of the two circles and $r_1,r_2$ be their radii respectively.
Their equations are $$(x-x_1)^2 + (y-y_1)^2 = r_1^2$$ $$(x-x_2)^2 + (y-y_2)^2 = r_2^2$$
They intersect only iff $|r_1-r_2|\leq|C_1-C_2|\leq|r_1+r_2|$, where $|C_1-C_2|$ is the distance between the two centers. If equality holds, the circles touch and there is one solution. For strict inequalities, they intersect and they have two solutions.
Just solve the system of equations. Suppose that $x_0$ is a point on the first circle. Then, its parametric representation is $x_0 = (x_1+r_1\cos\theta,y_1+r_1\sin\theta)$ for some $\theta$. If $x_0$ also lies on the second circle, which will make it a point of intersection, it must also satisfy the equation of the second circle i.e. $$(x_0-x_2)^2 + (y_0-y_2)^2 = r_2^2$$ Substitute the parametric form, and find out the value(s) of $\theta$.