From b0b2d52a2f25d623be2498e31df9939286383722 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 27 Feb 2021 20:15:28 +0000 Subject: Calculate the radius to join to point+direction vector pairs This uses a mental formula that was derived using symbolabs.com, it works but there just has to be simpler form of it! --- test/test-maths.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test-maths.cpp b/test/test-maths.cpp index d5848c6..6151c39 100644 --- a/test/test-maths.cpp +++ b/test/test-maths.cpp @@ -2,7 +2,6 @@ #include #include -#include #include #include @@ -92,3 +91,8 @@ BOOST_DATA_TEST_CASE(test_find_arc_centre, BOOST_CHECK_CLOSE(exp.y, c.first.y, 1); BOOST_CHECK_EQUAL(lr, c.second); } + +BOOST_AUTO_TEST_CASE(test_find_arcs_radius) +{ + BOOST_CHECK_CLOSE(find_arcs_radius({10.32, 26.71}, {0.4, .92}, {2.92, 22.41}, {-0.89, -0.45}), 2.29, 1); +} -- cgit v1.2.3