Ad
  • Custom User Avatar

    Reference solution used for random tests is clearly incorrect:

    TriangleFitsInSquare(415339.9863145371, 459659.20499247574, 666405.0066220658, 479755.37244198116)
    
    Test Failed
      Expected: False
      But was:  True
    

    At a = 415339.9863145371 pointing 88 degrees clockwise and b = 459659.20499247574 pointing ~172.43 degrees counter-clockwise, the third side equals c = 666405.0066220658 and the bounding square is around 471795.42395730014, smaller than 479755.37244198116.

  • Custom User Avatar

    You can assume that the sides represent always a valid triangle.

    One fixed test case is TriangleFitsInSquare(120.378, 340.873, 220.494, 600.698), which violates the triangle equality (and expects true for some reasons).

    There are also cases like TriangleFitsInSquare(101.419, 184.952, 83.533, 454.56) which is a triangle with 0 area.