Area of multiple intersecting circles

Written by Paul Bourke


Introduction

The following is a straightforward but good example of a range of techniques called "Monte-Carlo" methods. It will be used here to numerically find the area of intersection of a number of circles on a plane.

Consider a single circle with radius r, the area is pi r2. The minimal square enclosing that circle has sides 2 r and therefore an area of 4 r2. If one was to choose random numbers from a uniform distribution within the bounding rectangle then the ratio of those falling within the circle to the total number will be the ratio of the area of the circle to the rectangle. In other words, countinside/totalcount = pi / 4, this ratio of pi / 4 would be approached closer as the totalcount increases.. This could be used as a way of estimate pi, albeit a very inefficient way!

Source code

C source that numerically estimates the intersection area of any number of circles on a plane is given here: area.c. The basic idea is to choose a random point within the bounding square of one of the circles and check to see if the point is within all the other circles. The successful count is scaled by 4 r2 / totalcount to give the area of the intersecting piece.