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

Rename this to computeGeodesicDifference and add support for Rotation<3,double>

Todo: The target space should really be a template parameter!

[[Imported from SVN: r4028]]
parent 85d0a936
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#include "rigidbodymotion.hh" #include "rigidbodymotion.hh"
Dune::BlockVector<Dune::FieldVector<double,6> > computeRodDifference(const std::vector<RigidBodyMotion<3> >& a, Dune::BlockVector<Dune::FieldVector<double,6> > computeGeodesicDifference(const std::vector<RigidBodyMotion<3> >& a,
const std::vector<RigidBodyMotion<3> >& b) const std::vector<RigidBodyMotion<3> >& b)
{ {
if (a.size() != b.size()) if (a.size() != b.size())
DUNE_THROW(Dune::Exception, "a and b have to have the same length!"); DUNE_THROW(Dune::Exception, "a and b have to have the same length!");
...@@ -29,4 +29,22 @@ Dune::BlockVector<Dune::FieldVector<double,6> > computeRodDifference(const std:: ...@@ -29,4 +29,22 @@ Dune::BlockVector<Dune::FieldVector<double,6> > computeRodDifference(const std::
return result; return result;
} }
Dune::BlockVector<Dune::FieldVector<double,3> > computeGeodesicDifference(const std::vector<Rotation<3,double> >& a,
const std::vector<Rotation<3,double> >& b)
{
if (a.size() != b.size())
DUNE_THROW(Dune::Exception, "a and b have to have the same length!");
Dune::BlockVector<Dune::FieldVector<double,3> > result(a.size());
for (size_t i=0; i<result.size(); i++) {
// Subtract orientations on the tangent space of 'a'
result[i] = Rotation<3,double>::difference(a[i], b[i]);
}
return result;
}
#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