diff options
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 86d98ad..b6e90d2 100644 --- a/src/common.h +++ b/src/common.h @@ -178,4 +178,11 @@ static inline void mst2_dump(mst2_t M) printf("[%f\t%f\t%f]\n", 0.0, 0.0, 1.0); } +static inline float remap(float x, float a0, float b0, float a1, float b1) +{ + return (x - a0) * (b1 - a1) / (b0 - a0) + a1; +} + +#define DEG2RAD(x) ((x) / (180.0f / M_PI)) + #endif // _COMMON_H |