direct_meridian_cases.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Boost.Geometry
  2. // Unit Test
  3. // Copyright (c) 2018 Oracle and/or its affiliates.
  4. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
  5. // Use, modification and distribution is subject to the Boost Software License,
  6. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #ifndef BOOST_GEOMETRY_TEST_DIRECT_MERIDIAN_CASES_HPP
  9. #define BOOST_GEOMETRY_TEST_DIRECT_MERIDIAN_CASES_HPP
  10. struct coordinates
  11. {
  12. double lon;
  13. double lat;
  14. };
  15. struct expected_results
  16. {
  17. coordinates p1;
  18. double distance;
  19. bool direction;//north=true, south=false
  20. coordinates p2;
  21. };
  22. expected_results expected[] =
  23. {
  24. { {0, 0}, 100000, true, {0, 0.90435537782} },
  25. { {0, 0}, 200000, true, {0, 1.8087062846} },
  26. { {0, 0}, 300000, true, {0, 2.7130880778385226826} },
  27. { {0, 0}, 400000, true, {0, 3.6174296804714929365} },
  28. { {0, 0}, 500000, true, {0, 4.521753233678117212} },
  29. { {0, 0}, 600000, true, {0, 5.4260542596891729872} },
  30. { {0, 0}, 700000, true, {0, 6.3303283037366426811} },
  31. { {0, 0}, 800000, true, {0, 7.234570938597034484} },
  32. { {0, 0}, 900000, true, {0, 8.1386639105161684427} },
  33. { {0, 0}, 1000000, true, {0, 9.0428195432854963087} },
  34. { {0, 0}, 10000000, true, {0, 89.982400761362015373} },
  35. { {0, 0}, 10001965, true, {0, 90} },
  36. { {0, 0}, 11000000, true, {180, 81.063836359} },
  37. { {10, 0}, 11000000, true, {-170, 81.063836359} },
  38. { {0, 1}, 100000, true, {0, 1.9043634563000368942} },
  39. { {0, 10}, 100000, true, {0, 10.904070448} },
  40. { {0, 80}, 100000, true, {0, 80.895552833} },
  41. { {0, 0}, 40010000, true, {0, 0.01932683869} },//wrap the spheroid once
  42. { {0, 10}, 100000, false, {0, 9.0956502718} },
  43. { {0, 10}, 2000000, false, {0, -8.0858305929} },
  44. { {0, 0}, 11000000, false, {180, -81.063836359} },
  45. { {0, 0}, 40010000, false, {0, -0.01932683869} } //wrap the spheroid once
  46. };
  47. size_t const expected_size = sizeof(expected) / sizeof(expected_results);
  48. #endif // BOOST_GEOMETRY_TEST_DIRECT_MERIDIAN_CASES_HPP