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.