So for two and three sets I have: $$|A\cup B| = |A| +|B| - |A \cap B|,$$
$$|A\cup B\cup C| = |A| + |B| +|C| - |A\cap B| - |A\cap C| - |B\cap C| + |A\cap B\cap C|.$$
What is the general solution for $n$ sets? Thank you!
For example if I want to find the area for n overlapping rectangles (at different angles or radii etc). what is the general formula? I want to know what combinations I need to add and subtract to achieve this.