8
$\begingroup$

I have two circles, like this:

enter image description here


I know the radii of the circles, and I know the X + Y of the center of both circles.

Can I get the size of the area that is black in my picture?

  • 0
    The solution on mathworld only works if the y coordinate of the centers is the same so in order to generalize it you have to set 1 circle to be at (0,0) and the second circle at position (Distance between centers,0). This essentially transforms the more complicated problem into one that this equation can solve.2016-06-24

2 Answers 2

5

A formula for the area is worked out in Circle-Circle Intersection at Wolfram MathWorld: $ A = r^{2}\cos^{-1}\left(\frac{d^{2}+r^{2}-R^{2}}{2dr}\right) + R^{2}\cos^{-1}\left(\frac{d^{2}+R^{2}-r^{2}}{2dR}\right) - \frac12 \sqrt{(-d+r+R)(d+r-R)(d-r+R)(d+r+R)} $ where $r$ and $R$ are the radii and $d$ is the distance between the centres.

6

This link helped me out in this situation. The MathWorld version is very descriptive, but I think the above link explains what is going on more clearly. I created a javascript function for this purpose, given below in case it is useful to anyone else.

function areaOfIntersection(x0, y0, r0, x1, y1, r1) {   var rr0 = r0*r0;   var rr1 = r1*r1;   var c = Math.sqrt((x1-x0)*(x1-x0) + (y1-y0)*(y1-y0));   var phi = (Math.acos((rr0+(c*c)-rr1) / (2*r0*c)))*2;   var theta = (Math.acos((rr1+(c*c)-rr0) / (2*r1*c)))*2;   var area1 = 0.5*theta*rr1 - 0.5*rr1*Math.sin(theta);   var area2 = 0.5*phi*rr0 - 0.5*rr0*Math.sin(phi);   return area1 + area2; }