Add absolute, radians and degrees math utilities
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
#include "math_utils.h"
|
||||
#include <math.h>
|
||||
|
||||
i32 min(i32 a, i32 b) { return a <= b ? a : b; }
|
||||
|
||||
i32 max(i32 a, i32 b) { return a >= b ? a : b; }
|
||||
|
||||
f64 radians(f64 degrees) { return degrees * M_PI / 180.0; }
|
||||
|
||||
f64 degrees(f64 radians) { return radians * 180.0 / M_PI; }
|
||||
|
Reference in New Issue
Block a user