1 // Copyright 2017 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_NUMERICS_MATH_CONSTANTS_H_ 6 #define BASE_NUMERICS_MATH_CONSTANTS_H_ 7 8 namespace base { 9 10 constexpr double kPiDouble = 3.14159265358979323846; 11 constexpr float kPiFloat = 3.14159265358979323846f; 12 13 // pi/180 and 180/pi. These are correctly rounded from the true 14 // mathematical value, unlike what you'd get from e.g. 15 // 180.0f / kPiFloat. 16 constexpr double kDegToRadDouble = 0.017453292519943295769; 17 constexpr float kDegToRadFloat = 0.017453292519943295769f; 18 constexpr double kRadToDegDouble = 57.295779513082320876798; 19 constexpr float kRadToDegFloat = 57.295779513082320876798f; 20 21 // sqrt(1/2) = 1/sqrt(2). 22 constexpr double kSqrtHalfDouble = 0.70710678118654752440; 23 constexpr float kSqrtHalfFloat = 0.70710678118654752440f; 24 25 // The mean acceleration due to gravity on Earth in m/s^2. 26 constexpr double kMeanGravityDouble = 9.80665; 27 constexpr float kMeanGravityFloat = 9.80665f; 28 29 } // namespace base 30 31 #endif // BASE_NUMERICS_MATH_CONSTANTS_H_ 32