diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2016-04-06 02:55:02 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2016-04-06 02:55:02 +0200 |
commit | 85422fbdaf5c56ca817f0a8d8f17f2d725dd1c3a (patch) | |
tree | 99b5dd2dcb7a11c62ea76bf1efd15c41e01d349d /src/common.h | |
parent | 5659a1baba94d10f76e72c8bbb9fa7576ab4f19b (diff) |
Finish CSG, permittivity visualisation.
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 |