From 7481957415ecc581b7dfd2453b0e61058e2ac0c6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 14 Feb 2021 13:42:10 +0000 Subject: Add vector pitch --- test/test-maths.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') diff --git a/test/test-maths.cpp b/test/test-maths.cpp index ba1bc7b..6187c46 100644 --- a/test/test-maths.cpp +++ b/test/test-maths.cpp @@ -17,6 +17,28 @@ BOOST_DATA_TEST_CASE(test_vector_yaw, BOOST_CHECK_CLOSE(vector_yaw(v), a, 1.F); } +BOOST_DATA_TEST_CASE(test_vector_pitch, + boost::unit_test::data::make({ + {north, 0}, + {east, 0}, + {south, 0}, + {west, 0}, + {north + up, quarter_pi}, + {east + up, quarter_pi}, + {south + up, quarter_pi}, + {west + up, quarter_pi}, + {north - up, -quarter_pi}, + {east - up, -quarter_pi}, + {south - up, -quarter_pi}, + {west - up, -quarter_pi}, + {north + west - up, -quarter_pi}, + {north + west + up, quarter_pi}, + }), + v, a) +{ + BOOST_CHECK_CLOSE(vector_pitch(v), a, 1.F); +} + using normalize_angle = std::tuple; BOOST_DATA_TEST_CASE(test_angle_normalize, boost::unit_test::data::make({ -- cgit v1.2.3