diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-01 18:16:04 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-01 18:16:04 +0000 |
commit | 089c0ebe576b8cbb018d2171e01a89c7a03f5684 (patch) | |
tree | 43c975ef33f75f0833f46ce09d7a2d6a60d8d398 /test/test-maths.cpp | |
parent | Throw if input stream not in good state reading JSON (diff) | |
parent | Move GeoData::Triangle to global lib (diff) | |
download | ilt-089c0ebe576b8cbb018d2171e01a89c7a03f5684.tar.bz2 ilt-089c0ebe576b8cbb018d2171e01a89c7a03f5684.tar.xz ilt-089c0ebe576b8cbb018d2171e01a89c7a03f5684.zip |
Diffstat (limited to 'test/test-maths.cpp')
-rw-r--r-- | test/test-maths.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test-maths.cpp b/test/test-maths.cpp index f7f34b3..b9d08bb 100644 --- a/test/test-maths.cpp +++ b/test/test-maths.cpp @@ -333,3 +333,11 @@ BOOST_DATA_TEST_CASE(rayLineDistance, BOOST_CHECK_LE(Ray<RelativePosition3D>(c, direction).distanceToLine(n1, n2), 0.01F); } } + +static_assert(linesIntersectAt(glm::ivec2 {10, 10}, {40, 40}, {10, 80}, {20, 40}).value().x == 24); +static_assert(linesIntersectAt(glm::vec2 {10, 10}, {40, 40}, {10, 80}, {20, 40}).value().y == 24); +static_assert(linesIntersectAt(GlobalPosition2D {311000100, 491100100}, {311050000, 491150000}, {312000100, 491200100}, + {311000100, 491100100}) + .value() + == GlobalPosition2D {311000100, 491100100}); +static_assert(!linesIntersectAt(glm::dvec2 {0, 1}, {0, 4}, {1, 8}, {1, 4}).has_value()); |