Skip to content

Commit

Permalink
RandInInterval(cPt2dr)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Oct 23, 2024
1 parent f3568fa commit f4bc76e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions MMVII/include/MMVII_nums.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions MMVII/src/UtiMaths/uti_rand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit f4bc76e

Please sign in to comment.