Line
Link Here
|
0 |
-- /tmp/tmplrsu9G-meld/Eigen/src/Geometry/Quaternion.h |
0 |
++ /home/strasdat/src/ScaViSLAM/EXTERNAL/eigen3.1/Eigen/src/Geometry/Quaternion.h |
Lines 545-552
Link Here
|
545 |
return derived(); |
545 |
return derived(); |
546 |
} |
546 |
} |
547 |
|
547 |
|
548 |
/** Convert the quaternion to a 3x3 rotation matrix. The quaternion is required to |
548 |
/** Convert the quaternion to a 3x3 rotation matrix. |
549 |
* be normalized, otherwise the result is undefined. |
549 |
* The quaternion is not required to be normalized. |
550 |
*/ |
550 |
*/ |
551 |
template<class Derived> |
551 |
template<class Derived> |
552 |
inline typename QuaternionBase<Derived>::Matrix3 |
552 |
inline typename QuaternionBase<Derived>::Matrix3 |
Lines 558-566
Link Here
|
558 |
// it has to be inlined, and so the return by value is not an issue |
558 |
// it has to be inlined, and so the return by value is not an issue |
559 |
Matrix3 res; |
559 |
Matrix3 res; |
560 |
|
560 |
|
561 |
const Scalar tx = Scalar(2)*this->x(); |
561 |
Scalar n2 = this->squaredNorm(); |
562 |
const Scalar ty = Scalar(2)*this->y(); |
562 |
if (n2 == 0) |
563 |
const Scalar tz = Scalar(2)*this->z(); |
563 |
{ |
|
|
564 |
res.setIdentity(); |
565 |
return res; |
566 |
} |
567 |
|
568 |
const Scalar two_by_squarednorm = 2./n2; |
569 |
const Scalar tx = two_by_squarednorm*this->x(); |
570 |
const Scalar ty = two_by_squarednorm*this->y(); |
571 |
const Scalar tz = two_by_squarednorm*this->z(); |
564 |
const Scalar twx = tx*this->w(); |
572 |
const Scalar twx = tx*this->w(); |
565 |
const Scalar twy = ty*this->w(); |
573 |
const Scalar twy = ty*this->w(); |
566 |
const Scalar twz = tz*this->w(); |
574 |
const Scalar twz = tz*this->w(); |