
* apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc, * apps/mesh-segm-skel/mesh-complex-max-curv.cc: Here. --- milena/ChangeLog | 8 ++++++++ milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc | 10 ++++------ milena/apps/mesh-segm-skel/mesh-complex-max-curv.cc | 7 ++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 77442f1..4a827d3 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,11 @@ +2013-08-28 Roland Levillain <roland@lrde.epita.fr> + + Fix Pi usage in Milena's apps. + + * apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc, + * apps/mesh-segm-skel/mesh-complex-max-curv.cc: + Here. + 2013-08-27 Roland Levillain <roland@lrde.epita.fr> Use mln::math::pi instead of a local definition in Milena. diff --git a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc index 9a00dad..d2c627f 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-max-curv-segm.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2008, 2009, 2011 EPITA Research and Development +// Copyright (C) 2008, 2009, 2011, 2013 EPITA Research and Development // Laboratory (LRDE) // // This file is part of Olena. @@ -41,6 +41,7 @@ #include <mln/morpho/closing/area.hh> #include <mln/morpho/watershed/flooding.hh> +#include <mln/math/pi.hh> #include <mln/math/max.hh> #include <mln/math/sqr.hh> @@ -52,10 +53,6 @@ #include "misc.hh" -// Doesn't C++ have a better way to express Pi? -static const float pi = 4 * atanf(1); - - int main(int argc, char* argv[]) { if (argc != 4) @@ -91,7 +88,8 @@ int main(int argc, char* argv[]) { float h = (curv.first(v) + curv.second(v)) / 2; // Pseudo-inverse curvature. - float h_inv = 1 / pi * (atan(-h) + pi / 2); + float h_inv = + 1 / float(mln::math::pi) * (atanf(-h) + float(mln::math::pi) / 2); input(v) = h_inv; // FIXME: The program should allow the user to choose the kind // of measure. diff --git a/milena/apps/mesh-segm-skel/mesh-complex-max-curv.cc b/milena/apps/mesh-segm-skel/mesh-complex-max-curv.cc index 85a0adc..89bc50f 100644 --- a/milena/apps/mesh-segm-skel/mesh-complex-max-curv.cc +++ b/milena/apps/mesh-segm-skel/mesh-complex-max-curv.cc @@ -1,4 +1,5 @@ -// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2008, 2009, 2013 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -54,10 +55,6 @@ #include "misc.hh" -// Doesn't C++ have a better way to express Pi? -static const float pi = 4 * atanf(1); - - int main(int argc, char* argv[]) { if (argc != 3) -- 1.7.10.4