116 Segment s0 = {{-1, 0}, {1, 0}},
117 s1 = {{ 0, 1}, {0, -1}};
119 checkIntersection(s0, s1,
Point{0, 0});
122 Segment s0 = {{-1, 0}, {5, 0}},
123 s1 = {{ 0, 1}, {0, -1}};
125 checkIntersection(s0, s1,
Point{0, 0});
129 Segment s0 = {{5, 0}, {-1, 0}},
130 s1 = {{ 0, -1}, {0, 1}};
132 checkIntersection(s0, s1,
Point{0, 0});
136 Segment s0 = {{-5, -5}, {5, 5}},
137 s1 = {{-5, 5}, {5, -5}};
139 checkIntersection(s0, s1,
Point{0, 0});
143 for (int32_t x0 = -10; x0 <= 10; x0++) {
144 for (int32_t x1 = -10; x1 <= 10; x1++) {
145 for (int32_t x2 = -10; x2 <= 10; x2++) {
146 for (int32_t x3 = -10; x3 <= 10; x3++) {
151 auto actual =
intersect({P0, P1}, {P2, P3});
152 bool expected = (x0 < x2 && x3 < x1) || (x2 < x0 && x1 < x3);
155 int32_t
y = std::abs(x2 - x0) >= std::abs(x3 - x1);
164 Segment s0 = {{0, -100}, {0, -50}},
165 s1 = {{100, -100}, {-100, 100}};
172 Segment s0 = {{0, 100}, {0, 50}},
173 s1 = {{100, -100}, {-100, 100}};