From 85422fbdaf5c56ca817f0a8d8f17f2d725dd1c3a Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Wed, 6 Apr 2016 02:55:02 +0200 Subject: Finish CSG, permittivity visualisation. --- src/common.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/common.h') 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 -- cgit