Feature #2056

Calculate scalar angle between orientations

Added by D. Wigand over 9 years ago.

Status:NewStart date:10/10/2014
Priority:LowDue date:
Assignee:-% Done:

0%

Category:Software
Target version:rci0.5

Description

OrientationPtr o1 = Orientation::fromEulerAngles(0, M_PI/4.0, 0);
OrientationPtr o2 = Orientation::fromEulerAngles(0, -M_PI/8.0, 0);

boost::math::quaternion<double> q1Conj = boost::math::quaternion<double>(o1->asQuaternion().R_component_1(), -1*o1->asQuaternion().R_component_2(), -1*o1->asQuaternion().R_component_3(), -1*o1->asQuaternion().R_component_4());
boost::math::quaternion<double> result = o2->asQuaternion() * q1Conj;

cout << 2*acos(result.R_component_1()) << endl;

Also available in: Atom PDF