0

I have n circles with individual radius and center point. Some or all of the circles might or might not overlap. How can I calculate their area in total, so that overlapped areas are only counted once?

I know how to do it for 2 circles: https://www.desmos.com/calculator/ztx7frvvh6

s_b
  • 27
  • 2
  • If you're stuck on the maths of the problem, probably a better fit for math stackexchange. Once you know *what formula you're trying to implement* and have attempted to implement it in a specific language *and* you're having difficulties with the implementation, *then* it could be a good fit here. – Damien_The_Unbeliever Jan 20 '23 at 08:06
  • ... and what if three or more circles overlap? Is that possible? – Dominique Jan 20 '23 at 08:16
  • @Dominique According to the question, yes, of course. The problem looks difficult, and I suggest asking on Math.SE or CS.SE. There are a few attempts [here](https://stackoverflow.com/questions/1667310/combined-area-of-overlapping-circles), but nothing really convincing for the general case. –  Jan 20 '23 at 08:21
  • 1
    @Damien Well, inclusion-exclusion does lead to a solution, but an inefficient one. I don't know if there is a better solution though. I was thinking of sweepline algorithms, but it does not seem quite right (there is [this](https://projecteuclid.org/journals/japan-journal-of-industrial-and-applied-mathematics/volume-23/issue-1/A-Sweep-Line-Algorithm-for-the-Inclusion-Hierarchy-among-Circles/jjiam/1150725475.pdf), which seems to address another close problem) –  Jan 20 '23 at 08:29
  • 3
    Does this answer your question? [Combined area of overlapping circles](https://stackoverflow.com/questions/1667310/combined-area-of-overlapping-circles). Yeah, I agreed that the "dupe" was laughable, but there is a much better one already on the site so have also voted to close too. – High Performance Mark Jan 20 '23 at 09:41

0 Answers0