Quaternions + axis + angle

I'm trying to find the difference between the two, but not luck minus this

The main difference between the two representations is that the axis of rotation of the quaternions is scaled by the sine of the half angle of rotation and instead of maintaining the angle in the fourth component of the vector, we save the cosine of the polygon.

I have no idea what

sine of half angle of rotation

or

cosine of a polygon

mean?

+6
source share
2 answers

Quaternios and Axis-angle are 4D representations of 3D rotations / orientations, and both have pro and cons.

Axis-angle: represents the rotation through its angle a and the axis of rotation n . For example, a 180 degree rotation around the Y axis would be represented as a = 180, n = {0,1,0}. The view is very intuitive, but the actual application requires a different view, such as a quaternion or rotation matrix.

Quaternion: represents a turn on a 4D vector. It takes more math and is less intuitive, but is a much more powerful representation. Quaternions are easily interpolated (mixed) and easy to apply at a 3D point. These formulas can be easily found on the Internet. When radians rotate around the normalized axis n, the 4D quaternion vector will be {cos a / 2, (sin a / 2) n_x, (sin a / 2) n_y, (sin a / 2) n_z}. What comes from the sine and cosine of a polygon.

+9
source

This means that if, for example, you want to rotate 180 degrees around the Z axis (0,0,1), then the real part of the quaternion will be cos(180deg/2)=0 , and its imaginary part will be sin(180deg/2)*(0,0,1)=(0,0,1) , This is q=0+0i+0j+1k . A 90 degree rotation will give you q=cos(90deg/2)+sin(90deg/2)*(0i+0j+1k)=sqrt(2)/2+0i+0j+sqrt(2)/2*k and etc.

OTOH, if you ask what sine and cosine are, check if your language provides < sin() and cos() functions (their arguments will probably be in radians), and check http://en.wikipedia.org/ wiki / sine .

+3
source

Source: https://habr.com/ru/post/909201/


All Articles