The rotation of three-dimensional space can be expressed by Euler angle, rotation matrix, axis-angle, four-yuan number, double four-yuan number, this article mainly summarizes the advantages and disadvantages of these representations.
A Euler angle (euler-angles) 1.1 Introduction
The Euler angle consists of 3 rotations that specify the orientation of a rigid body according to the 3 rotations. These 3 rotations revolve around the x-axis, the y-axis, and the z-axis, respectively, called Pitch,yaw and Roll, as shown in. Euler's angles can be expressed as z-x-z,x-y-x,z-y-z and other forms, and the order of rotation affects the results.
PitchYawRoll
Figure 1. The representation of Euler's angle
An important advantage of Euler's angle is that it is intuitive and easy to understand.
The Euler angle has several drawbacks:
(1) Euler angle is not transitive, the rotation of the order affects the results of rotation, different applications may use different rotation sequence, the rotation sequence can not be unified;
(2) 3 rotation angle can be unrestricted, that is, can be 10,000 degrees, can also be-1500 degrees;
(3) may cause universal joint deadlock (Gimbal Lock).
1.2 Flat Universal Joint deadlock
When two loops overlap, there is a loss of one degree of freedom, as shown in 2. For universal joint deadlock can refer to "1" "2" "3", especially the "1" provided video, the introduction of knowledge points very vivid. It is also because of the existence of the lock that it is not possible to use Euler angles to achieve smooth spherical interpolation.
Figure 2. Universal Joint deadlock
Two Rotation matrix
Using the 3*3 matrix, you can represent all the rotations in a three-dimensional space, with θ indicating that the direction of rotation is clockwise when viewed along the axis. The θ angle is rotated around the x-axis, y-axis, and z -axis, and the corresponding rotation matrix is shown as follows:
X=???1000CosThetaSinθ 0 ? Sinθ cosθ??? Y=???CosTheta0?SinTheta010 sinθ0 cosθ??? Z=???CosThetaSinTheta0?Sinθ cosθ0 0 0 1 ???
The rotation matrix supports transitivity and is easy to use, but has some drawbacks:
(1) Waste memory, need at least 12 parameters, to represent a 6 degrees of freedom structure;
(2) May introduce the wrong scaling (scaling) and error-cutting (sheering)
(3) The realization of matrix interpolation is very difficult;
(4) Not intuitive.
Three Shaft-angle
Rotate an angle around the axis of the unit length, using a combination pair (n? ,θ).
This direction is very intuitive, avoids the universal joint deadlock when Euler angle is used, but it is difficult to realize the combination of multiple rotations, it is not easy to achieve the axis-angle interpolation by the linear interpolation of 4 elements, which can cause errors.
Four Four USD
Refer to "Four Yuan", you can also refer to "5" "6" "7", here is only a simple description of the advantages and disadvantages of the method.
Its disadvantage is that it is not intuitive, understanding more laborious. But there are many advantages:
(1) More robust, does not appear in the Euler angle of the universal joint deadlock.
(2) More efficient, less space and time, and when a large number of operations are performed on a matrix with limited precision, a drift (Drift) occurs, and the rounding of real numbers accumulates into the matrix. Due to the presence of drift, the operation of the rotation may be wrong, so the matrix to be normalized, reset the matrix, which is a very time-consuming operation. The four-dollar number has only 4 values, and the matrix has 9, and it experiences little drift and less normalization time.
(3) very simple to use.
Reference
"1" http://v.youku.com/v_show/id_XNzkyOTIyMTI=.html
"2" http://www.cnblogs.com/soroman/archive/2008/03/24/1118996.html
"3" http://www.cnitblog.com/luckydmz/archive/2010/09/07/68674.aspx
"4" Kenwright, Ben. "A Beginners Guide to Dual-quaternions."
"5" http://www.cprogramming.com/tutorial/3d/quaternions.html
"6" http://isg.cs.tcd.ie/projects/DualQuaternions/
"7" http://www.gamedev.net/page/resources/_/technical/math-and-physics/quaternion-powers-r1095
Euler angle, four-tuple and matrix comparison (RPM)