Tiling circles intersection with squares

70 Views Asked by At

Is there an algorithm to calculate the amount of $1\times 1$ tiles that the intersection of $2$ circles lies into, given 2 circles in a $30\times 30$ grid with their radiuses and centers?

What I tried was approximating by using the line between the intersection points but this doesn't work when the intersection is wider than $1$ line of tiles.

Another version of this question is how can I check if a tile with given coordinates lies in the intersection of $2$ circles.