comparison OrthancStone/UnitTestsSources/GeometryToolboxTests.cpp @ 2156:340bde744884

added DebugDrawing2D and GeometryToolbox::IntersectLineAndSegment()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 27 Sep 2024 22:14:36 +0200
parents 16c01cc201e7
children
comparison
equal deleted inserted replaced
2155:71d6ad7036b7 2156:340bde744884
1172 ASSERT_EQ("PHR", bottom); 1172 ASSERT_EQ("PHR", bottom);
1173 ASSERT_EQ("RFA", left); 1173 ASSERT_EQ("RFA", left);
1174 ASSERT_EQ("LHP", right); 1174 ASSERT_EQ("LHP", right);
1175 } 1175 }
1176 } 1176 }
1177
1178
1179 TEST(GeometryToolbox, IntersectTwoLines)
1180 {
1181 double x, y;
1182 ASSERT_TRUE(OrthancStone::GeometryToolbox::IntersectTwoLines(x, y, 1, 1, 3, 2, 1, 4, 2, -1));
1183 ASSERT_DOUBLE_EQ(x, 17.0 / 11.0);
1184 ASSERT_DOUBLE_EQ(y, 14.0 / 11.0);
1185 ASSERT_TRUE(OrthancStone::GeometryToolbox::IntersectLineAndSegment(x, y, 1, 1, 3, 2, 1, 4, 2, -1));
1186 ASSERT_DOUBLE_EQ(x, 17.0 / 11.0);
1187 ASSERT_DOUBLE_EQ(y, 14.0 / 11.0);
1188 }