[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN so3.h internal/config.hh
From: |
Qi Pan |
Subject: |
[Toon-members] TooN so3.h internal/config.hh |
Date: |
Thu, 01 Apr 2010 13:02:05 +0000 |
CVSROOT: /sources/toon
Module name: TooN
Changes by: Qi Pan <qpan> 10/04/01 13:02:05
Modified files:
. : so3.h
internal : config.hh
Log message:
SO3 constructor using 2 Vectors: added an assert fail for the ambiguous
case of Vectors pointing in exactly opposite directions instead of just
returning Identity
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/TooN/so3.h?cvsroot=toon&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/TooN/internal/config.hh?cvsroot=toon&r1=1.23&r2=1.24
Patches:
Index: so3.h
===================================================================
RCS file: /sources/toon/TooN/so3.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- so3.h 1 Feb 2010 17:33:18 -0000 1.43
+++ so3.h 1 Apr 2010 13:02:05 -0000 1.44
@@ -69,6 +69,7 @@
/// creates an SO3 as a rotation that takes Vector a into the direction
of Vector b
/// with the rotation axis along a ^ b. If |a ^ b| == 0, it creates the
identity rotation.
+ /// An assertion will fail if Vector a and Vector b are in exactly
opposite directions.
/// @param a source Vector
/// @param b target Vector
template <int S1, int S2, typename P1, typename P2, typename A1,
typename A2>
@@ -77,6 +78,9 @@
SizeMismatch<3,S2>::test(3, b.size());
Vector<3, Precision> n = a ^ b;
if(norm_sq(n) == 0) {
+ //check that the vectors are in the same direction if
cross product is 0. If not,
+ //this means that the rotation is 180 degrees, which
leads to an ambiguity in the rotation axis.
+ assert(a*b>=0);
my_matrix = Identity;
return;
}
Index: internal/config.hh
===================================================================
RCS file: /sources/toon/TooN/internal/config.hh,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- internal/config.hh 1 Feb 2010 16:27:06 -0000 1.23
+++ internal/config.hh 1 Apr 2010 13:02:05 -0000 1.24
@@ -1 +1,14 @@
+/* internal/config.hh. Generated from config.hh.in by configure. */
+/* #undef TOON_TYPEOF_DECLTYPE */
+/* #undef TOON_TYPEOF_TYPEOF */
+
+#define TOON_TYPEOF___TYPEOF__ 1
+
+/* #undef TOON_TYPEOF_BOOST */
+
+/* #undef TOON_TYPEOF_BUILTIN */
+
+#define TOON_DEPRECATED_GCC 1
+
+#define TOON_USE_LAPACK 1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Toon-members] TooN so3.h internal/config.hh,
Qi Pan <=