summaryrefslogtreecommitdiff
path: root/boost/geometry/formulas/thomas_direct.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/geometry/formulas/thomas_direct.hpp')
-rw-r--r--boost/geometry/formulas/thomas_direct.hpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/boost/geometry/formulas/thomas_direct.hpp b/boost/geometry/formulas/thomas_direct.hpp
index f208167cf5..748960b01b 100644
--- a/boost/geometry/formulas/thomas_direct.hpp
+++ b/boost/geometry/formulas/thomas_direct.hpp
@@ -1,6 +1,6 @@
// Boost.Geometry
-// Copyright (c) 2016 Oracle and/or its affiliates.
+// Copyright (c) 2016-2017 Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -169,7 +169,8 @@ public:
{
CT const sigma2 = S_sigma - sigma1;
//theta2 = asin(cos(sigma2)) <=> sin_theta0 = 1
- CT const tan_theta2 = cos(sigma2) / sin(sigma2);
+ // NOTE: cos(sigma2) defines the sign of tan_theta2
+ CT const tan_theta2 = cos(sigma2) / math::abs(sin(sigma2));
result.lat2 = atan(tan_theta2 / one_minus_f);
}
@@ -177,7 +178,7 @@ public:
{
result.lat2 = -result.lat2;
}
- }
+ }
if (BOOST_GEOMETRY_CONDITION(CalcQuantities))
{