summaryrefslogtreecommitdiffstats
path: root/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-04 16:18:50 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-04 16:18:50 -0600
commit4b7df6a2685fe973d9d31d884407df4f669b5606 (patch)
tree2357a5c33a4e2db6f6ed476088ab2a02b58aaf16 /libdimension
parent3a4da35d5c52d13a5353c6779213505aa862b371 (diff)
downloaddimension-4b7df6a2685fe973d9d31d884407df4f669b5606.tar.xz
Add dmnsn_{min,max}() inlines.
Diffstat (limited to 'libdimension')
-rw-r--r--libdimension/dimension/geometry.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h
index a7ff32c..20a006c 100644
--- a/libdimension/dimension/geometry.h
+++ b/libdimension/dimension/geometry.h
@@ -52,6 +52,20 @@ static const dmnsn_vector dmnsn_x = { 1.0, 0.0, 0.0 };
static const dmnsn_vector dmnsn_y = { 0.0, 1.0, 0.0 };
static const dmnsn_vector dmnsn_z = { 0.0, 0.0, 1.0 };
+/* Min/max macros */
+
+DMNSN_INLINE double
+dmnsn_min(double a, double b)
+{
+ return a < b ? a : b;
+}
+
+DMNSN_INLINE double
+dmnsn_max(double a, double b)
+{
+ return a > b ? a : b;
+}
+
/* Shorthand for vector/matrix construction */
DMNSN_INLINE dmnsn_vector