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...
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.
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$