summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mikos <metastability@opencompositing.org>2008-01-29 11:31:27 +1030
committerDavid Mikos <metastability@opencompositing.org>2008-01-29 11:31:27 +1030
commitaf32afb5548917b446f7b5c889178cb223ef601a (patch)
treea9a0ccd70e351b67cad89c4b3db89f3e0f20ee9c
parent128fa75781bc4d917b091be482085dd465e3eea8 (diff)
downloadsnowglobe-af32afb5548917b446f7b5c889178cb223ef601a.tar.gz
snowglobe-af32afb5548917b446f7b5c889178cb223ef601a.tar.bz2
Replace PI, etc. with constants from math.h.
-rw-r--r--snowglobe-internal.h16
1 files 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 <math.h>
#include <float.h>
+/* 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))))