#include <iostream>
#include <Eigen/Dense>
#include <Eigen/Geometry>
using namespace std;
using namespace Eigen;
int main()
{
Rotation2D<float>::Vector2 b;
b<<1,0;
Rotation2D<float> rot2(30/180.0*3.14);
cout<<rot2.toRotationMatrix()*b<<endl;
}
上述代码把一个点(1,0)逆时针旋转30度,新坐标为(0.866158,0.49977)