From 1122f0723e284b157f99c5c162bb10358df647a2 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Mon, 29 May 2006 14:40:54 +0000 Subject: [PATCH] added a method to create the identity [[Imported from SVN: r819]] --- src/quaternion.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/quaternion.hh b/src/quaternion.hh index 7728d625..5937ffc1 100644 --- a/src/quaternion.hh +++ b/src/quaternion.hh @@ -12,6 +12,16 @@ public: Quaternion() {} Quaternion(const Dune::FieldVector<T,4>& other) : Dune::FieldVector<T,4>(other) {} + /** \brief Return the identity element */ + static Quaternion<T> identity() { + Quaternion<T> id; + id[0] = 0; + id[1] = 0; + id[2] = 0; + id[3] = 1; + return id; + } + /** \brief The exponential map from \f$ \mathfrak{so}(3) \f$ to \f$ SO(3) \f$ */ static Quaternion<T> exp(const T& v0, const T& v1, const T& v2) { -- GitLab