当前位置:网站首页>Detailed explanation of Euler angle, axis angle, quaternion and rotation matrix
Detailed explanation of Euler angle, axis angle, quaternion and rotation matrix
2022-07-19 11:00:00 【TT ya】
Beginner little rookie , I hope it's like taking notes and recording what I've learned , Also hope to help the same entry-level people , I hope the big guys can help correct it ~ Tort made delete .
Catalog
2、 Representation of Euler angle
3、 Advantages and disadvantages of Euler angle
1、 Propose meaning and definition ( Including shaft angle )
2、 Related calculation rules of quaternions
4、 Examples of the use of quaternions
5、 Advantages and disadvantages of quaternion
3、 ... and 、 The mutual transformation between quaternions and Euler angles
One 、 Euler Angle
1、 Static definition
For a reference system in three-dimensional space , The orientation of any coordinate system , Can be represented by three Euler angles .
The reference system is also called laboratory reference system , It's stationary .
The coordinate system is fixed to the rigid body , Rotate with the rotation of the rigid body .
Let's take a classic example :
Set up xyz- The axis is the reference axis of the reference system ( That is, the blue part in the figure below ). call xy- Plane and XY- The intersection of planes is the intersection line , In English letters (N) representative .zxz The Euler angle of compliance can be statically defined in this way :
α yes x- The angle between the axis and the intersection line ,
β yes z- Shaft with Z- Angle between axes ,
γ Is the intersection line and X- Angle between axes .

But for the order and marking of included angles , Designation of two axes of included angle , There are no regular rules . So whenever Euler angle is used , We must clearly show the order of included angles , Specify its reference axis
2、 Representation of Euler angle
First round z Shaft rotation α horn ( If left ), Then around X’ Shaft rotation β horn ( As shown in the middle ), The last is around Z’ Shaft rotation γ horn ( Like the picture on the right ), This is a zxz Compliance ( Go around first z Axis , Rewind x Shaft rewinding z‘ Axis ) Euler angle representation of .( except zxz There are other specified methods besides compliance , Such as xyx,zyz. I won't go into details here )



Euler angles include 3 Turns , According to this 3 Rotate to specify the orientation of a rigid body . this 3 Rotate around x Axis ,y Axis and z Axis , Known as Pitch,Yaw and Roll.

3、 Advantages and disadvantages of Euler angle
advantage :
(1) Euler angle consists of three angles , intuitive , Easy to understand .
(2) It can rotate from one direction to another for more than 180 Degree angle .
shortcoming :
(1) Euler angle is not transitive , The order of rotation affects the result of rotation , Different applications may use different rotation sequences , The rotation order cannot be unified ;
(2)3 The rotation angle can be unlimited , That is to say, the value range is (-inf,inf);
(3) It may cause the universal joint to deadlock
4、 The universal joint of Euler angle is deadlocked ( There is no problem of universal lock in static state )
For dynamic Euler angle ( Rotate around the object coordinate system ), No matter around the first , What is the rotation angle of the three axes , As long as the rotation angle around the second axis is ±90°, There will be universal lock phenomenon .
Universal lock phenomenon : Once you choose ±90° As pitch horn , This will cause the first rotation to be equivalent to the third rotation , The entire rotation means that the system is limited to rotation around the vertical axis , Missing a representation dimension .
For example :
For example, let's go around z The shaft rotates at any angle , Get the figure below, right
Then let's go around y pivot 90 degree , Get the picture below ( here Z’ The axis is in blue x-y In the plane )
Then no matter how we go around X‘ Shaft rotation ,Z’ The axis is always blue x-y In the plane , It's like being locked .
Avoidance of universal lock : Limit the angle range of rotation —— The rotation angle around the first axis is limited to ±180° between ; The limit around the second axis is ±90° between .
Two 、 Four yuan number
1、 Propose meaning and definition ( Including shaft angle )
Put forward the meaning : The above Euler angle can only be obtained after multiple rotations , Then why not do it in one step , Only rotate once ? Then quaternion came into being .
Definition :
For the rotation of an object , We only need to know four values : A rotating vector + An angle of rotation . And quaternion is exactly such a design :

among x,y,z Represents the three-dimensional coordinates of the vector ,w It represents the angle
Actually , Quaternion is essentially a hypercomplex :

Axis angle
—— This is an axis vector ( Unit vector ) The expression of adding a rotation angle is the axis angle expression .
The biggest limitation of shaft angle is that simple interpolation cannot be carried out ;
Besides , Rotation in the form of shaft angle cannot be directly applied to points or vectors , Must be converted to matrix or quaternion .
2、 Related calculation rules of quaternions
(1) Add
![q1+q2 = [\overrightarrow{v1}+\overrightarrow{v2},w1+w2]](http://img.inotgo.com/imagesLocal/202207/19/202207171238326920_19.gif)
(2) Multiplication

The unit is 4 yuan —— For convenience , Regular regulations :

At this time, the complex multiplication can be expressed as :
![]()
It can also be expressed in matrix form

(3) conjugate —— 
3、 Polar form of quaternion
![q=\|q\|[\vec{n} \cdot \sin \theta, \cos \theta]](http://img.inotgo.com/imagesLocal/202207/19/202207171238326920_4.gif)
among ||q|| Represents the modulus of quaternion , The unit quaternion modulus is 1, and θ Is the half width of the rotation process represented by quaternions , in other words 2θ Is the size of the rotation angle ,n Is the unit vector representing the direction of the rotation axis .
4、 Examples of the use of quaternions
A vector :v1, Let it go around v2 rotate θ degree ( Turn it clockwise )
So there are p = (v1, 0); q = ( v2 * sin(θ/2) , cos(θ/2) )
The quaternion after rotation is ( The real part of the quaternion obtained is 0, The imaginary part is the new coordinate ):
5、 Advantages and disadvantages of quaternion
advantage :
- Small storage space , High calculation efficiency .
- There is no universal joint lock problem in quaternion rotation .
shortcoming :
- The numerical representation of quaternions is not intuitive .
- A single quaternion cannot represent more than... In any direction 180 The rotation of the degree of .
3、 ... and 、 The mutual transformation between quaternions and Euler angles
1、 Quaternion to Euler angle
Set up —— 
![{\left[\begin{array}{c} \text { roll } \\ \text { pith } \\ y a w \end{array}\right]=\left[\begin{array}{c} \phi \\ \theta \\ \psi \end{array}\right]=\left[\begin{array}{l} \operatorname{atan} 2\left(\frac{2(z y+w x)}{w^{2}-x^{2}-y^{2}+z^{2}}\right) \\ \arcsin (a(w y-x z)) \\ \operatorname{atan2}\left(\frac{2(x y+w z)}{w^{2}+x^{2}-y^{2}-z^{2}}\right) \end{array}\right]=\left[\begin{array}{c} \operatorname{atan} 2\left(\frac{2(z y+w x)}{1-2\left(x^{2}+y^{2}\right)}\right) \\ \arcsin (a(w y-x z)) \\ \operatorname{atan2}\left(\frac{2(x y+w z)}{1-2\left(y^{2}+z^{2}\right)}\right) \end{array}\right]}](http://img.inotgo.com/imagesLocal/202207/19/202207171238326920_9.gif)
2、 Euler angle to Quaternion
We set up 
Then there are :
![q=\left[\begin{array}{l} w \\ x \\ y \\ z \end{array}\right]=\left[\begin{array}{l} \cos (\phi / 2) \cos (\theta / 2) \cos (\psi / 2)+\sin (\phi / 2) \sin (\theta / 2) \sin (\psi / 2) \\ \sin (\phi / 2) \cos (\theta / 2) \cos (\psi / 2)-\cos (\phi / 2) \sin (\theta / 2) \sin (\psi / 2) \\ \cos (\phi / 2) \sin (\theta / 2) \cos (\psi / 2)+\sin (\phi / 2) \cos (\theta / 2) \sin (\psi / 2) \\ \cos (\phi / 2) \cos (\theta / 2) \sin (\psi / 2)-\sin (\phi / 2) \sin (\theta / 2) \cos (\psi / 2) \end{array}\right]](http://img.inotgo.com/imagesLocal/202207/19/202207171238326920_18.gif)
Four 、 Rotation matrix
Hypothetical winding XYZ The rotation angles of the three axes are α ,β ,γ , Then the calculation method of rotation matrix of cubic rotation is as follows :
![\begin{array}{l} R_{x}(\alpha)=\left[\begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos \alpha & -\sin \alpha \\ 0 & \sin \alpha & \cos \alpha \end{array}\right] \\ R_{y}(\beta)=\left[\begin{array}{ccc} \cos \beta & 0 & \sin \beta \\ 0 & 1 & 0 \\ -\sin \beta & 0 & \cos \beta \end{array}\right] \\ R_{z}(\gamma)=\left[\begin{array}{ccc} \cos \gamma & -\sin \gamma & 0 \\ \sin \gamma & \cos \gamma & \\ 0 & 0 & 1 \end{array}\right] \end{array}](http://img.inotgo.com/imagesLocal/202207/19/202207171238326920_6.gif)
If pressed Z-Y-X Rotation order ( It means first around its own axis Z, Then around its own axis Y, Finally, around its own axis X), Then the rotation matrix is :

Welcome to criticize and correct in the comment area , thank you ~
边栏推荐
- leetcode-08
- ENVI_IDL:使用反距离权重法选取最近n个点插值(底层实现)并输出为Geotiff格式(效果等价于Arcgis中反距离权重插值)
- 修改Jupyter默认路径看这篇!
- LeetCode 745. 前缀和后缀搜索
- Google Earth Engine——Hansen Global Forest Change v1.8 (2000-2020) 森林覆盖度和森林损失量数据集
- NVIDIA uses AI to design GPU: the latest H100 has been used, which reduces the chip area by 25% compared with traditional EDA
- Prospect of 6G global convergence network
- 2022/7/14
- Antd drop-down multiple options to transfer values to the background for query operations
- (1) Learn about MySQL
猜你喜欢

腾讯云服务器利用镜像部署WordPress个人网站!

LeetCode 2331. Calculate the value of Boolean binary tree (tree traversal)

手机键盘(模拟题)

NVIDIA uses AI to design GPU: the latest H100 has been used, which reduces the chip area by 25% compared with traditional EDA

论文笔记:Mind the Gap An Experimental Evaluation of Imputation ofMissing Values Techniques in TimeSeries

LeetCode 2315. Statistical asterisk (string)

Unity3d 模型中心点的转换(源代码)

Aike AI frontier promotion (7.17)

Beego框架实现文件上传+七牛云存储

Environment variable configuration of win10
随机推荐
Beego框架实现文件上传+七牛云存储
LeetCode 2331. 计算布尔二叉树的值(树的遍历)
Game theory (Depu) and investment (40/100)
火箭大机动运动欧拉角解算的探讨
关于hping打流测试工具
Beego framework realizes file upload + seven cattle cloud storage
可定义的6G安全架构
IP SAN has an independent file system. After the application server accesses the IP SAN through the network sharing protocol, it can read and write the files in the file system
MFC | self drawn CEdit control under the framework
Leetcode ugly number problem solution
How can enterprise telecommuting be more efficient?
Google Earth engine - Hansen global forest change v1.8 (2000-2020) forest coverage and forest loss data set
(1) Learn about MySQL
ENVI_IDL:使用反距离权重法选取最近n个点插值(底层实现)并输出为Geotiff格式(效果等价于Arcgis中反距离权重插值)
基于“7·20郑州特大暴雨”对空天地一体化通信的思考
修改Jupyter默认路径看这篇!
Avi Deployment Guide (2): overview of AVI architecture
Win10 start key click no response
人大、微软等提出InclusiveFL:异构设备上的包容性联邦学习
High number_ Chapter 1 space analytic geometry and vector algebra__ Distance from point to plane
