Revision: 45774
http://brlcad.svn.sourceforge.net/brlcad/?rev=45774&view=rev
Author: brlcad
Date: 2011-08-03 19:04:32 +0000 (Wed, 03 Aug 2011)
Log Message:
-----------
add missing zero macros, HNEAR_ZERO(), VZERO(), V2ZERO(), & HZERO()
Modified Paths:
--------------
brlcad/trunk/include/vmath.h
Modified: brlcad/trunk/include/vmath.h
===================================================================
--- brlcad/trunk/include/vmath.h 2011-08-03 18:24:53 UTC (rev 45773)
+++ brlcad/trunk/include/vmath.h 2011-08-03 19:04:32 UTC (rev 45774)
@@ -299,13 +299,22 @@
&& NEAR_ZERO(v[Z], tol))
/**
- * @brief Test for all elements of `v' being smaller than `tol'.
+ * Test for all elements of `v' being smaller than `tol'.
* Version for degree 2 vectors.
*/
#define V2NEAR_ZERO(v, tol) (NEAR_ZERO(v[X], tol) && NEAR_ZERO(v[Y], tol))
-/* FIXME: need HNEAR_ZERO */
+/**
+ * Test for all elements of `v' being smaller than `tol'.
+ * Version for degree 2 vectors.
+ */
+#define HNEAR_ZERO(v, tol) \
+ (NEAR_ZERO(v[X], tol) \
+ && NEAR_ZERO(v[Y], tol) \
+ && NEAR_ZERO(v[Z], tol) \
+ && NEAR_ZERO(h[W], tol))
+
/**
* Return truthfully whether a value is within a minimum
* representation tolerance from zero.
@@ -314,8 +323,32 @@
*/
#define ZERO(_a) NEAR_ZERO((_a), SMALL_FASTF)
+/**
+ * Return truthfully whether a vector is within a minimum
+ * representation tolerance from zero.
+ *
+ * Use not recommended due to compilation-variant tolerance.
+ */
+#define VZERO(_a) VNEAR_ZERO((_a), SMALL_FASTF)
/**
+ * Return truthfully whether a 2d vector is within a minimum
+ * representation tolerance from zero.
+ *
+ * Use not recommended due to compilation-variant tolerance.
+ */
+#define V2ZERO(_a) V2NEAR_ZERO((_a), SMALL_FASTF)
+
+/**
+ * Return truthfully whether a homogenized 4-element vector is within
+ * a minimum representation tolerance from zero.
+ *
+ * Use not recommended due to compilation-variant tolerance.
+ */
+#define HZERO(_a) HNEAR_ZERO((_a), SMALL_FASTF)
+
+
+/**
* Return truthfully whether two values are within a specified epsilon
* distance from each other.
*/
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits