
I = I - (X * the percent overlap)
O = O + (X * the percent overlap)
X = C3 / I
where C3 is a global constant.

Rules for two squares
Rules for upward pointing triangles
Rules for triangles overlapping with only one square and for multiple overlapping triangles