I need to optimize the overlap of 2 rectangles of different dimensions. I can translate and rotate them. Is there a standard approach to such problem?