1. matlab中的三维坐标系

matlab中的三维坐标系是使用的右手坐标系;

输入以下代码:

>> plot3(0,0,0)

>> xlabel('axis X')

>> ylabel('axis Y')

>> zlabel('axis Z')

可以看出是个很明显的右手坐标系。

2. matlab中的欧拉角和四元数旋转

euler angles ----> quaternion ----> dcm ---->rotation

MATLAB中欧拉角旋转基本遵循以上步骤,欧拉角、四元数、旋转矩阵之间是可以相互转换的,具体可以参见help文档中的Aerospace Toolbox ----> Functions ----> Axes ----> Axes Transformations中查看。

假设我在三维坐标系中有一向量r,绕Z轴旋转90度,结果为:

close all;

clear;

clc;

r = [  ];

% 默认的旋转顺序是ZYX,所以[  ]表示绕Z轴旋转90度

angle = [  ] * pi / ;

quaternion = angle2quat(angle(),angle(),angle());

n = quatrotate(quaternion,r)

结果:

n =

1.0000    0.0000    1.0000

原始向量在YZ平面上[0 1 1],旋转后的平面在XZ的平面上[1 0 1],可以看出从Z轴的正方向来看,顺时针旋转;

再次验证:

close all;

clear;

clc;

r = [  ];

% 默认的旋转顺序是ZYX,所以[  -]表示绕X轴旋转90度

angle = [  -] * pi / ;

quaternion = angle2quat(angle(),angle(),angle());

n = quatrotate(quaternion,r)

结果:

n =

            -1.0000    1.0000

结论:MATLAB中的默认坐标系是右手坐标系,且进行欧拉角旋转时,顺着轴的正方向来看,顺时针方向为正,逆时针方向为负。

另外,MATLAB自带rotate函数,解释如下:

rotate

Rotate object in specified direction 

Syntax

rotate(h,direction,alpha) 

rotate(...,origin) 

Description

The rotate function rotates a graphics object in three-dimensional space, according to the right-hand rule.

rotate(h,direction,alpha) rotates the graphics object h by alpha degrees. direction is a two- or three-element vector that describes the axis of rotation in conjunction with the origin.

rotate(...,origin) specifies the origin of the axis of rotation as a three-element vector. The default origin is the center of the plot box.

此旋转函数可选择三维空间中的图像,遵循右手坐标系,顺着轴的正方向来看,且逆时针方向为正,顺时针方向为负。

最新文章

  1. 下一代Asp.net开发规范OWIN(1)—— OWIN产生的背景以及简单介绍
  2. 【BZOJ 3642】Phi的反函数
  3. jsp中文件上床的enctype="multipart/form-data"用法
  4. RecyclerView android:layout_width="match_parent" 无效
  5. Reveal-Plugin-for-Xcode 自动结合 Reveal 进行 UI 分析
  6. jquery 获取input radio/checkbox 的值 【注意写法】
  7. DB2日期和时间函数汇总
  8. 【BZOJ 1927】 [Sdoi2010]星际竞速
  9. java I/O Stream 代码学习总结
  10. Windows服务定时运行,判断当前时间是否在配置时间段内
  11. PHP之APC缓存详细介绍
  12. [置顶] Asp.Net底层原理(一、浏览器和服务器的交互原理)
  13. web开发之Servlet 一
  14. Java 简单实用方法二
  15. Linux下使用GDAL进行开发(automake使用)
  16. pycharm删除project
  17. Python笔记(十六):迭代器
  18. iOS 字典转json字符串
  19. windows环境下为php打开ssh2扩展
  20. ios开发之--PDF文件生成

热门文章

  1. 关于C#的委托
  2. J2EE开源项目
  3. DOMContentLoaded vs onload
  4. db2中修改表字段的长度,查看表字段长度,以及查看表字段已存放值大小
  5. wpa_cli和wpa_supplicant使用,配置无线AP名和密码,静态ip地址
  6. Manacher Ural 1297 Palindrome
  7. QTP自传之测试报告
  8. 《精通CSS:高级Web标准解决方案》学习笔记(下)
  9. Android为应用在桌面添加一个快捷方式
  10. [AS/400] Control Language