9

Consider a square of size 1 and a triangle of sides $a$, $b$ and $c$.

Is there a way to know if the triangle can fit inside the square?

Clearly, if $a>\sqrt{2}$ or $b>\sqrt{2}$ or $c>\sqrt{2}$, it is not possible, but a triangle of sides $\frac{7}{5}$, $\frac{7}{5}$ and $\frac{1}{4}$ does not fit.

My first idea was to rotate the triangle and see if the maximum distance between points in each axis is less than 1...

alati ahmad
  • 389
  • 4

3 Answers3

4

I attacked this question from various angles, with little success at first. Treating it as linear programming minimization problem turned out to be hideously complicated and maybe impossible. In the end the solution turned out to be relatively trivial.

enter image description here

Use this equation (that was obtained by trigonometry and the law of cosines)

$x = c\cdot \cos\left(\frac{\pi}{2} - \arccos \left(\frac{a^2+c^2-b^2}{2 a c} \right) - \arccos \left(\frac 1 a \right)\right)$

where a is the length of the longest side of a triangle with area $\leq 1/2$ and b is the length of the shortest side of the triangle.

If $x\leq 1$ the given triangle will fit.

For an arbitrary square with side lengths (s), replace $\frac 1 a$ with $\frac s a$ and use:

$y = c \cdot \cos\left(\frac{\pi}{2} - \arccos \left(\frac{a^2+c^2-b^2}{2 a c} \right) - \arccos \left(\frac s a \right)\right)$

and the triangle will fit if $y \leq s$

KDP
  • 1,079
0

I believe that this is essentially a question of showing that the radius of the circumcircle is less than $\sqrt{2}/2$ because the largest triangle that can fit in the unit square is the right-triangle with unit sides, hypotenuse of $\sqrt{2}$ and circumradius of $\sqrt{2}/2$. Let's demonstrate how easy it is to calculate this in the complex plane. Given three random points, say $z_{1,2,3}$, we can determine the circumcenter, $z_c$ and radius, $r$ as shown here.

$$ z_c\ \;=\;\frac{\left| \begin{array}{ccc} z_1 & |z_1|^2 & 1 \\ z_2 & |z_2|^2 & 1 \\ z_3 & |z_3|^2 & 1 \end{array} \right|} {\left| \begin{array}{ccc} z_1\ & {z_1}^*\ & 1 \\ z_2\ & {z_2}^*\ & 1 \\ z_3\ & {z_3}^*\ & 1 \end{array} \right|} $$

and

$$ r=|z_c-z_1|=|z_c-z_2|=|z_c-z_3| $$

These calculations can probably be calculated by hand, but most likely will be done on a computer. I did just that in a matter of just six lines of code (in Matlab). You can then go on to plot the triangle, circumcircle, and overlay a unit square (though it may not be in the correct orientation).

Cye Waldman
  • 7,524
0

For a $\triangle ABC$, suppose the longest side = $AB$. Then

  1. $AB > \sqrt 2$. $\triangle ABC$ will not fit.
  2. $AB = \sqrt 2$. $\triangle ABC$ will fit IFF $\angle ABC = 45$ degrees $\vee$ $\angle BAC = 45$ degrees.
  3. $AB < \sqrt 2$. It seems necessary to set down some conditions for $1 < AB < \sqrt 2$ especially so if $AB \to \sqrt 2$