Browse Source

Test more angles of intersection...

Sam Jaffe 6 years ago
parent
commit
567e57f3c5
1 changed files with 12 additions and 9 deletions
  1. 12 9
      math/test/shape_test.cxx

+ 12 - 9
math/test/shape_test.cxx

@@ -32,15 +32,18 @@ TEST_P(FromOriginTest, IntersectsAtOrigin) {
 }
 
 std::vector<math::dim2::line> const point_pairs{
-  {{{1, 1}}, {{0, 0}}},
-  {{{1, 1}}, {{1, 0}}},
-  {{{1, 1}}, {{0, 1}}},
-  {{{1, 1}}, {{1, 1}}},
-  {{{1, 1}}, {{2, 1}}},
-  {{{2, 3}}, {{1, 2}}},
-  {{{1, 1}}, {{-1,  0}}},
-  {{{1, 1}}, {{ 0, -1}}},
-  {{{1, 1}}, {{-1, -1}}},
+  {{{1, 1}}, {{0, 0}}},   // 0 length
+  {{{1, 1}}, {{1, 0}}},   // -45deg
+  {{{1, 1}}, {{0, 1}}},   // +45deg
+  {{{1, 1}}, {{1, 1}}},   // +0deg
+  {{{1, 1}}, {{2, 1}}},   // -18deg (approx)
+  {{{1, 1}}, {{1, 2}}},   // +18deg (approx)
+  {{{2, 3}}, {{1, 2}}},   //
+  {{{1, 1}}, {{-1,  0}}}, // +135deg
+  {{{1, 1}}, {{ 0, -1}}}, // -135deg
+  {{{1, 1}}, {{-1, -1}}}, // +180deg
+  {{{1, 1}}, {{ 1, -1}}}, // +90deg
+  {{{1, 1}}, {{-1,  1}}}, // -90deg
 };
 
 INSTANTIATE_TEST_CASE_P(LineIntersection, FromOriginTest,