The slimness factor of a geometric shape in 2 dimensions is the ratio between the side-length of its smallest containing square and its largest contained square. This is an important factor in computational geometry. So the slimness of a square is 1, the slimness of a circle is $\sqrt 2$, but what is the slimness factor of a given triangle?
After trying unsuccessfully to solve this geometrically, I decided to try a purely analytical solution. Here it is:
The fatness obviously does not depend on scale. Hence two parameters are sufficient to define the triangle. I choose as parameters an angle $\theta$ adjacent to the longest side and the ratio $D$ between the side next to that angle and the longest side. We have to find the fatness as a function of $\theta$ and $D$.
Normalize the triangle so that its longest side lies on the x axis, between $(0,0)$ and $(1,0)$. Define $\theta$ as the angle at the origin. Rotate the triangle such that $\theta$ is between $0^\circ$ and $90^\circ$. For brevity, let $C=\cos \theta$ and $S=\sin \theta$. $D$ is the length of the side starting at the origin, so that the 3rd vertex of the triangle is at $(DC,DS)$, where $0<D<1$, $0\leq C<1$ and $0\leq S<1$.
The slimness factor should be calculated as a function of the parameters $D$, $C$ and $S$.
The containing square
Consider the unit square $[0,1]\times[0,1]$. We want to transform it so that it contains the triangle. A general transformation of a point $(x,y)$ is: $(rcx+rsy+h, rsx-rcy+v)$ where: $r$ is the dilation factor, $s$ and $c$ are sine and cosine of the rotation angle (we can assume they are both in $[0,1]$ because of the rotational symmetry of the square), $h$ is horizontal translation and $v$ is vertical translation. So a general transformation of the unit square has the following corners:
- $(rc+rs+h, rs-rc+v)$
and the following sides:
- $s(x-h-rs)=c(y-v+rc)$ which is the same as $s(x-h)=c(y-v)+r$
- $c(x-h-rc)=-s(y-v-rs)$ which is the same as $c(x-h)=-s(y-v)+r$
In order to contain the triangle, each vertex $(x,y)$ of the triangle must be in the 4 half-planes defined by the 4 sides of the square:
- $c(y-v)\leq s(x-h)\leq c(y-v)+r$
- $-s(y-v)\leq c(x-h)\leq -s(y-v)+r$
Now, substitute each of the 3 vertices of the triangle and get, for $(0,0)$, $(1,0)$ and $(DC,DS)$ respectively:
- $-cv\leq -sh\leq -cv+r$
- $sv\leq -ch\leq sv+r$
- $-cv\leq s-sh\leq -cv+r$
- $sv\leq c-ch\leq sv+r$
- $c(DS-v)\leq s(DC-h)\leq c(DS-v)+r$
- $-s(DS-v)\leq c(DC-h)\leq -s(DS-v)+r$
There are a total of 12 inequalities here. Our goal is to find the smallest $r$ such that there are $c,s,h,v$ satisfying all these 12 inequalities.
Removing some redundant inequalities and ordering, we get:
- $r\geq s+cv-sh$
- $cv-sh\geq 0$
- $r\geq c-ch-sv$
- $-ch-sv\geq 0$
- $r\geq s(DC-h)-c(DS-v)=sDC-cDS+cv-sh$
- $r\geq c(DC-h)+s(DS-v)=cDC+sDS-ch-sv$
To make $r$ as small as possible, we should select $h$ and $v$ such that inequalities 2 and 4 become zero. Then we remain with the following inequalities which $r$ must satisfy:
- $r\geq s$
- $r\geq c$
- $r\geq cDC+sDS$
Here I am stuck: how can I solve this optimization problem?
The contained square
Again consider the unit square $[0,1]\times[0,1]$. Now we want to transform it so that it is contained in the triangle. The 4 corners of the square must satisfy the 3 inequalities dictated by the sides of the triangle, which are:
- $y\geq 0$
- $xDS\geq yDC$
- $(1-x)DS\geq (1-DC)y$
Substituting the 4 corners of the square gives the following 12 inequalities which r must satisfy, some of which are redundant:
- $-rc+v\geq 0$
- $v\geq 0$ (redundant)
- $rs+v\geq 0$ (redundant)
$rs-rc+v\geq 0$ (redundant)
- $(rc+h)DS\geq (rs+v)DC$
- $(rs+h)DS\geq (-rc+v)DC$ (redundant)
$(rc+rs+h)DS\geq (rs-rc+v)DC$ (redundant)
- $(1-h)DS\geq (1-DC)v$ (redundant)
- $(1-rc-rs-h)DS\geq (1-DC)(rs-rc+v)$
- $(1-rs-h)DS\geq (1-DC)(-rc+v)$ (redundant)
These imply the following 5 inequalities (note that this time the direction of the inequalities is inversed because we are looking to maximize $r$ subject to the inequalities):
- $cr \leq v$
- $0\leq hDS-vDC$
- $(sDC-cDS)r \leq hDS-vDC$
- $(s-sDC+cDS)r\leq DS-v-hDS+vDC$
- $(s-c-sDC+cDC+sDS+cDS)r\leq DS-v-hDS+vDC$
Here, again, I am stuck...
The last step is just to divide the two $r$'s, but, how do I find each $r$?
I am looking for a formula that gives fatness as a function of $\theta$ and $D$. However, if you think there is another pair of parameters by which it is more convenient to represent the fatness (e.g. the two smaller angles), then this is also welcome.