Add random::uniform_angle
This commit is contained in:
parent
57fb1e8f1f
commit
824a15c921
1 changed files with 8 additions and 0 deletions
|
|
@ -3,6 +3,8 @@
|
|||
#include <psemek/random/uniform_int.hpp>
|
||||
#include <psemek/random/uniform_real.hpp>
|
||||
|
||||
#include <psemek/geom/constants.hpp>
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace psemek::random
|
||||
|
|
@ -23,4 +25,10 @@ namespace psemek::random
|
|||
return uniform<T>(rng, {min, max});
|
||||
}
|
||||
|
||||
template <typename T, typename RNG>
|
||||
T uniform_angle(RNG && rng)
|
||||
{
|
||||
return uniform(rng, T{0}, T{2 * geom::pi});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue