aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-03-12 13:43:19 +0100
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-03-12 13:43:19 +0100
commit88aa18df641f8235c88661e41ea128f33d88a8f6 (patch)
treef95540cdf1fc6b1f8bdc8f6fd66a34c4bb13f670 /Eigen
parentbbc0ada12a3ae1531860205b7f1e21f991bb6273 (diff)
bug #759: Removed hard-coded double-math from Quaternion::angularDistance.
Some documentation improvements
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Geometry/Quaternion.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h
index 6ee0e4f75..a712692e5 100644
--- a/Eigen/src/Geometry/Quaternion.h
+++ b/Eigen/src/Geometry/Quaternion.h
@@ -204,6 +204,8 @@ class QuaternionBase : public RotationBase<Derived, 3>
* \li \c Quaternionf for \c float
* \li \c Quaterniond for \c double
*
+ * \warning Operations interpreting the quaternion as rotation have undefined behavior if the quaternion is not normalized.
+ *
* \sa class AngleAxis, class Transform
*/
@@ -345,7 +347,7 @@ class Map<const Quaternion<_Scalar>, _Options >
/** Constructs a Mapped Quaternion object from the pointer \a coeffs
*
- * The pointer \a coeffs must reference the four coeffecients of Quaternion in the following order:
+ * The pointer \a coeffs must reference the four coefficients of Quaternion in the following order:
* \code *coeffs == {x, y, z, w} \endcode
*
* If the template parameter _Options is set to #Aligned, then the pointer coeffs must be aligned. */
@@ -465,7 +467,7 @@ QuaternionBase<Derived>::_transformVector(Vector3 v) const
// Note that this algorithm comes from the optimization by hand
// of the conversion to a Matrix followed by a Matrix/Vector product.
// It appears to be much faster than the common algorithm found
- // in the litterature (30 versus 39 flops). It also requires two
+ // in the literature (30 versus 39 flops). It also requires two
// Vector3 as temporaries.
Vector3 uv = this->vec().cross(v);
uv += uv;
@@ -668,10 +670,10 @@ QuaternionBase<Derived>::angularDistance(const QuaternionBase<OtherDerived>& oth
{
using std::acos;
using std::abs;
- double d = abs(this->dot(other));
- if (d>=1.0)
+ Scalar d = abs(this->dot(other));
+ if (d>=Scalar(1))
return Scalar(0);
- return static_cast<Scalar>(2 * acos(d));
+ return Scalar(2) * acos(d);
}