Non overlapping areas algorithm

674 Views Asked by At

One of my fellow members on stackoverflow has posted a question thread which concerns how to write a mathematical equation to calculate the exposed areas of a window from a group of windows (like on your desktop pc).

Example one of overlapping windows

Example two of overlapping windows

The thread in question can be found here...

https://stackoverflow.com/questions/15514202/remove-hidden-window-part/15514583#comment21994101_15514583

Now although i could write the program to do that in several lines of code where one step is covered step by step, I think it is beyond my scope to summarize it into a mathematical equation, so I thought to post it here in the Stack Exchange Mathematics Overflow.

I understand that the pseudo code has to be broken down and then applied in to the equation, but i came unstuck when i came to the looping portion of the pseudo code as i do not know how to transpose the loop into an equation.