This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/tests/geo/TestHeading.cpp
kazu 9947dced15 added several grid-walks
added new helper methods/classes (e.g. for heading)
new test cases
optimize the dijkstra
cleanups/refactoring
added timed-benchmarks to the log
many more...
2016-01-24 18:59:06 +01:00

30 lines
608 B
C++

#ifdef WITH_TESTS
#include "../Tests.h"
#include "../../geo/Heading.h"
TEST(Heading, diff) {
// 180 degree turn
{
// Heading h1(0,0, 0,+1);
// Heading h2(0,0, 0,-1);
// ASSERT_NEAR(h1.getDiffHalfRAD(h2), M_PI, 0.001);
// ASSERT_NEAR(h2.getDiffHalfRAD(h1), M_PI, 0.001);
}
// ~180 degree turn
{
Heading h1(0,0, 0.00,+1);
Heading h2(0,1, -0.01,-1);
Heading h3(0,1, +0.01,-1);
ASSERT_NEAR(h1.getDiffHalfRAD(h2), M_PI, 0.01);
ASSERT_NEAR(h2.getDiffHalfRAD(h1), M_PI, 0.01);
ASSERT_NEAR(h1.getDiffHalfRAD(h3), M_PI, 0.01);
ASSERT_NEAR(h3.getDiffHalfRAD(h1), M_PI, 0.01);
}
}
#endif