Navigation 
 Home 
 Search 
 Site map 

 Contact Graeme 
 Home 
 Email 
 Twitter

 Skip Navigation LinksMath Help > Geometry > Circles, Conic Sections > Circle Intersection

The Intersection of Two Circles

Two circles in a plane intersect in zero, one, two, or infinitely many points.  The latter case occurs only in the case of two identical circles.  The first case (zero points of intersection) occurs whenever the distance between the centers of the circles is greater than the sum of the radii or the distance between the center is less than the absolute value of the difference in their radii.

Problem: Give the general solution to this question:

Find the coordinates of the two (possibly equal) points of intersection of two non-concentric circles, A, and B, whose centers are (xA,yA) and (xB,yB) and whose radii are rA and rB.  You may assume there is at least one point of intersection.  In other words, you may assume the distance between the centers of the circles lies between the absolute value of the difference of their radii and the sum of their radii, inclusive.

Solution:

In this diagram, I have used the example in which circle A is red, centered at (-9,1) with a radius of 7, and circle B is green, centered at (5,-5) with a radius of 18.  C is the midpoint of A and B.  E and F are the intersections of the two circles, and D is the midpoint of E and F.

Let d be the distance between A and B, the centers of the two circles.

d = sqrt((xB-xA)2+(yB-yA)2)

Let K be the area of the triangle ABE.  The lengths of the sides of this triangle are d, rA, and rBHeron's Formula tells us

K = (1/4)sqrt((d+rA+rB)(-d+rA+rB)(d-rA+rB)(d+rA-rB))

By regrouping the four factors inside the square root, we get the area of the triangle in terms of d2 rather than in terms of d, and this is computationally easier:

K = (1/4)sqrt(((rA+rB)2-d2)(d2-(rA-rB)2))

C ((xB+xA)/2, (yB+yA)/2) is the midpoint between the centers of the circles.

D is the midpoint between the two points of intersection of the circles.

We will consider AB the "base" of triangle ABE, and DE the "height" of the triangle.  Point D divides the base into two segments, AD, and DB, whose signed lengths will be dA and dB, where dA+dB=d.  (The context in which I use signed distances is very narrow.  By "signed" I mean only that distances measured along line AB from A to B are considered "positive" and distances in the other direction are considered "negative".)

Note the following facts, where all distances are signed:

CA+CB = 0, because C is the midpoint of A and B
dA-dB = AD-DB = AD+BD = (CA+AD)+(CB+BD) = CD+CD, so
CD = (1/2)(dA-dB)

By Pythagoras, we have rA2-dA2 = rB2-dB2, so

rA2-rB2 = dA2-dB2 = (dA+dB)(dA-dB) = d(dA-dB) = 2d(CD)

This way, the signed length, CD, which is negative in the diagram, is given by

CD = (1/2)(rA2-rB2)/d

The ratio of change in the x-coordinate to signed distance along line AB is (xB-xA)/d, and the ratio of change in the y-coordinate to signed distance along this line is (yB-yA)/d.  From this we can calculate the coordinates of point D:

xD = xC + (1/2)(rA2-rB2)/d * (xB-xA)/d = (1/2)(xB+xA) + (1/2)(xB-xA)(rA2-rB2)/d2 
yD = yC + (1/2)(rA2-rB2)/d * (yB-yA)/d = (1/2)(yB+yA) + (1/2)(yB-yA)(rA2-rB2)/d2 

Did you wonder when we would make use of K, the area of triangle ABE?  Well, your wait is over!

K = (1/2)(AB)(DE)
DE = 2K/(AB) = 2K/d = (1/2)sqrt(((rA+rB)2-d2)(d2-(rA-rB)2))/d

Line DE is perpendicular to AB, so the ratio of change in the x-coordinate to distance along DE equal to plus or minus the ratio for the y-coordinate along AB, and the ratio of change in the y-coordinate to distance along DE is minus or plus the ratio for the x-coordinate along AB.  Note that the choice of plus or minus is arbitrary, but if you choose "plus" for the x-coordinate, you must choose "minus" for the y-coordinate, and vice-versa.  One choice gets you to point E, and the other choice gets you to point F, which are the two solutions to this problem.

With this in mind, we choose that the ratio of change in the x-coordinate to distance along line DE is (yB-yA)/d, and the ratio of change in the y-coordinate to signed distance along this line is -(xB-xA)/d.  From this we can calculate the coordinates of point E:

xE = xD + 2K/d * (yB-yA)/d
    = (1/2)(xB+xA) + (1/2)(xB-xA)(rA2-rB2)/d2 + 2(yB-yA)K/d2 
yE = yD + 2K/d * -(xB-xA)/d
    = (1/2)(yB+yA) + (1/2)(yB-yA)(rA2-rB2)/d2 - 2(xB-xA)K/d2 

where K and d2 are, again for reference, 

K = (1/4)sqrt(((rA+rB)2-d2)(d2-(rA-rB)2))
d2 = (xB-xA)2 + (yB-yA)2 

(K is the area of the triangle formed by the centers of the two circles and one of their points of intersection;
d is the distance between the circles centers;
rA, rB are the circles' radii;
(xA,yA) and (xB,yB) are the circles' centers)

The two solutions, then, are

x = (1/2)(xB+xA) + (1/2)(xB-xA)(rA2-rB2)/d2 ± 2(yB-yA)K/d2 
y = (1/2)(yB+yA) + (1/2)(yB-yA)(rA2-rB2)/d2 ± -2(xB-xA)K/d2 

Internet references

White Ravens and Black Swans, a delightful mixture of mathematics and philosophy, which gives the equations presented here, as a means of illustrating that two circles that appear not to intersect might have "imaginary" intersections because Heron's Formula for the area of a triangle gives an imaginary result if the largest side is more than the sum of the other two.

Related pages in this website

Conic Sections -- the home page for conic sections.

Find the equation of a circle, given three points

Find the equations of the (up to) four tangent lines to two circles.

Heron's Formula for the area of a triangle, which gives an imaginary "area" for impossible triangles.

 

The webmaster and author of this Math Help site is Graeme McRae.