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

Introduce a 2d specialization for Rotation

[[Imported from SVN: r5492]]
parent 82ebd929
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,42 @@ class Rotation ...@@ -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 /** \brief Specialization for dim==3
Uses unit quaternion coordinates. Uses unit quaternion coordinates.
...@@ -446,4 +482,6 @@ public: ...@@ -446,4 +482,6 @@ public:
}; };
#endif #endif
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