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

introduce and use constructor from a single scalar

[[Imported from SVN: r1702]]
parent ba2cebf6
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,9 @@ public: ...@@ -30,6 +30,9 @@ public:
} }
/** \brief Constructor from a single scalar */
Quaternion(const T& a) : Dune::FieldVector<T,4>(a) {}
/** \brief Copy constructor */ /** \brief Copy constructor */
Quaternion(const Dune::FieldVector<T,4>& other) : Dune::FieldVector<T,4>(other) {} Quaternion(const Dune::FieldVector<T,4>& other) : Dune::FieldVector<T,4>(other) {}
...@@ -396,7 +399,7 @@ public: ...@@ -396,7 +399,7 @@ public:
/** \brief Interpolate between two rotations */ /** \brief Interpolate between two rotations */
static Quaternion<T> interpolateDerivative(const Quaternion<T>& a, const Quaternion<T>& b, static Quaternion<T> interpolateDerivative(const Quaternion<T>& a, const Quaternion<T>& b,
double omega, double intervallLength) { double omega, double intervallLength) {
Quaternion<T> result; Quaternion<T> result(0);
// Compute difference on T_a SO(3) // Compute difference on T_a SO(3)
Dune::FieldVector<double,3> v = difference(a,b); Dune::FieldVector<double,3> v = difference(a,b);
...@@ -413,7 +416,6 @@ public: ...@@ -413,7 +416,6 @@ public:
Dune::FieldMatrix<double,4,3> diffExp = Quaternion<double>::Dexp(v); Dune::FieldMatrix<double,4,3> diffExp = Quaternion<double>::Dexp(v);
result[0] = result[1] = result[2] = result[3] = 0;
diffExp.umv(der,result); diffExp.umv(der,result);
return a.mult(result); return a.mult(result);
......
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