给定一个点 P=(2,1), 将该点绕原点先逆时针旋转 45◦,再平移 (1,2), 计算出
变换后点的坐标(要求用齐次坐标进行计算)。
在这里插入代码片
```// TO DO: Define point P
Eigen::Vector3f P(2.0f,1.0f,1.0f);
std::cout << "P" <<P <<std::endl;
// TO DO: Define rotation matrix M
Eigen::Matrix3f M1,M2,M;
float pi = 3.14159265;
M1 << std::cos(45.0*pi/180.0),-std::sin(45.0*pi/180.0),0,std::sin(45.0*pi/180.0),std::cos(45.0*pi/180.0),0,0,0,1;
M2 << 1.0, 0, 1.0, 0, 1.0, 2.0, 0, 0, 1.0;
M= M2*M1;
// TO DO: M * P
std::cout << "M*P" << M*P << std::endl;