In Java programing, if we have intersecting circles, one with center point O(x1,y1) and radius R1, and another with center point O'(x2,r2) and radius R2, how do we find points A and B where they intersect?
-
Well post the formula to calculate this. After that we can implement some java code. – greenapps Mar 10 '15 at 13:26
-
First off, this has nothing to do with Java, android or programming. This is a math question. But, to answer your question, the points of intersection are the third point on the triangle formed by the lines OO', R1, R2 – Eric Hughes Mar 10 '15 at 13:27
-
This is a duplicate of [this post](http://math.stackexchange.com/questions/39561/finding-the-intersecting-points-on-two-circles) on the math.SE – Eric Hughes Mar 10 '15 at 13:54
-
..or this one: http://math.stackexchange.com/a/256123 – Philipp Mar 10 '15 at 14:23
1 Answers
It's not that simple.
The circles could be disjoint. So no solution.
The circles could be concentric. So either no solution or an infinite number of solutions if they are the same size.
One circle could be contained within the other one without touching the larger circle's edge. Again, no solution.
The case where the circles overlap is simpler. But there will be, in general, two solutions: one solution if they are just touching.
I think case (2) is the easiest one to test and implement: a good starting point.
For case (4), you can solve the circle's algebraic equations simultaneously. If you work in Cartesian coordinates, you'll get polynomials that are quadratic in x and y. In fact, non-real (i.e. complex) solutions will imply one of cases 1, 2, and 3.

- 231,907
- 34
- 361
- 483