10
10
using namespace geo ;
11
11
12
12
TEST_CASE (" polylineDistanceToPolyline_pointBeforeLine_getStartPoint" ) {
13
- auto const graph = polyline{{0 .0f , 0 .0f }, {1 .0f , 0 .0f }};
14
- auto const test_point = latlng{-1 .0f , 0 .0f };
13
+ auto const graph = polyline{{0 .0F , 0 .0F }, {1 .0F , 0 .0F }};
14
+ auto const test_point = latlng{-1 .0F , 0 .0F };
15
15
16
16
auto const closest = distance_to_polyline (test_point, graph);
17
17
@@ -22,8 +22,8 @@ TEST_CASE("polylineDistanceToPolyline_pointBeforeLine_getStartPoint") {
22
22
}
23
23
24
24
TEST_CASE (" polylineDistanceToPolyline_pointAfterLine_getEndPoint" ) {
25
- auto const graph = polyline{{0 .0f , 0 .0f }, {1 .0f , 0 .0f }};
26
- auto const test_point = latlng{2 .0f , 0 .0f };
25
+ auto const graph = polyline{{0 .0F , 0 .0F }, {1 .0F , 0 .0F }};
26
+ auto const test_point = latlng{2 .0F , 0 .0F };
27
27
28
28
auto const closest = distance_to_polyline (test_point, graph);
29
29
@@ -35,8 +35,8 @@ TEST_CASE("polylineDistanceToPolyline_pointAfterLine_getEndPoint") {
35
35
36
36
TEST_CASE (" polylineDistanceToPolyline_pointOnLine_getPointOnLine" ) {
37
37
auto const graph =
38
- polyline{{0 .0f , 0 .0f }, {1 .0f , 0 .0f }, {1 .0f , 1 .0f }, {0 .0f , 1 .0f }};
39
- auto const test_point = latlng{0 .5f , 0 .0f };
38
+ polyline{{0 .0F , 0 .0F }, {1 .0F , 0 .0F }, {1 .0F , 1 .0F }, {0 .0F , 1 .0F }};
39
+ auto const test_point = latlng{0 .5F , 0 .0F };
40
40
41
41
auto const closest = distance_to_polyline (test_point, graph);
42
42
@@ -47,12 +47,12 @@ TEST_CASE("polylineDistanceToPolyline_pointOnLine_getPointOnLine") {
47
47
48
48
TEST_CASE (" polylineDistanceToPolyline_pointNotOnLine_getClosestPoint" ) {
49
49
auto const graph =
50
- polyline{{0 .0f , 0 .0f }, {1 .0f , 0 .0f }, {1 .0f , 1 .0f }, {0 .0f , 1 .0f }};
51
- auto const test_point = latlng{0 .75f , 0 .5f };
50
+ polyline{{0 .0F , 0 .0F }, {1 .0F , 0 .0F }, {1 .0F , 1 .0F }, {0 .0F , 1 .0F }};
51
+ auto const test_point = latlng{0 .75F , 0 .5F };
52
52
53
53
auto const closest = distance_to_polyline (test_point, graph);
54
54
55
- auto const best = latlng{1 .0f , 0 .5f };
55
+ auto const best = latlng{1 .0F , 0 .5F };
56
56
CHECK (closest.segment_idx_ == 1 );
57
57
CHECK (std::abs (distance (test_point, best) -
58
58
distance (test_point, closest.best_ )) < kEpsilon );
@@ -64,17 +64,17 @@ TEST_CASE("polylineDistanceToPolyline_pointNotOnLine_getClosestPoint") {
64
64
TEST_CASE (
65
65
" polylineSplitPolyline_multipleCoordinates_getCorrectSegmentsForEach" ) {
66
66
auto const graph =
67
- polyline{{0 .0f , 0 .0f }, {1 .0f , 0 .0f }, {1 .0f , 1 .0f }, {0 .0f , 1 .0f },
68
- {0 .4f , 1 .4f }, {1 .4f , 1 .4f }, {1 .4f , 0 .4f }, {0 .4f , 0 .4f }};
67
+ polyline{{0 .0F , 0 .0F }, {1 .0F , 0 .0F }, {1 .0F , 1 .0F }, {0 .0F , 1 .0F },
68
+ {0 .4F , 1 .4F }, {1 .4F , 1 .4F }, {1 .4F , 0 .4F }, {0 .4F , 0 .4F }};
69
69
auto const test_entries =
70
70
std::vector<std::tuple<geo::latlng, geo::latlng, std::size_t >>{
71
- {{0 .99f , 0 .95f }, {1 .0f , 0 .95f }, 1u },
72
- {{0 .9f , 1 .01f }, {0 .9f , 1 .0f }, 2u },
73
- {{0 .6f , 0 .9f }, {0 .6f , 1 .0f }, 2u },
74
- {{0 .41f , 1 .39f }, {0 .41f , 1 .40f }, 4u },
75
- {{1 .0f , 1 .5f }, {1 .0f , 1 .4f }, 4u },
76
- {{1 .39f , 1 .4f }, {1 .39f , 1 .4f }, 4u },
77
- {{1 .41f , 0 .6f }, {1 .4f , 0 .6f }, 5u },
71
+ {{0 .99F , 0 .95F }, {1 .0F , 0 .95F }, 1U },
72
+ {{0 .9F , 1 .01F }, {0 .9F , 1 .0F }, 2U },
73
+ {{0 .6F , 0 .9F }, {0 .6F , 1 .0F }, 2U },
74
+ {{0 .41F , 1 .39F }, {0 .41F , 1 .40F }, 4U },
75
+ {{1 .0F , 1 .5F }, {1 .0F , 1 .4F }, 4U },
76
+ {{1 .39F , 1 .4F }, {1 .39F , 1 .4F }, 4U },
77
+ {{1 .41F , 0 .6F }, {1 .4F , 0 .6F }, 5U },
78
78
};
79
79
80
80
for (auto const & test_entry : test_entries) {
0 commit comments