From 9699b4909891d2bbba7a6dd84bda2bf2ec8ef511 Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Wed, 27 Jun 2018 10:34:18 +0500 Subject: [PATCH] [util][formulas] Rename normalize_angle function to normalize_azimuth For normalizing longitudes, the normalize_longitude function is used instead. --- include/boost/geometry/formulas/karney_direct.hpp | 8 ++++---- .../geometry/util/normalize_spheroidal_coordinates.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/geometry/formulas/karney_direct.hpp b/include/boost/geometry/formulas/karney_direct.hpp index 6de8a262f..95e4040ca 100644 --- a/include/boost/geometry/formulas/karney_direct.hpp +++ b/include/boost/geometry/formulas/karney_direct.hpp @@ -80,7 +80,7 @@ public: CT const lat1 = la1; Azi azi12 = azimuth12; - math::normalize_angle(azi12); + math::normalize_azimuth(azi12); Dist const dist_c0 = 0; @@ -114,7 +114,7 @@ public: math::normalize_values(sin_beta1, cos_beta1); - cos_beta1 = std::max(math::sqrt(c0), cos_beta1); + cos_beta1 = (std::max)(c0, cos_beta1); // Obtain alpha 0 by solving the spherical triangle. CT const sin_alpha0 = sin_alpha1 * cos_beta1; @@ -216,8 +216,8 @@ public: // Add the longitude at first point to the longitudinal // difference and normalize the result. - math::normalize_angle(lon1); - math::normalize_angle(lon12); + math::normalize_longitude(lon1); + math::normalize_longitude(lon12); result.lon2 = lon1 + lon12; } diff --git a/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp b/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp index 516bdb332..866509dc6 100644 --- a/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp +++ b/include/boost/geometry/util/normalize_spheroidal_coordinates.hpp @@ -365,15 +365,15 @@ inline void normalize_longitude(CoordinateType& longitude) } /*! -\brief Short utility to normalize an angle on a spheroid - normalized in range (-180, 180]. +\brief Short utility to normalize the azimuth on a spheroid + in the range (-180, 180]. \tparam Units The units of the coordindate system in the spheroid \tparam CoordinateType The type of the coordinates \param angle Angle \ingroup utility */ template -inline void normalize_angle(CoordinateType& angle) +inline void normalize_azimuth(CoordinateType& angle) { normalize_longitude(angle); }