[Math] How to find the points at which two circles intersect

circles

Given the radius and $x,y$ coordinates of the center point of two circles how can I calculate their points of intersection if they have any?

Best Answer

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)$.