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