Skip to content

Commit

Permalink
[formulas] Fix warning (variable hiding member) in sjoberg_intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
awulkiew committed Jan 11, 2025
1 parent cda90e5 commit f43c3cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions include/boost/geometry/formulas/sjoberg_intersection.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Boost.Geometry

// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland.
// Copyright (c) 2023-2025 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2016-2019 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
Expand Down Expand Up @@ -566,7 +566,6 @@ class sjoberg_geodesic
{
CT const c0 = 0;
CT const dLj = d_lambda(c0);
CT const asin_tj_t0j = asin(Cj * tan_betaj / sqrt_1_Cj_sqr);
return lonj - asin_tj_t0j + dLj;
}

Expand Down
16 changes: 16 additions & 0 deletions test/formulas/intersection.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Boost.Geometry
// Unit Test

// Copyright (c) 2025 Adam Wulkiewicz, Lodz, Poland.

// Copyright (c) 2016-2019 Oracle and/or its affiliates.

// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
Expand Down Expand Up @@ -185,6 +187,19 @@ void test_bugs()
}
}

void test_special_cases()
{
{
double lon, lat;
bg::formula::sjoberg_intersection<double, bg::formula::andoyer_inverse, 1>
::apply(-0.01, 0.0, 0.01, 0.0,
0.0, -0.01, 0.0, 0.01,
lon, lat, bg::srs::spheroid<double>());
check_one("geodesic on equator", lon, 0.0);
check_one("geodesic on equator", lat, 0.0);
}
}

int test_main(int, char*[])
{
for (size_t i = 0; i < expected_size; ++i)
Expand All @@ -193,6 +208,7 @@ int test_main(int, char*[])
}

test_bugs();
test_special_cases();

return 0;
}

0 comments on commit f43c3cb

Please sign in to comment.