angularDistance accuracy
Submitted by Michael Norel
Assigned to Nobody
Link to original bugzilla bug (#824)
Version: 3.2
Description
using "acos" function near 1.0 provides a terrible inaccuracy in result angle. Small inacuracy of dot product or quaternion length produce awesome angle error.
I recommend to use atan2 function having good accuracy in whole range
fix can look like
{
using std::atan2;
const QuaternionBase<OtherDerived> d = *this * other.conjugate();
return static_cast<Scalar>( Scalar(2) * atan2( d.vec().norm(), d.w() ));
}
Edited by Eigen Bugzilla