From 32d56fec977b109aeecb06288a1b45cfe6b83117 Mon Sep 17 00:00:00 2001 From: ozwaldorf Date: Wed, 1 Feb 2023 16:06:01 -0500 Subject: feat: border angle animations (#1469) Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com> --- src/helpers/MiscFunctions.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/helpers/MiscFunctions.cpp') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 1b0f9467..88e6fa51 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -518,3 +518,19 @@ int64_t configStringToInt(const std::string& VALUE) { } return std::stoll(VALUE); } + +double normalizeAngleRad(double ang) { + if (ang > M_PI * 2) { + while (ang > M_PI * 2) + ang -= M_PI * 2; + return ang; + } + + if (ang < 0.0) { + while (ang < 0.0) + ang += M_PI * 2; + return ang; + } + + return ang; +} \ No newline at end of file -- cgit v1.2.3