From 200c86b91ea7063d35be3bffc11c5da53c054653 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 18 Aug 2014 18:17:11 -0400 Subject: Move some headers around and make new ones. --- libdimension/dimension/geometry.h | 74 --------------------------------------- 1 file changed, 74 deletions(-) (limited to 'libdimension/dimension/geometry.h') diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h index 811f591..2ea10ca 100644 --- a/libdimension/dimension/geometry.h +++ b/libdimension/dimension/geometry.h @@ -82,9 +82,6 @@ typedef struct dmnsn_bounding_box { /* Constants */ -/** The smallest value considered non-zero by some numerical algorithms. */ -#define dmnsn_epsilon 1.0e-10 - /** The zero vector. */ static const dmnsn_vector dmnsn_zero = { 0.0, 0.0, 0.0 }; /** The x vector. */ @@ -94,66 +91,6 @@ static const dmnsn_vector dmnsn_y = { 0.0, 1.0, 0.0 }; /** The z vector. */ static const dmnsn_vector dmnsn_z = { 0.0, 0.0, 1.0 }; -/** - * @def DMNSN_INFINITY - * Expands to floating-point infinity. - */ -#if defined(INFINITY) || DMNSN_C99 - #define DMNSN_INFINITY INFINITY -#else - #define DMNSN_INFINITY HUGE_VAL -#endif - -/* Scalar functions */ - -/** Find the minimum of two scalars. */ -DMNSN_INLINE double -dmnsn_min(double a, double b) -{ - return a < b ? a : b; -} - -/** Find the maximum of two scalars. */ -DMNSN_INLINE double -dmnsn_max(double a, double b) -{ - return a > b ? a : b; -} - -/** Clamp a value to an interval. */ -DMNSN_INLINE double -dmnsn_clamp(double n, double min, double max) -{ - return dmnsn_min(dmnsn_max(n, min), max); -} - -/** Convert degrees to radians. */ -DMNSN_INLINE double -dmnsn_radians(double degrees) -{ - return degrees*atan(1.0)/45.0; -} - -/** Convert radians to degrees. */ -DMNSN_INLINE double -dmnsn_degrees(double radians) -{ - return radians*45.0/atan(1.0); -} - -/** Return the sign of a scalar. */ -DMNSN_INLINE int -dmnsn_sign(double n) -{ - if (n > 0.0) { - return 1; - } else if (n < 0.0) { - return -1; - } else { - return 0; - } -} - /* Shorthand for vector/matrix construction */ /** Construct a new vector. */ @@ -526,17 +463,6 @@ dmnsn_bounding_box_swallow(dmnsn_bounding_box box, dmnsn_vector point) return ret; } -/** Return whether a scalar is NaN. */ -DMNSN_INLINE bool -dmnsn_isnan(double n) -{ -#if DMNSN_C99 - return isnan(n); -#else - return n != n; -#endif -} - /** Return whether a vector contains any NaN components. */ DMNSN_INLINE bool dmnsn_vector_isnan(dmnsn_vector v) -- cgit v1.2.3