summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/geometry.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-26 15:42:13 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-26 15:42:13 -0400
commit0075e0c37d9c33ed00e4308e6444b61b204327ba (patch)
tree4c112619d917fc8374715bde8ce4e4f0e6723892 /libdimension/dimension/geometry.h
parent1fba91c6fe9115be67929ce1e247dd759a21fcd1 (diff)
downloaddimension-0075e0c37d9c33ed00e4308e6444b61b204327ba.tar.xz
Add numerical polynomial solver based on Uspensky's algorithm.
Diffstat (limited to 'libdimension/dimension/geometry.h')
-rw-r--r--libdimension/dimension/geometry.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h
index 87e7ab7..4c4f8b8 100644
--- a/libdimension/dimension/geometry.h
+++ b/libdimension/dimension/geometry.h
@@ -96,6 +96,13 @@ dmnsn_degrees(double radians)
return radians*45.0/atan(1.0);
}
+DMNSN_INLINE int
+dmnsn_signbit(double n)
+{
+ /* Guarantee a 1 or 0 return, to allow testing two signs for equality */
+ return signbit(n) ? 1 : 0;
+}
+
/* Shorthand for vector/matrix construction */
DMNSN_INLINE dmnsn_vector