Let's introduce two quaternions qStart
and qEnd
. Magnitude of rotation between them can be expressed as a quaternion:
qRot = qEnd * qStart.inversed();
and the exact angle of rotation can be extracted as:
2*atan2(qRot.vec.length(), qRot.w);