This commit is contained in:
2025-01-06 05:15:12 +03:00
parent 29629a737d
commit 835fd110ba
2 changed files with 2 additions and 3 deletions

View File

@@ -59,7 +59,7 @@ namespace omath
const auto sideB = SideBLength();
const auto hypot = Hypot();
return sideA*sideA + sideB*sideB == hypot*hypot;
return std::abs(sideA*sideA + sideB*sideB - hypot*hypot) <= 0.0001f;
}
[[nodiscard]]
constexpr Vector3 SideBVector() const

View File

@@ -113,8 +113,7 @@ TEST_F(UnitTestTriangle, SideVectors)
TEST_F(UnitTestTriangle, IsRectangular)
{
EXPECT_TRUE(t1.IsRectangular());
EXPECT_TRUE(t3.IsRectangular());
EXPECT_TRUE(Triangle<Vector3>({2,0,0}, {}, {0,2,0}).IsRectangular());
}
// Test midpoint
TEST_F(UnitTestTriangle, MidPoint)