# Area of Intersection of Circle and Square

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?

-

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.

-

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.

-