Get rid of boost::math::constants::* in favor of std::numbers
This commit is contained in:
parent
2adbf35ffe
commit
f8054c1b88
@ -22,6 +22,7 @@
|
||||
- NodeJS:
|
||||
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
|
||||
- Misc:
|
||||
- CHANGED: Get rid of boost::math::constants::* and M_PI in favor of std::numbers. [#6916](https://github.com/Project-OSRM/osrm-backend/pull/6916)
|
||||
- CHANGED: Use std::variant instead of mapbox::util::variant. [#6903](https://github.com/Project-OSRM/osrm-backend/pull/6903)
|
||||
- CHANGED: Bump rapidjson to version f9d53419e912910fd8fa57d5705fa41425428c35 [#6906](https://github.com/Project-OSRM/osrm-backend/pull/6906)
|
||||
- CHANGED: Bump mapbox/variant to version 1.2.0 [#6898](https://github.com/Project-OSRM/osrm-backend/pull/6898)
|
||||
|
@ -25,7 +25,7 @@ const constexpr long double EARTH_RADIUS = 6372797.560856;
|
||||
|
||||
inline double degToRad(const double degree) { return degree * (std::numbers::pi / 180.0); }
|
||||
|
||||
inline double radToDeg(const double radian) { return radian * (180.0 * (1. / std::numbers::pi)); }
|
||||
inline double radToDeg(const double radian) { return radian * (180.0 * std::numbers::inv_pi); }
|
||||
} // namespace detail
|
||||
|
||||
const constexpr static double METERS_PER_DEGREE_LAT = 110567.0;
|
||||
|
@ -359,7 +359,7 @@ constexpr unsigned short atan_table[4096] = {
|
||||
#ifdef _MSC_VER // TODO: remove as soon as boost allows C++14 features with Visual Studio
|
||||
const constexpr double SCALING_FACTOR = 4. / M_PI * 0xFFFF;
|
||||
#else
|
||||
const constexpr double SCALING_FACTOR = 4. / std::numbers::pi * 0xFFFF;
|
||||
const constexpr double SCALING_FACTOR = 4. * std::numbers::inv_pi * 0xFFFF;
|
||||
#endif
|
||||
|
||||
inline double atan2_lookup(double y, double x)
|
||||
|
@ -162,7 +162,7 @@ double computeAngle(const Coordinate first, const Coordinate second, const Coord
|
||||
const double v2y =
|
||||
web_mercator::latToY(toFloating(third.lat)) - web_mercator::latToY(toFloating(second.lat));
|
||||
|
||||
double angle = (atan2_lookup(v2y, v2x) - atan2_lookup(v1y, v1x)) * 180. / std::numbers::pi;
|
||||
double angle = (atan2_lookup(v2y, v2x) - atan2_lookup(v1y, v1x)) * 180. * std::numbers::inv_pi;
|
||||
|
||||
while (angle < 0.)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user