homechevron_rightStudychevron_rightMathchevron_rightGeometry

Intersection of two circles

This online calculator finds the intersection points of two circles given the center point and radius of each circle. It also plots them on the graph.

This page exists due to the efforts of the following people:

Timur

Timur

To use the calculator, enter x and y coordinate of a center and radius of each circle.

A bit of theory can be found below the calculator.

PLANETCALC, Intersection of two circles

Intersection of two circles

First Circle

Second circle

Digits after the decimal point: 2
Distance analysis
 

Circles intersection

The task is relatively easy, but we should take into account the edge cases, so, we should start from calculating the cartesian distance d between two center points and checking for edge cases by comparing d with radiuses r1 and r2.

Here are the possible cases (distance between centers is shown in red):

Case Description Rule
Trivial case: the circles are coincident (or it is the same circle) d = 0, r1 = r2

separate.png

The circles are separate d > r1 + r2

contained.png

One circle is contained within the other d < abs(r1 - r2)

twopoints.png

twopoints2.png

Two intersection points You have one or two intersection points if all rules for edge cases above are not applied

onepoint.png

onepoint2.png

One intersection point Trivial case of two intersection points

So, if it is not an edge case, to find the two intersection points, calculator uses the following formulas (mostly deduced with Pythagorean theorem), illustrated with the graph below:

Two intersection points
Two intersection points

First calculator finds the segment a
a=\frac{r^2_1-r^2_2+d^2}{2d}
and then the segment h
h=\sqrt{r^2_1-a^2}

To find point P3, calculator uses the following formula (in vector form):
P3=P1 + \frac{a}{d}(P2-P1)

And finally, to get pair of points in case of two points intersection, calculator uses these equations:
First point:
x_4=x_3+\frac{h}{d}(y_2-y_1)\\y_4=y_3-\frac{h}{d}(x2-x_1)
Second point:
x_4=x_3-\frac{h}{d}(y_2-y_1)\\y_4=y_3+\frac{h}{d}(x2-x_1)
Note the opposite signs before second addend

For more information, you can refer to Circle-Circle Intersection and Circles and spheres

Creative Commons Attribution/Share-Alike License 3.0 (Unported) PLANETCALC, Intersection of two circles

Comments