diff options
author | Dmitry Yunitsky <yunik@mapswithme.com> | 2015-08-19 17:43:04 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 03:01:57 +0300 |
commit | ab91a74d83fc44d54fba5caf4605c06adcacb10b (patch) | |
tree | a003a26d6741b1401966d26c5a4e6b8c97f525af /geometry/geometry_tests | |
parent | 6b808ef4abece30fda3e9260542fd10296e43476 (diff) |
[omim] Added method for correct Azimuth detection.
Diffstat (limited to 'geometry/geometry_tests')
-rw-r--r-- | geometry/geometry_tests/angle_test.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/geometry/geometry_tests/angle_test.cpp b/geometry/geometry_tests/angle_test.cpp index 63ffb200eb..deaaa026d2 100644 --- a/geometry/geometry_tests/angle_test.cpp +++ b/geometry/geometry_tests/angle_test.cpp @@ -90,3 +90,34 @@ UNIT_TEST(TwoVectorsAngle) m2::Point<double>(1, 0) /* p1 */, m2::Point<double>(-1, 0)) /* p2 */, math::pi, eps), ()); } + +UNIT_TEST(Azimuth) +{ + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(-1, 0), + m2::Point<double>(0, 1), + math::pi2), -math::pi4), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(-1, 0), + m2::Point<double>(0, 1), + 0.0), math::pi4), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(-1, 1), + m2::Point<double>(1, -1), + 0.0), 3 * math::pi4), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(1, 1), + m2::Point<double>(0, 1), + -math::pi2), 0.0), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(1, -1), + m2::Point<double>(-1, -1), + math::pi), math::pi2), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(0, 0), + m2::Point<double>(-1, -1), + math::pi4), math::pi), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(0.5, -0.5), + m2::Point<double>(-0.5, 0.5), + math::pi4), -math::pi2), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(0.1, 0.1), + m2::Point<double>(0.2, 0.2), + math::pi4), 0.0), ()); + TEST(is_equal_angle(ang::Azimuth(m2::Point<double>(0.7, 0.7), + m2::Point<double>(-0.2, -0.2), + math::pi2), 3 * math::pi4), ()); +} |