@@ -343,7 +343,7 @@ BOOST_AUTO_TEST_CASE(intersects)
343
343
BOOST_TEST (intersects (box2, Segment2{{-1 , 2 }, {2 , -1 }}));
344
344
BOOST_TEST (!intersects (Segment2{{0.5 , 1.6 }, {2 , 0 }}, box2));
345
345
346
- // ellipsoid
346
+ // ellipsoid [2x^2 - 3xy + 2y^2 <= 1]
347
347
using Ellipse = ArborX::Experimental::Ellipsoid<2 >;
348
348
constexpr Ellipse ellipse{{1 .f , 1 .f }, {{2 .f , -1 .5f }, {-1 .5f , 2 .f }}};
349
349
BOOST_TEST (intersects (ellipse, Point2{1 .f , 1 .f }));
@@ -364,6 +364,20 @@ BOOST_AUTO_TEST_CASE(intersects)
364
364
BOOST_TEST (intersects (ellipse, Segment2{{0.5 , 0.5 }, {1.5 , 1.5 }}));
365
365
BOOST_TEST (intersects (ellipse, Segment2{{0.0 , 1.9 }, {3.0 , 1.9 }}));
366
366
BOOST_TEST (!intersects (ellipse, Segment2{{2.1 , 0 }, {2.1 , 3 }}));
367
+
368
+ using Box2 = ArborX::Box<2 >;
369
+ BOOST_TEST (intersects (ellipse, Box2{{-10 , -10 }, {10 , 10 }}));
370
+ BOOST_TEST (intersects (ellipse, Box2{{0.5 , 0.5 }, {1.0 , 1.0 }}));
371
+ BOOST_TEST (intersects (ellipse, Box2{{-1 , -1 }, {0 , 0 }}));
372
+ BOOST_TEST (intersects (ellipse, Box2{{2 , 2 }, {3 , 3 }}));
373
+ BOOST_TEST (intersects (ellipse, Box2{{-1 , -1 }, {0 , 2 }}));
374
+ BOOST_TEST (intersects (ellipse, Box2{{-1 , -1 }, {2 , 0 }}));
375
+ BOOST_TEST (intersects (ellipse, Box2{{2 , 1 }, {3 , 3 }}));
376
+ BOOST_TEST (intersects (ellipse, Box2{{1 , 2 }, {3 , 3 }}));
377
+ BOOST_TEST (!intersects (ellipse, Box2{{1.5 , 0 }, {2 , 0.5 }}));
378
+ BOOST_TEST (!intersects (ellipse, Box2{{-1 , -1 }, {-0.1 , -0.1 }}));
379
+ BOOST_TEST (!intersects (ellipse, Box2{{0 , 1.5 }, {0.5 , 2 }}));
380
+ BOOST_TEST (!intersects (ellipse, Box2{{2.1 , 2.1 }, {3 , 3 }}));
367
381
}
368
382
369
383
BOOST_AUTO_TEST_CASE (equals)
0 commit comments