FromTwoVectors()
Returns a quaternion representing a rotation between the two arbitrary vectors a and b. In other words, the built rotation represent a rotation sending the line of direction a to the line of direction b, both lines passing through the origin.
Note that the two input vectors do not have to be normalized, and do not need to have the same norm.
举例:
Eigen::Vector3d v1{0,0,1};
Eigen::Vector3d v2{1,1,sqrt(2)};
Eigen::Matrix3d R;
R = Eigen::Quaterniond::FromTwoVectors(v1,v2).toRotationMatrix();
cout<<"RotatationMatrix is :"<<endl<<R<<endl;
cout<<"R*v1="<<endl<<R*v1<<endl;
返回的旋转矩阵是R*v1 = v2.