From af32afb5548917b446f7b5c889178cb223ef601a Mon Sep 17 00:00:00 2001 From: David Mikos Date: Tue, 29 Jan 2008 11:31:27 +1030 Subject: Replace PI, etc. with constants from math.h. --- snowglobe-internal.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/snowglobe-internal.h b/snowglobe-internal.h index 1e68d2a..af082ac 100644 --- a/snowglobe-internal.h +++ b/snowglobe-internal.h @@ -1,16 +1,6 @@ #ifndef _SNOWGLOBE_INTERNAL_H #define _SNOWGLOBE_INTERNAL_H -#define RAD 57.296 -#define RRAD 0.01745 - -/* some constants */ -#define PI 3.14159265358979323846 -#define PIdiv2 1.57079632679489661923 -#define toDegrees 57.2957795130823208768 -#define toRadians 0.01745329251994329577 - - #define LRAND() ((long) (random() & 0x7fffffff)) #define NRAND(n) ((int) (LRAND() % (n))) #define MAXRAND (2147483648.0) /* unsigned 1<<31 as a float */ @@ -19,6 +9,12 @@ #include #include +/* some constants */ +#define PI M_PI +#define PIdiv2 M_PI_2 +#define toDegrees (180.0f * M_1_PI) +#define toRadians (M_PI / 180.0f) + //return random number in range [0,x) #define randf(x) ((float) (rand()/(((double)RAND_MAX + 1)/(x)))) -- cgit v1.1