From 824a15c9215e721e0a75edef5ad4d204907f0c87 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 23 Jul 2021 10:13:52 +0300 Subject: [PATCH] Add random::uniform_angle --- libs/random/include/psemek/random/uniform.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/random/include/psemek/random/uniform.hpp b/libs/random/include/psemek/random/uniform.hpp index 4446fd25..4bcf82cc 100644 --- a/libs/random/include/psemek/random/uniform.hpp +++ b/libs/random/include/psemek/random/uniform.hpp @@ -3,6 +3,8 @@ #include #include +#include + #include namespace psemek::random @@ -23,4 +25,10 @@ namespace psemek::random return uniform(rng, {min, max}); } + template + T uniform_angle(RNG && rng) + { + return uniform(rng, T{0}, T{2 * geom::pi}); + } + }