diff OrthancStone/UnitTestsSources/GeometryToolboxTests.cpp @ 2161:e65fe2e50fde dicom-sr tip

integration mainline->dicom-sr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 27 Sep 2024 22:34:17 +0200
parents 340bde744884
children
line wrap: on
line diff
--- a/OrthancStone/UnitTestsSources/GeometryToolboxTests.cpp	Sat Aug 31 08:40:01 2024 +0200
+++ b/OrthancStone/UnitTestsSources/GeometryToolboxTests.cpp	Fri Sep 27 22:34:17 2024 +0200
@@ -1174,3 +1174,15 @@
     ASSERT_EQ("LHP", right);
   }
 }
+
+
+TEST(GeometryToolbox, IntersectTwoLines)
+{
+  double x, y;
+  ASSERT_TRUE(OrthancStone::GeometryToolbox::IntersectTwoLines(x, y, 1, 1, 3, 2, 1, 4, 2, -1));
+  ASSERT_DOUBLE_EQ(x, 17.0 / 11.0);
+  ASSERT_DOUBLE_EQ(y, 14.0 / 11.0);
+  ASSERT_TRUE(OrthancStone::GeometryToolbox::IntersectLineAndSegment(x, y, 1, 1, 3, 2, 1, 4, 2, -1));
+  ASSERT_DOUBLE_EQ(x, 17.0 / 11.0);
+  ASSERT_DOUBLE_EQ(y, 14.0 / 11.0);
+}