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

geodesic distance

[[Imported from SVN: r4136]]
parent 1fc5de53
No related branches found
No related tags found
No related merge requests found
......@@ -241,6 +241,19 @@ public:
return APseudoInv;
}
static T distance(const Rotation<3,T>& a, const Rotation<3,T>& b) {
Quaternion<T> diff = a;
diff.invert();
diff = diff.mult(b);
// Compute the geodesical distance between a and b on SO(3)
// Due to numerical dirt, diff[3] may be larger than 1.
// In that case, use 1 instead of diff[3].
return (diff[3] > 1.0)
? 0
: 2*std::acos( std::min(diff[3],1.0) );
}
/** \brief Compute the vector in T_aSO(3) that is mapped by the exponential map
to the geodesic from a to b
......
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