From dacf1f40aca88596cedbaeacc6a8d194ff32b15e Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Tue, 28 Feb 2012 18:54:39 +0900 Subject: [PATCH] 3.14... -> math::pi() --- sprout/darkroom/objects/sphere.hpp | 7 +++---- sprout/index_tuple.hpp | 5 +---- sprout/random/normal_distribution.hpp | 10 +++++++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sprout/darkroom/objects/sphere.hpp b/sprout/darkroom/objects/sphere.hpp index d8fead33..ac4765dd 100644 --- a/sprout/darkroom/objects/sphere.hpp +++ b/sprout/darkroom/objects/sphere.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -52,8 +53,6 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR std::size_t point_of_intersection = 0; SPROUT_STATIC_CONSTEXPR std::size_t normal = 1; }; - private: - SPROUT_STATIC_CONSTEXPR unit_type pi = 3.1415926535897932384626433832795; private: position_type pos_; radius_type rad_; @@ -156,7 +155,7 @@ namespace sprout { sprout::darkroom::coords::z(normal), sprout::darkroom::coords::x(normal) ) - / pi + / sprout::math::pi() , atan2( sprout::darkroom::coords::y(normal), @@ -165,7 +164,7 @@ namespace sprout { + sprout::darkroom::coords::z(normal) * sprout::darkroom::coords::z(normal) ) ) - / (pi / 2) + / sprout::math::pi_div_two() ) ); } diff --git a/sprout/index_tuple.hpp b/sprout/index_tuple.hpp index 356dd0bc..73846305 100644 --- a/sprout/index_tuple.hpp +++ b/sprout/index_tuple.hpp @@ -156,10 +156,7 @@ namespace sprout { > {}; } // namespace detail - template< - sprout::index_t I, - std::size_t N - > + template struct index_n : public sprout::detail::index_n_impl {}; diff --git a/sprout/random/normal_distribution.hpp b/sprout/random/normal_distribution.hpp index 61b7ec23..03569d34 100644 --- a/sprout/random/normal_distribution.hpp +++ b/sprout/random/normal_distribution.hpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -22,8 +23,6 @@ namespace sprout { typedef RealType result_type; private: struct private_constructor_tag {}; - private: - SPROUT_STATIC_CONSTEXPR result_type pi = result_type(3.14159265358979323846); private: static SPROUT_CONSTEXPR bool arg_check_nothrow(RealType mean_arg, RealType sigma_arg) { return sigma_arg >= RealType(0); @@ -125,7 +124,12 @@ namespace sprout { using std::sin; using std::cos; return sprout::random::random_result( - cached_rho * (valid ? cos(result_type(2) * pi * r1) : sin(result_type(2) * pi * r1)) * sigma_ + mean_, + cached_rho + * (valid + ? cos(result_type(2) * sprout::math::pi() * r1) + : sin(result_type(2) * sprout::math::pi() * r1) + ) + * sigma_ + mean_, eng, normal_distribution( mean_,