| 19 | } |
| 20 | |
| 21 | UNIT_TEST(LineIntersection_Smoke) |
| 22 | { |
| 23 | { |
| 24 | Line2D const line(Segment2D(PointD(0, 0), PointD(1, 0))); |
| 25 | TEST_EQUAL(Intersect(line, line).m_type, Type::Infinity, ()); |
| 26 | } |
| 27 | |
| 28 | { |
| 29 | Line2D const lhs(Segment2D(PointD(0, 0), PointD(1, 1))); |
| 30 | Line2D const rhs(Segment2D(PointD(-10, -10), PointD(-100, -100))); |
| 31 | TEST_EQUAL(Intersect(lhs, rhs).m_type, Type::Infinity, ()); |
| 32 | } |
| 33 | |
| 34 | { |
| 35 | Line2D const lhs(Segment2D(PointD(0, 0), PointD(10, 10))); |
| 36 | Line2D const rhs(Segment2D(PointD(10, 11), PointD(0, 1))); |
| 37 | TEST_EQUAL(Intersect(lhs, rhs).m_type, Type::Zero, ()); |
| 38 | } |
| 39 | |
| 40 | { |
| 41 | Line2D const lhs(Segment2D(PointD(10, 0), PointD(9, 10))); |
| 42 | Line2D const rhs(Segment2D(PointD(-10, 0), PointD(-9, 10))); |
| 43 | auto const result = Intersect(lhs, rhs); |
| 44 | TEST_EQUAL(result.m_type, Type::One, ()); |
| 45 | TEST(AlmostEqualAbs(result.m_point, PointD(0, 100), kEps), (result.m_point)); |
| 46 | } |
| 47 | } |
| 48 | } // namespace line2d_tests |
nothing calls this directly
no test coverage detected