Skip to content
Snippets Groups Projects
Commit e49aa474 authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

Revert last patch---it was a bad idea.

Even though multiplication of Rotations is the same thing
as multiplication of Quaternions, in the first case the
output is a Rotation class, and in the second on a Quaternion
class.

[[Imported from SVN: r8343]]
parent dfe8f0f0
No related branches found
No related tags found
No related merge requests found
...@@ -208,6 +208,17 @@ public: ...@@ -208,6 +208,17 @@ public:
return id; return id;
} }
/** \brief Right multiplication */
Rotation<T,3> mult(const Rotation<T,3>& other) const {
Rotation<T,3> q;
q[0] = (*this)[3]*other[0] - (*this)[2]*other[1] + (*this)[1]*other[2] + (*this)[0]*other[3];
q[1] = (*this)[2]*other[0] + (*this)[3]*other[1] - (*this)[0]*other[2] + (*this)[1]*other[3];
q[2] = - (*this)[1]*other[0] + (*this)[0]*other[1] + (*this)[3]*other[2] + (*this)[2]*other[3];
q[3] = - (*this)[0]*other[0] - (*this)[1]*other[1] - (*this)[2]*other[2] + (*this)[3]*other[3];
return q;
}
/** \brief The exponential map from \f$ \mathfrak{so}(3) \f$ to \f$ SO(3) \f$ /** \brief The exponential map from \f$ \mathfrak{so}(3) \f$ to \f$ SO(3) \f$
*/ */
static Rotation<T,3> exp(const SkewMatrix<T,3>& v) { static Rotation<T,3> exp(const SkewMatrix<T,3>& v) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment