quat
Description
Examples
Convert SE(3) Transformation to Numeric Quaternion
Create SE(3) transformation with zero translation and a rotation defined by a numeric quaternion. Use the eul2quat
function to create the numeric quaternion.
quat1 = eul2quat([0 0 deg2rad(30)])
quat1 = 1×4
0.9659 0.2588 0 0
T = se3(quat1,"quat")
T = se3
1.0000 0 0 0
0 0.8660 -0.5000 0
0 0.5000 0.8660 0
0 0 0 1.0000
Convert the transformation back into a numeric quaternion.
quat2 = quat(T)
quat2 = 1×4
0.9659 0.2588 0 0
Convert SO(3) Rotation to Numeric Quaternion
Create SO(3) rotation defined by a numeric quaternion. Use the eul2quat
function to create the numeric quaternion.
quat1 = eul2quat([0 0 deg2rad(30)])
quat1 = 1×4
0.9659 0.2588 0 0
R = so3(quat1,"quat")
R = so3
1.0000 0 0
0 0.8660 -0.5000
0 0.5000 0.8660
Convert the rotation into a numeric quaternion.
quat2 = quat(R)
quat2 = 1×4
0.9659 0.2588 0 0
Input Arguments
transformation
— Transformation
se3
object | N-element array of se3
objects
Transformation, specified as an se3
object or as an
N-element array of se3
objects.
N is the total number of transformations.
rotation
— Rotation
so3
object | N-element array of so3
objects
Rotation, specified as an so3
object or as an
N-element array of so3
objects.
N is the total number of rotations.
Output Arguments
q
— Quaternion rotation angles
M-by-4 matrix
Quaternion rotation angles, returned as an M-by-4 matrix, where each row is of the form [qw qx qy qz]. M is the total number of transformations or rotations specified.
Version History
Introduced in R2023b
See Also
se3
| so3
| quaternion
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)