diff --git a/src/rotation.hh b/src/rotation.hh index 5bc357e79d87600d6a31cc57c5ec512b1211c8f9..e1376707e9c44d666ff138d791d131ed233452b7 100644 --- a/src/rotation.hh +++ b/src/rotation.hh @@ -19,6 +19,42 @@ class Rotation }; +/** \brief Specialization for dim==2 +*/ +template <class T> +class Rotation<2,T> +{ +public: + /** \brief Member of the corresponding Lie algebra. This really is a skew-symmetric matrix */ + typedef Dune::FieldVector<T,1> TangentVector; + + /** \brief Default constructor, create the identity rotation */ + Rotation() + : angle_(0) + {} + + /** \brief Return the identity element */ + static Rotation<2,T> identity() { + // Default constructor creates an identity + Rotation<2,T> id; + return id; + } + + /** \brief The exponential map from a given point $p \in SO(3)$. */ + static Rotation<2,T> exp(const Rotation<2,T>& p, const TangentVector& v) { + Rotation<2,T> result = p; + result.angle_ += v; + return result; + } + + + //private: + + // We store the rotation as an angle + double angle_; +}; + + /** \brief Specialization for dim==3 Uses unit quaternion coordinates. @@ -446,4 +482,6 @@ public: }; + + #endif