]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/util/normalize_spheroidal_coordinates.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / geometry / util / normalize_spheroidal_coordinates.hpp
index e399965bbdbe8fa4e283dcaa1cc8582075d2eef5..e595f6c2c08dc3bb0454a32e8073551d5fb1e6b7 100644 (file)
@@ -2,7 +2,7 @@
 
 // Copyright (c) 2017 Adam Wulkiewicz, Lodz, Poland.
 
-// Copyright (c) 2015-2019, Oracle and/or its affiliates.
+// Copyright (c) 2015-2020, Oracle and/or its affiliates.
 
 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -314,6 +314,31 @@ public:
 };
 
 
+template <typename Units, typename CoordinateType>
+inline void normalize_angle_loop(CoordinateType& angle)
+{
+    typedef constants_on_spheroid<CoordinateType, Units> constants;
+    CoordinateType const pi = constants::half_period();
+    CoordinateType const two_pi = constants::period();
+    while (angle > pi)
+        angle -= two_pi;
+    while (angle <= -pi)
+        angle += two_pi;
+}
+
+template <typename Units, typename CoordinateType>
+inline void normalize_angle_cond(CoordinateType& angle)
+{
+    typedef constants_on_spheroid<CoordinateType, Units> constants;
+    CoordinateType const pi = constants::half_period();
+    CoordinateType const two_pi = constants::period();
+    if (angle > pi)
+        angle -= two_pi;
+    else if (angle <= -pi)
+        angle += two_pi;
+}
+
+
 } // namespace detail
 #endif // DOXYGEN_NO_DETAIL