23 lines
331 B
C++
23 lines
331 B
C++
#ifndef UTIL_H
|
|
#define UTIL_H
|
|
|
|
static inline
|
|
float radians(const float degree) {
|
|
return degree * (M_PI / 180.0f);
|
|
}
|
|
|
|
static inline
|
|
Vector2 diff(Vector2 a, Vector2 b) {
|
|
return (Vector2) {
|
|
.x = a.x - b.x,
|
|
.y = a.y - b.y,
|
|
};
|
|
}
|
|
|
|
static inline
|
|
float signum(float x) {
|
|
return (x > 0) - (x < 0);
|
|
}
|
|
|
|
#endif
|