三维空间中刚体的变换旋转和平移
来源:互联网 发布:淘宝卖家交流论坛 编辑:程序博客网 时间:2024/04/29 20:12
这里旋转主要可以采用旋转向量, 旋转矩阵, 欧拉角,四元数。
我们也能反向从坐标轴表现形式得到旋转矩阵:
欧拉角是采用偏航, 俯仰, 滚转(yaw, pitch, roll来表示)
这里是先绕Z, 再绕Y,最后绕X旋转得到的
四元数:q = [cos(a/2) , Nxsin(a/2), Nxsin(a/2), Nzsin(a/2)]
两个点之间的变换关系可以表示为:
p1 = q *p * (q)-1
#include <iostream>
#include<cmath>
using namespace std;
#include<eigen3/Eigen/Core>
#include<eigen3/Eigen/Geometry>
int main(int argc, char **argv) {
Eigen::Matrix3d rotation_matrix = Eigen::Matrix3d::Identity();
Eigen::AngleAxisd rotation_vector(M_PI/4, Eigen::Vector3d(0., 0., 1));
cout << rotation_vector.matrix()<<endl;
std::cout << "Hello, world!" << std::endl;
rotation_matrix = rotation_vector.toRotationMatrix();
Eigen::Vector3d v(1, 0 , 0);
Eigen::Vector3d v_rotated = rotation_vector * v;
cout << v_rotated<<endl;
Eigen::Vector3d euler_angles = rotation_matrix.eulerAngles(2, 1, 0);
cout <<" 欧拉角:"<< euler_angles.transpose()<<endl;
Eigen::Isometry3d T = Eigen::Isometry3d::Identity();
T.rotate(rotation_vector);
T.pretranslate(Eigen::Vector3d(1, 3, 4));
cout << T.matrix()<<endl;
Eigen::Quaterniond q = Eigen::Quaterniond(rotation_vector);
cout <<"四元数:" << q.coeffs()<<endl;
v_rotated = q * v; /*数学上为q*V * v(-1)*/
cout<<v_rotated<<endl;
//cout << T.rotate(rotation_vector)<<endl;
return 0;
}
- 三维空间中刚体的变换旋转和平移
- 三维空间几何变换原理[平移、旋转、错切]
- 三维空间中的几何变换-平移旋转缩放
- 旋转变换和平移变换
- OpenCV 根据对应的三维点估计刚体变换的旋转平移矩阵(RT矩阵)
- OpenCV 根据对应的三维点估计刚体变换的旋转平移矩阵(RT矩阵)
- 三维空间绕坐标轴的旋转变换
- 三维空间绕坐标轴的旋转变换
- 三维空间绕坐标轴的旋转变换
- 三维空间绕坐标轴的旋转变换
- 三维空间中的旋转变换
- 三维空间中旋转的表示
- 刚体在三维空间的旋转(关于旋转矩阵、DCM、旋转向量、四元数、欧拉角)
- 刚体在三维空间的旋转(关于旋转矩阵、DCM、旋转向量、四元数、欧拉角)
- 自由变换相机远近、旋转和平移
- 计算机图形学(四)几何变换_5_三维空间的几何变换_1_三维平移
- 【机器人】空间描述和变换:平移、旋转、变换(算子)
- 矩阵的旋转平移正变换及反变换
- LeetCode 1. Two Sum
- NFC--Tag读写模式java层源码分析
- python的wheel以及安装包查找
- LTE,LTE是什么意思
- jQuery选择器总结
- 三维空间中刚体的变换旋转和平移
- GO语言基础及特性
- 一个不错的shell脚本入门教程
- 516. Longest Palindromic Subsequence
- 多重背包
- VS2013配置opencv3.1.0,及测试
- windows 2003下远程连接mysql服务器慢的 解决办法:
- 拷贝构造函数
- nyoj-71-独木舟上的旅行