I have two 3x3 rotation matrices as:
Eigen::Matrix3d a;
a = Eigen::AngleAxisd(0.25*M_PI, Eigen::Vector3d::UnitX())
* Eigen::AngleAxisd(0.45*M_PI, Eigen::Vector3d::UnitY())
* Eigen::AngleAxisd(0.0, Eigen::Vector3d::UnitZ());
Eigen::Matrix3d b;
a = Eigen::AngleAxisd(0.25*M_PI, Eigen::Vector3d::UnitX())
* Eigen::AngleAxisd(0.0, Eigen::Vector3d::UnitY())
* Eigen::AngleAxisd(0.25*M_PI, Eigen::Vector3d::UnitZ());
I would like to find the 3x3 matrix c where a*c = b.
I calculate the angle axis of both rotations like this:
Eigen::AngleAxisd angleAxisA(a);
Eigen::AngleAxisd angleAxisB(b);
Now I know that I have an angle a.angle() and a Vector3d axis a.axis().
From here I do not know what to do. Can someone suggest how I can go from here please?
It's a 3x3 matrix. You can simply invert it to solve the equation system.
a*c = b --> c = a^-1 * b.Yes.
Mathematically, inverting an
AngleAxisis simple enough (just negate the angle). But multiplying twoAngleAxisis non-trivial. It converts to aQuaternionand multiplies those. The conversion involves transcendental function calls. Try to avoid needless conversions.