X
X
XpeH Petrovich2015-02-06 15:10:43
Geometry
XpeH Petrovich, 2015-02-06 15:10:43

Did I understand the essence of quaternions correctly?

on the example of Unity in this context. A quaternion is described in terms of four arguments - x, y, z, and w. Accordingly, the first three are the coordinates of the vector relative to absolute zero in the global coordinate system of the scene, and w is the angle of rotation around the axis, which is just given by this vector? Am I right in thinking?))
PS: I studied math at school badly ((do not judge strictly and do not ask how I got into programming)))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mrrl, 2015-02-06
@uakoB

Usually, quaternions of length 1 are taken, i.e. x^2+y^2+z^2+w^2=1.
Rotation by zero angle is specified by the quaternion (0,0,0,1) - the direction of the axis (x,y,z) is not defined for it, and it is not necessary.
In other cases, the angle of rotation is determined by the value of w according to the formula
w=cos(phi/2), where 0 <= phi <= 2*pi. That is, the larger the angle of rotation, the smaller w. For 180 degree turns w=0.
If w<0, then the rotation is obtained by an angle greater than 180 degrees. The angle of rotation is counted counterclockwise when looking towards (x,y,z). It turns out that the quaternions (x,y,z,w) and (-x,-y,-z,-w) define the same rotation angle.
Why this is done is not very important. The main thing is that the superposition of two successive rotations is described by a quaternion equal to the product of the quaternions of these rotations themselves (in some particular order).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question