Calculate the intersection area of 3 circles

We know center coordinate of three circles & also their radius. Now I want to know the intersection area of these three circle I know how to calculate the intersection area of two circle ,I want to calculate just the overlap area of these three How can I do this?

6 Comments

Post your code for two circle, maybe it can be improved and adapted for three circles
Intersection area of two circle Example circle1: r1 , (x1,y1) circle2: r2 , (x2,y2)
first we make a triangle by connecting the center and the one of the circle intersection points
d=sqrt((x2-x2)^2+(y1-y2)^2); %'d' is the distance between the center of two circle s=(r1+r2+d)/2; % 's' is half of the sum of the triangles A=sqrt(s*(s-r1)*(s-r2)*(s-d)); a1 = acosd((r1^2+d^2-r2^2)/(2*r1*d)); % Angle at first center a2 = acosd((r2^2+d^2-r1^2)/(2*r2*d)); % Angle at second center OverlapArea = (a1*(r1^2) + a2*(r3^2)) - (2*ta2)
There is good reason no-one has answered this question as yet, Vatankhah. The problem you pose requires a more complicated matlab code than the usual kind which appear here in 'Answers'.
I assume we are taking about circles in the x-y plane. The region of points in the intersection of three circular disks can either be empty or consist of a convex shape bounded, 1) by a single complete circle, 2) by two circular arcs, 3) by three circular arcs, or 4) by four circular arcs in which two of these are parts of the same circle.
The "empty" case can occur if any pair of the circular disks do not touch, but it can also occur when each pair of disks intersect but with no common intersection in these pairwise intersections.
The method involved in finding the area of the non-empty intersection case is the same in cases 2), 3), and 4) above. The intersection region is composed of two, three, or four circular segments together with an enclosed polygon which is either a straight line segment, a triangle, or a quadrilateral. A circular segment area can be computed as the area of a circular sector with the area of the triangle composed of the circle center and the two arc endpoints either subtracted or added depending on whether the arc angle is less than or greater than pi.
Because of the necessity for distinguishing between all these different cases above, the resulting matlab code, however, would be excessive in terms of solution in this forum in my opinion.
I didn't think an analytical solution would be easy, but I waited for Roger to respond in case I was wrong. My only suggestion would be if you can live with an approximate, quantized solution, where you convert your circles to digitized arrays (images) with poly2mask, then AND all then all together to find the intersection, and then use regionprops() (in the Image Processing Toolbox) to get the area. But this is a numerical solution (whose accuracy depends on the digitization frequency you select), not a theoretically exact, analytical solution. If you want that, and can't figure it out, let me know.
Just wanted to mention an additional way to approximate a result with minimal code: using Mapping toolbox, building polygons and intersecting them.
thank a lot for your answers,i do as image analyst said and it worked

Sign in to comment.

Answers (0)

Asked:

on 9 Aug 2013

Commented:

on 13 Jan 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!