diff --git a/source/include/math_helper.h b/source/include/math_helper.h index 65098b3..cbc4d66 100644 --- a/source/include/math_helper.h +++ b/source/include/math_helper.h @@ -10,7 +10,11 @@ #ifndef DORAYME_MATH_HELPER_H #define DORAYME_MATH_HELPER_H +#include + void set_equal_precision(double v); bool double_equal(double a, double b); +double deg_to_rad(double deg); + #endif //DORAYME_MATH_HELPER_H diff --git a/source/math_helper.cpp b/source/math_helper.cpp index 4ce2a0b..478e305 100644 --- a/source/math_helper.cpp +++ b/source/math_helper.cpp @@ -22,3 +22,8 @@ bool double_equal(double a, double b) { return fabs(a - b) < current_precision; } + +double deg_to_rad(double deg) +{ + return deg * M_PI / 180.; +} \ No newline at end of file