5.5 Quaternary
The last type of orientation indicates a variant that can be expressed with an axis angle. In fact, when we use it to represent rotation, we can also simply look at this representation from the angle of rotation around the axis. This is a four-element model, invented by Sir William Hamilton, an Irish mathematician, in the 19th century. Ken shoemake introduced the computer graphics field in 1980s. There is no universal lock in the element that consists of four numbers. In addition, the connection operation on mathematics is very simple. Therefore, if it is correctly constructed, it is very effective in rotating vector calculation.
Although any element of the element can be used to indicate rotation. However, we mainly use Unit 4 elements. In the so-called unit, the Quaternary element is W2 + V * V = 1, where W is the vector segment, and V is the number segment. There are three reasons for the use of the Unit Quaternary element: one is to make the rotation and Conversion Calculation more efficient. Second, the floating point number error is reduced, because after normalization, the numbers are between-1 and 1, and the floating point number has a very high precision in this range. Finally, the four elements and the axis and angle indicate the natural unification in form. The number of elements in a unit is w x y ),
V = sin (θ/2) R. for example, if we want to rotate 90 degrees around the Z axis, our axial volume is (0, 0, 1), and the rotation angle is half π/4 (radians ), each division of this element is W = cos (π/4), x = y = 0 * sin (π/4) = 0, Z = 1 * sin (π/4) = sin (π/4 ).
The addition and Inner Product of the Quaternary element are the same as the addition and Inner Product of the vector. Multiply by-1, and the result is the opposite to that of the original ry. The opposite number of the element represents the opposite direction of rotation, but it does not represent the inverse of rotation represented by the original element. If the original element represents the θ angle of rotation around the axis V, the opposite number indicates that 2 π-θ degrees are rotated around the axis-v. Therefore, the rotation results are the same. The length of the element is calculated by the sum of squares of the four components and then the square. Normalization of a quaternary element is obtained by dividing it by its length.
The Inner Product of the Quaternary element is the same as that of the vector. The product of each component is used for summation. If the inner product is close to 1, they indicate that the rotation is closer. Because we know that the opposite number of the element number represents the same rotation, the closer the inner product result is to-1, the closer they are to the same rotation.
It is very simple to calculate the inverse of the Quaternary element. Because 2 θ is rotated around an axis, its inverse can be regarded as-2 θ. Therefore, the unit of the Quaternary element (COS (θ), sin (θ) x, sin (θ) y, sin (θ) z) are (COS (-θ), sin (-θ) x, sin (-θ) y, sin (-θ) Z) (COS (θ),-sin (θ) x,-sin (θ) y,-sin (θ) Z) therefore, the inverse of the Quaternary element (w, x, y, z) is (W,-X,-y,-Z ).