📄 testeuler2quat.m
字号:
clc, close all, clear all
format
dx=160; dy=100; dz=120; % euler angles in degree
D2R=pi/180; % for converting degree to radians
rx=dx.*D2R; ry=dy.*D2R; rz=dz.*D2R; % euler angles in radinas
% % x i.e. roll
% % y i.e. pitch
% % z i.e. yaw
% % Quaterion is expressed as Q=[w x y z]
% % w is scalar component of quaternion
% % x,y,z are vector components of quaternion. For example q=w+xi+yj+zk
% % euler2quat converts euler angles to quaternion for six basic sequence
% % of rotations.
% % Allowed rotation sequences: xyz, xzy, yxz, yzx, zxy, zyx
[w,x,y,z]=euler2quat(rx,ry,rz,'xyz'); %order of rotation is 'xyz'
q=[w x y z]
[w,x,y,z]=euler2quat(rx,ry,rz,'xzy'); %order of rotation is 'xzy'
q=[w x y z]
% [w,x,y,z]=euler2quat(rx,ry,rz,'yxz');
% q=[w x y z]
% [w,x,y,z]=euler2quat(rx,ry,rz,'yzx');
% q=[w x y z]
% [w,x,y,z]=euler2quat(rx,ry,rz,'zxy');
% q=[w x y z]
% [w,x,y,z]=euler2quat(rx,ry,rz,'zyx');
% q=[w x y z]
% Technical Reference: Ken Shoemake, "Animating Rotations with Quaternion Curves"
% This program or any other program(s) supplied with it does not provide any
% warranty direct or implied. This program is free to use/share for
% non-commerical purpose.
% contact: khan_goodluck@yahoo.com
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -