Can I use the Eigen library to get the rotation matrix which rotates vector A to vector B? I have been searching for a while, but cannot find related api.
You first have to construct a quaternion and then convert it to a matrix, for instance:
#include using namespace Eigen; int main() { Vector3f A, B; Matrix3f R; R = Quaternionf().setFromTwoVectors(A,B); }