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.

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

matlab中的三维坐标系与旋转的更多相关文章

  1. matlab中画三维图形

    这里主要讲述两个方法用matlab画三维图形: 1.mesh函数 先看一个简单的例子: x = ::; y = ::; [X, Y] = meshgrid(x, y); Z = zeros(,); Z ...

  2. 如何在 Matlab 中绘制带箭头的坐标系

    如何在 Matlab 中绘制带箭头的坐标系 如何在 Matlab 中绘制带箭头的坐标系 实现原理 演示效果 完整代码 实现原理 使用 matlab 的绘制函数时,默认设置为一个方框形的坐标系, 图1 ...

  3. MATLAB中plot()画图的颜色线型和希腊字母参数设置

    y         黄色           ·             点线      m         粉红           ○             圈线      c          ...

  4. Matlab绘图(一二三维)

    Matlab绘图 强大的绘图功能是Matlab的特点之一,Matlab提供了一系列的绘图函数,用户不需要过多的考虑绘图的细节,只需要给出一些基本参数就能得到所需图形,这类函数称为高层绘图函数.此外,M ...

  5. MATLAB中绘制质点轨迹动图并保存成GIF

    工作需要在MATLAB中绘制质点轨迹并保存成GIF以便展示. 绘制质点轨迹动图可用comet和comet3命令,使用例子如下: t = 0:.01:2*pi;x = cos(2*t).*(cos(t) ...

  6. matlab中patch函数的用法

    http://blog.sina.com.cn/s/blog_707b64550100z1nz.html matlab中patch函数的用法——emily (2011-11-18 17:20:33) ...

  7. matlab中的卷积——filter,conv之间的区别

    %Matlab提供了计算线性卷积和两个多项式相乘的函数conv,语法格式w=conv(u,v),其中u和v分别是有限长度序列向量,w是u和v的卷积结果序列向量. %如果向量u和v的长度分别为N和M,则 ...

  8. 图像卷积、相关以及在MATLAB中的操作

    图像卷积.相关以及在MATLAB中的操作 2016年7月11日 20:34:35, By ChrisZZ 区分卷积和相关 图像处理中常常需要用一个滤波器做空间滤波操作.空间滤波操作有时候也被叫做卷积滤 ...

  9. matlab中subplot函数的功能

    转载自http://wenku.baidu.com/link?url=UkbSbQd3cxpT7sFrDw7_BO8zJDCUvPKrmsrbITk-7n7fP8g0Vhvq3QTC0DrwwrXfa ...

随机推荐

  1. postgresql 多实例运行

    创建新的实例, (下面所用到的9.1版本,如果为其他版本,可以用版本号替换9.1) sudo /usr/bin/pg_createcluster -U postgres                 ...

  2. 常见的HTTPS攻击方法

    0x00 背景 研究常见的https攻击方法 Beast crime breach,并针对https的特性提出一些安全部署https的建议. 针对于HTTPS的攻击,多存在于中间人攻击的环境中,主要是 ...

  3. pygame安装

    进入这个网站 http://www.pygame.org/wiki/Compilation 可以选择不同系统的安装方法 其中ubuntu的安装命令是 #这是python .X #install dep ...

  4. 数据结构(堆):SCOI 2009 生日礼物

    Description 小西有一条很长的彩带,彩带上挂着各式各样的彩珠.已知彩 珠有N个,分为K种.简单的说,可以将彩带考虑为x轴,每一个彩珠有一个对应的坐标(即位置).某些坐标上可以没有彩珠,但多个 ...

  5. 数据结构(线段树):CodeForces 145E Lucky Queries

    E. Lucky Queries time limit per test 3 seconds memory limit per test 256 megabytes input standard in ...

  6. 数论(毕达哥拉斯定理):POJ 1305 Fermat vs. Pythagoras

    Fermat vs. Pythagoras Time Limit: 2000MS   Memory Limit: 10000K Total Submissions: 1493   Accepted: ...

  7. Android *.db-journal

    config.xml <!-- The default journal mode to use use when Write-Ahead Logging is not active. Choic ...

  8. HDOJ(HDU) 2192 MagicBuilding(用Java的Map做了下)

    Problem Description As the increase of population, the living space for people is becoming smaller a ...

  9. 解决android启动程序时,会出现一个短暂的白色空白界面的问题

    在启动的activity定义style为透明就可以了(android:theme="@android:style/Theme.Translucent")

  10. 【索引】用PS3手柄在安卓设备上玩游戏系列

    谈安卓游戏对手柄的支持:http://www.cnblogs.com/duxiuxing/p/3729802.html 连接手柄和设备:http://www.cnblogs.com/duxiuxing ...