Area of Intersection of Circle and Square

6.8k Views Asked by At

Given a point $(x,y)\in [0,1]^2$ and $r > 0$, I would like to derive a general formula for the area of the intersection of the circle of radius $r$ centered at $(x,y)$ and the unit square.

What is the best approach for this?

I have thought of a divide-and-conquer approach using cases, but there are quite a few, so I'm wondering if this could be done more elegantly. Perhaps a double integral could help?

enter image description here

3

There are 3 best solutions below

0
On BEST ANSWER

Here's the closest I can think of to a general formula, which will be much easier if we let the circle be a unit circle such that the 'corner' still exists in the top left. I.e. let there be four points of intersection.

Let the orange path be denoted by $C_1$ and the green path by $C_2$. Then the area of the region will be the areas enclosed by the paths $C_1$ and $C_2$ subtracted from the total area of the circle. For a general circle centered at $(x, y)$ of radius $1$, you should be able to find a general formula for the intersection points. From there, you need to find parametrizations for the paths $C_1$ and $C_2$. If you haven't given up in frustration by this point, you can now apply the following:

$$Area = \pi r^2 -\iint_{C_1}dA - \iint_{C_2}dA$$

And applying Green's theorem:

$$Area = \pi r^2 - \int_{C_1}(xdy - ydx) - \int_{C_2}(xdy - ydx)$$

From here, you can get a general solution to this, but it will take a lot of work, and the final result will be a mess, even with the simplifications at the beginning. If you further add the restriction that the circle be translated equal amounts up and to the left, that will further simplify things.

0
On

The formula will be a mess, no matter how you look at it. There will be a lot of cases, period. My advice is that you should look at which sides of the square the circle intersects with, and how many times (once, twice or zero times for each side). Of course, there are some combinations which will not be possible, but the only way I see how to do it is this "brute force" approach.

0
On

Restating the problem so that $(x, y) \in [-1/2, 1/2]^2$, if the square is centered at $(0, 0)$, then you can freely change signs of $x$ and $y$ or swap them and you will still get the same result. This way you can move $(x, y)$ to the first octant, meaning that $x \ge 0$, $y \ge 0$ and $x \ge y$. This cuts the number of cases quite a bit.