inverse_cases_small_angles.hpp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. // Boost.Geometry
  2. // Unit Test
  3. // Copyright (c) 2018 Adeel Ahmad, Islamabad, Pakistan.
  4. // Contributed and/or modified by Adeel Ahmad, as part of Google Summer of Code 2018 program.
  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_INVERSE_CASES_SMALL_ANGLES_HPP
  9. #define BOOST_GEOMETRY_TEST_INVERSE_CASES_SMALL_ANGLES_HPP
  10. #include "inverse_cases.hpp"
  11. struct expected_results_small_angles
  12. {
  13. coordinates p1;
  14. coordinates p2;
  15. expected_result karney;
  16. };
  17. /*
  18. These values are collected from GeodTest which is associated with GeographicLib:
  19. https://zenodo.org/record/32156
  20. The conversion to C++ array format is done using this Python script:
  21. https://github.com/adl1995/boost-geometry-extra/blob/master/geographiclib-dataset-parse-inverse.py
  22. Geodesic scale (M12) is absent from the GeodTest dataset, so it is manually generated
  23. using GeographicLib using this C++ script:
  24. https://github.com/adl1995/boost-geometry-extra/blob/master/geographicLib-direct-small_angles.cpp
  25. */
  26. expected_results_small_angles expected_small_angles[] =
  27. {
  28. {
  29. { 180, 0 },{ 0, 0 },
  30. { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 },
  31. },{
  32. { 180, 0 },{ 1e-300, 0 },
  33. { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 },
  34. },{
  35. { 180, 0 },{ 1e-200, 0 },
  36. { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 },
  37. },{
  38. { 180, 0 },{ 1e-100, 0 },
  39. { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 },
  40. },{
  41. { 180, 0 },{ 1e-50, 0 },
  42. { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 },
  43. },{
  44. { 180, 0 },{ 1e-20, 0 },
  45. { 20003931.45862544700503349304, -0.00000000000000000000, 180.00000000000000000000, 67125.61229850351810455322266, -1.00000000000000000000 },
  46. },{
  47. { 180, 0 },{ 1e-10, 0 },
  48. { 20003931.45862544700503349304, -9.501793528220011062168943853e-09, -179.9999999904981962117744843, 67125.61229850351810455322266, -1 },
  49. },{
  50. { 0, 1e-100 },{ 170, 1e-200},
  51. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  52. },{
  53. { 0, 1e-300 },{ 170, 1e-50},
  54. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  55. },{
  56. { 0, 1e-300 },{ 170, 1e-10},
  57. { 18924313.43485650792717933655, 89.99999999939157646622334141, 90.00000000060019544889655663, 1041298.80855225014965981245, -0.9864919282563420210863114335 },
  58. },{
  59. { 0, 1e-100 },{ 170, 1e-50},
  60. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  61. },{
  62. { 0, 1e-200 },{ 170, 1e-50},
  63. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  64. },{
  65. { 0, 0.0 },{ 170, 1e-10},
  66. { 18924313.43485650792717933655, 89.99999999939157646622334141, 90.00000000060019544889655663, 1041298.80855225014965981245, -0.9864919282563420210863114335 },
  67. },{
  68. { 0, 1e-20 },{ 170, 1e-100},
  69. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  70. },{
  71. { 0, 1e-100 },{ 170, 0.0},
  72. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  73. },{
  74. { 0, 1e-10 },{ 170, 1e-300},
  75. { 18924313.43485650792717933655, 89.99999999939980455110344337, 90.00000000060842353377665859, 1041298.80855225014965981245, -0.9864919282563420210863114335 },
  76. },{
  77. { 0, 1e-300 },{ 170, 1e-100},
  78. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  79. },{
  80. { 0, 1e-200 },{ 170, 1e-100},
  81. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  82. },{
  83. { 0, 1e-10 },{ 170, 1e-50},
  84. { 18924313.43485650792717933655, 89.99999999939980455110344337, 90.00000000060842353377665859, 1041298.80855225014965981245, -0.9864919282563420210863114335 },
  85. },{
  86. { 0, 0.0 },{ 170, 1e-200},
  87. { 18924313.43485650792717933655, 90, 90, 1041298.808552250848151743412, -0.9864919282563420210863114335 },
  88. },{
  89. { 0, 0.0 },{ 170, 1e-10},
  90. { 18924313.43485650792717933655, 89.99999999939157646622334141, 90.00000000060019544889655663, 1041298.80855225014965981245, -0.9864919282563420210863114335 },
  91. }
  92. };
  93. size_t const expected_size_small_angles = sizeof(expected_small_angles) / sizeof(expected_results_small_angles);
  94. #endif // BOOST_GEOMETRY_TEST_INVERSE_CASES_SMALL_ANGLES_HPP