diff --git a/MMVII/include/MMVII_nums.h b/MMVII/include/MMVII_nums.h index b804c3d4a4..4494136ca1 100755 --- a/MMVII/include/MMVII_nums.h +++ b/MMVII/include/MMVII_nums.h @@ -70,6 +70,7 @@ double RandUnif_N(int aN); ///< Uniform disrtibution in [0,N[ double RandUnif_C_NotNull(double aEps); ///< Uniform distribution in -1 1, but abs > aEps double RandUnif_NotNull(double aEps); ///< Uniform distribution in 0 1, but abs > aEps double RandInInterval(double a,double b); ///< Uniform distribution in [a,b] +double RandInInterval(const cPt2dr &interval); ///< Uniform distribution in [interval.x,interval.y] /** Class for mapping object R->R */ class cFctrRR diff --git a/MMVII/src/UtiMaths/uti_rand.cpp b/MMVII/src/UtiMaths/uti_rand.cpp index 337ddab56a..b7f6b7920b 100755 --- a/MMVII/src/UtiMaths/uti_rand.cpp +++ b/MMVII/src/UtiMaths/uti_rand.cpp @@ -203,6 +203,10 @@ double RandInInterval(double a,double b) return b+ (a-b) * RandUnif_0_1() ; } +double RandInInterval(const cPt2dr &interval) +{ + return RandInInterval(interval.x(), interval.y()); +} double RandUnif_C_NotNull(double aEps) {