It is so simple but yet I am unable to solve it. Given two rectangles with sides x,y and a,b respectively. Determine the maximum possible common area of the two.
-
1How are they positioned in space? – k.stm Mar 17 '13 at 12:36
-
The intersection of two rectangles has maximal area when the two rectangles share a common vertex (if the edges of the rectangles have to remain parallel). You should be able to show this pretty easily. If they can be rotated then i'm not quite sure. – Dan Rust Mar 17 '13 at 12:43
-
@hardmath You're right I didn't consider the rotated case, in which a maximal intersection may lie. – Dan Rust Mar 17 '13 at 12:49
-
Position does not matter. We can move translate and rotate them. – user61810 Mar 17 '13 at 12:55
-
@DanielRust: I suspect they can be positioned with a common center, however, which reduces the problem to a one-dimensional maximization. – hardmath Mar 17 '13 at 12:56
1 Answers
We may assume WLOG that $a \ge b$ and $x \ge y$, which reduces the possible cases to six:
$$ a \ge b \ge x \ge y \;\;\;\; x \ge y \ge a \ge b $$
$$ a \ge x \ge b \ge y \;\;\;\; x \ge a \ge y \ge b $$
$$ a \ge x \ge y \ge b \;\;\;\; x \ge a \ge b \ge y $$
The first four cases are trivial in that one rectangle may be placed inside the other, and the right hand three cases are symmetric with the left hand three cases by interchanging the roles of $a,b$ and $x,y$. So it suffices to solve the lower left hand case.
Note that for simplicity we used weak inequalities, so the cases as presented are not disjoint. However pairs of rectangles that meet more than one case can be treated as limiting cases of the respective classifications using strict inequalities. For example our subcase $ a = x \ge y \ge b $ is also a limiting case of one of the trivial cases, in that the equal widths allow one rectangle to fit just within the other.
Let us take the $x,y$ rectangle as centered at the origin, with sides parallel to the Cartesian axes as usual, i.e. with vertices $(\pm x/2, \pm y/2)$. We then seek a center and rotation of the "wider but shorter" $a,b$ rectangle to maximize the area of its overlap with the "fixed" rectangle.
The maximizing placement will not generally be unique. For example, consider the case of a "very wide" movable rectangle, with $a \gt \sqrt{x^2 + y^2}$. Then for any maximizing placement the movable rectangle can be "slid" one way or the other along its width at least some positive distance without reducing the area of overlap.
The discussion will be simplified if we restrict attention to locating the center of the movable rectangle also at the origin. This restriction is plausible, but I have not fully developed the details of a proof. An idea for a proof is as follows: For a fixed rotation (orientation) of the movable rectangle, show that the area of overlap is a unimodal function of its center's location. By reflection through the origin (which essentially preserves the movable rectangle's orientation, because of symmetry), the maximum area of overlap is attained by locating the center at the origin.
Now the problem is a fairly simple one-dimensional maximization. For sufficiently large $a$ the optimal orientation puts the "wider but shorter" rectangle parallel to a diagonal of the fixed rectangle. At the limit $a = x$ the orientation puts the rectangles's widths parallel. For the intermediate cases $x \lt a \lt \sqrt{x^2 + y^2}$ we expect to vary the orientation, so that increasing width $a$ causes rotation from "horizontal" to "diagonal" alignment.
- 37,015