Sat, 12 Jul 2025 22:28:30 +0200
add conversion functions between degrees and radians
src/ascension/datatypes.h | file | annotate | diff | comparison | revisions |
--- a/src/ascension/datatypes.h Sat Jul 12 22:06:24 2025 +0200 +++ b/src/ascension/datatypes.h Sat Jul 12 22:28:30 2025 +0200 @@ -205,6 +205,14 @@ return ASC_VEC2I(rect.pos.x + rect.size.width/2, rect.pos.y + rect.size.height/2); } +static inline float asc_rad(float angle) { + return angle * 3.14159265358979323846f / 180.f; +} + +static inline float asc_deg(float rads) { + return rads * 180.f / 3.14159265358979323846f; +} + /** * Converts a float color (0.0f to 1.0f) to an int color (0 to 255). *