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).


The thread in question can be found here...
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.