Khan/khan-exercises — pull request #74742 by theinternetftw (2013-09-12 11:55:49+00:00)
Title: One last graphie-geometry fix

After noticing and fixing the kite bug, other reports started coming in about a wider problem.
Isolated relevant functions, ran a couple thousand times. Happens when one angle is near
max bounds (160) another is near min bounds (20). Hard to get happening consistently even
under those conditions. Just have to run it a lot.

It is at those angles when the quad simply can't generate a line long enough to avoid failing
sideTooShort. Since the minimum length in sideTooShort was chosen by finding the shortest
side length such that labels wouldn't overlap, making the test easier to pass would just let
things overlap again. So the minimum angle is what needs to increase here.

Looked at the angle generating code, and saw randRange(30,160) instead of (20,160), which
makes it look like 30 degrees was the intended minimum anyway. Switching to a 30 degree
minimum angle fixes the lock-up problem, also mitigates the previous labels-for-very-obtuse-
angles-overlap-with-nearest-line problem (what @600046d66ca007329d27c7d69c885031cb70e0bd was all about).

Tested the fix by generating all 6 random quads 2,000,000 times each without issue.