Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
2  
whathaveyoutried.com ? –  lhf Jan 10 '12 at 11:37
1  
I've tried asking a Math and a Physics teacher, they both didn't know ^^ –  Lolmewn Jan 10 '12 at 11:48
2  
Google finds this: mathworld.wolfram.com/Circle-CircleIntersection.html –  lhf Jan 10 '12 at 11:52
    
Oh my, that looks crazy complicated. Isn't there an easier way to do this? –  Lolmewn Jan 10 '12 at 11:54
4  
Do you mean easier to understand or easier to implement? Because equation 14 is pretty easy to implement. Just code up the expression and don't think about it too much. :) (And for what it's worth, I wouldn't hold out hope for a simpler formula. Areas of intersections tend to have complicated closed forms.) –  Rahul Jan 10 '12 at 12:12
show 2 more comments

2 Answers

up vote 2 down vote accepted

A formula for the area is worked out in Circle-Circle Intersection at Wolfram MathWorld.

share|improve this answer
add comment

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;
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.