I have a rectangle with a given length $L$ and width $B$. There is a point in one of quadrant of this rectangle whose location $x$ value can vary from $0$ to $B/2$, and $y$ can vary from $0$ to $L/2$. Depending on the location of this point, a shaded region is formed within the bounds of this rectangle. The shaded region is such that its centroid lies at the point itself.
- When $x<B/3$ and $y<L/3$, the shaded region will be a triangle.
- When $B/3\leq x \leq B/2$ and $y \leq L/3$, the shaded region is a trapezoid.
- When $x\leq B/3$ and $L/3\leq y \leq L/2$, it is also a trapezoid.
- But, when $x>B/3$ and $y>B/3$, it is a five-sided figure.
At $x=B/2$ and $y=L/2$, the shaded region is fully shaded rectangle that covers the whole rectangle.
Also, for $x$ when $y=L/2$ when $x$ is varying, the shaded region is a rectangle whose length is equal to the length of the rectangle and its width is equal to $2x$.
- Also, for $y$ when $x=B/2$ when $y$ is varying, the shaded region is a rectangle whose width is equal to width of the rectangle and whose length is equal to $2y$.
I can find lengths of sides when it is a trapezoid, triangle, or rectangle, but not when it is a five-sided figure. How can I find it?






Let $ABCD$ be the given rectangle, with $AB=b$ and $BC=l$ (see figure below). Let then $O$ be the rectangle centre and $P$ the centroid of pentagon $ABMND$, while $G$ is the centroid of triangle $CMN$. Draw from $O$ two midlines, connecting the midpoints of the opposite sides of the rectangle.
If we set $CM=x$ and $CN=y$, then the distances of $G$ from the midlines can be computed as $b/2-x/3$ and $l/2-y/3$. Note that, by the definition of centroid, $POG$ are aligned, and if $h$, $k$ are the distances of $P$ from the midlines we have: $$ \tag{1} h\cdot(2bl-xy)=\left({b\over2}-{x\over3}\right)\cdot xy\\ $$ $$ \tag{2} k\cdot(2bl-xy)=\left({l\over2}-{y\over3}\right)\cdot xy\\ $$ because $xy$ is the double area of the triangle and $2bl-xy$ is the double area of the pentagon. From the first equation we get $$ y = {12 bl h \over(3 b + 6 h - 2 x) x} $$ and substituting into the second equation we end up with a cubic equation for $x$: $$ 4 k x^3 +6(h l-2 b k -2 h k)x^2 +9(b^2 k +2b h k - b h l-2 h^2 l)x +24 b h^2 l=0. $$ This can be solved to get $x$ and then $y$. Note that there can be three real solution, but only one of them will satisfy $0<x<b$ and $0<y<l$.
EDIT.
From the above equations one can find the conditions on $h$ and $k$ such that $x\le b$ and $y\le l$. For instance, plugging $x=b$ into $(1)$ and $(2)$ we get $$ {y\over l}={3-k/h\over2} $$ and substituting this again into $(1)$ we obtain: $$ 6{h\over b}\left({h\over b}+{k\over l}\right)=3{h\over b}-{k\over l} $$ which is the equation of a hyperbola. An analogous equation can be found from $y=l$ (just switch $h/b\leftrightarrow k/l$). These hyperbolae are shown in the figure below, where $h/b$ and $k/l$ are represented on the cartesian axes.
Hence not all the values $h\in[0,b/6]$, $k\in[0,l/6]$ are allowed, but only those inside the region shown in the figure. When $(h,k)$ lie outside that region, then the "shaded region" is not a pentagon, but a trapezoid.