Derivation of rotation matrix, rotation vector, and quaternion

Rotation matrix on the plane

insert image description here

Euler angle

Yaw Pitch Roll is to rotate around XYZ respectively

Notice

Rotation around a fixed coordinate system is right multiplication/vector transformation, and the result of vector and point rotation is right multiplication
Each rotation is based on the left multiplication/coordinate transformation of its own coordinate system, and the coordinates of the vector and point in the previous coordinate system are left multiplication

If you rotate α around the X axis, rotate β around the Y axis, and rotate γ around the Z axis,
then R = Rxα Ryβ Rzγ
If you rotate α around the X axis, rotate β around Y', and rotate γ around Z'',
then R = Rz''γ Ry'β Rxα

The rotation of Euler angles depends on the rotation order of the rotation axis, which is called cis-regularity
Rotation matrix around a fixed axis, where the results shown in the figure are wrong

insert image description here

universal joint

Applications: camera gimbal, missile navigation

Degeneracy of Euler angles (Gimbal deadlock

See the example of observing the sky at the North Pole. To put it simply, it is to rotate 90 degrees according to the second axis in the rule, which will result in the loss of the rotation axis
insert image description here

Some Problems Using Euler Angles to Represent Rotation

1. Universal joint deadlock
2. It is difficult to interpolate (not conducive to animation
3. It is difficult to do superposition of rotation (for example, if there are two rotations R1 and R2, the total rotation cannot be simply expressed by R1+R2
4. Around the fixed The rotation of the axis is difficult to represent
insert image description here

Quaternion

Use high-level paraphrase to express the rotation of three-dimensional space, and use group theory to prove that it only works in three-dimensional space, and it will not work in high-dimensional space
insert image description here
insert image description here

Note that there are still doubts about the multiplication calculation of quaternions. Does the quaternion have three multiplications of product, dot, and cross, or does the quaternion have two multiplications of product/cross and dot?

At present, it seems that the quaternion should have Product/cross, dot two kinds of multiplication

product

The product of the quaternion can be expressed in three forms

  1. The complex number formula
    insert image description here
    is actually a simple expansion and multiplication, refer to the complex number multiplier table insert image description here2. Matrix formula
    From the above quaternion expansion and multiplication, it can be intuitively transitioned to the following expression insert image description here
    3. Vector formulainsert image description here

Quaternion basic operation summary
Quaternion multiplication calculation

Euler angles –> Quaternions

insert image description here

Quaternion expression rotationinsert image description here

The conjugate of the unit quaternion == the inverse of the quaternion

Quaternion –> Rotation Matrix

insert image description here

Common operations on quaternions

1. The inverse of the quaternion
2. The quaternion represents the superposition of rotation
3. The rotation between two unit vectors Quaternion solution
insert image description here

rotation angle around a given axis

insert image description here

Reference

GAMES104 Spin

Guess you like

Origin blog.csdn.net/qq_39006214/article/details/126165552