From: Mikko Rasa Date: Sun, 16 Jun 2019 12:30:50 +0000 (+0300) Subject: Use a different way of obtaining the value of pi X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b90bd4cd4fc8ea898912541ab48995117cecf174;p=libs%2Fdemoscene.git Use a different way of obtaining the value of pi M_PI is not strictly a part of the C++ standard. --- diff --git a/source/vignette.cpp b/source/vignette.cpp index e4d7de8..27b2dc1 100644 --- a/source/vignette.cpp +++ b/source/vignette.cpp @@ -27,7 +27,8 @@ void Vignette::set_optical(float pupil, float aperture) float p_sq = pupil*pupil; float a_sq = aperture*aperture; float two_ap = 2*pupil*aperture; - shdata.uniform("optical", pupil, aperture, a_sq, a_sq*M_PI); + static const float pi = Geometry::Angle::straight().radians(); + shdata.uniform("optical", pupil, aperture, a_sq, a_sq*pi); shdata.uniform("optical_range", p_sq-two_ap+a_sq, p_sq+two_ap+a_sq); }