matlab三维旋转矩阵,matlab中的三维坐标系与旋转
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度,结果为:
clo all;
clear;
clc;
r= [0 1 1];% 默认的旋转顺序是ZYX,所以[90 0 0]表⽰绕Z轴旋转90度
angle= [90 0 0] * pi / 180;
quaternion= angle2quat(angle(1),angle(2),angle(3));
n= quatrotate(quaternion,r)
担心的英语
结果:
n =
1.0000
0.0000 1.0000
原始向量在YZ平⾯上[0 1 1],旋转后的平⾯在XZ的平⾯上[1 0 1],可以看出从Z轴的正⽅向来看,顺时针旋转;
再次验证:
clo all;英语教育改革
clear;
clc;
sciencemuumr= [0 1 1];% 默认的旋转顺序是ZYX,所以[0 0 -90]表⽰绕X轴旋转90度词组大全
angle= [0 0 -90] * pi / 180;
小汽车驾驶技巧
quaternion= angle2quat(angle(1),angle(2),angle(3));
n=quatrotate(quaternion,r)
结果:
n=
0 -1.0000 1.0000
结论:MATLAB中的默认坐标系是右⼿坐标系,且进⾏欧拉⾓旋转时,顺着轴的正⽅向来看,顺时针⽅向为正,逆时针⽅向为负。
pig什么意思另外,MATLAB⾃带rotate函数,解释如下:
rotate
Rotateobject inspecified direction领事馆英文
Syntax
diss是什么意思中文rotate(h,direction,alpha)
rotate(...,origin)
Description
hunband
The rotate function rotates a graphicsobject in three-dimensional space, according to the right-hand rule.
rotate(h,direction,alpha) rotates the graphicsobject h by alpha degrees. direction is a two- or three-element vector that describes the axis of rotation inconjunction with the origin.
rotate(...,origin) specifies the origin of the axis of rotationas a three-element vector. The default origin is the center of the plot box.
此旋转函数可选择三维空间中的图像,遵循右⼿坐标系,顺着轴的正⽅向来看,且逆时针⽅向为正,顺时针⽅向为负。