Talk:Quaternions and spatial rotation

Compared to rotation matrices
The article says

"Compared to rotation matrices they are more compact, more numerically stable, and more efficient"

However, quaternion rotation requires 24 add/mul operations but a 3x3 matrix requires only 15 add/mul operations. Also, the "more numerically stable" claim is unjustified and I cannot find a reference. — Preceding unsigned comment added by 80.47.47.163 (talk) 15:22, 19 May 2020 (UTC)


 * I'm not sure where are those numbers from. As far as the number of operation goes, quaternions require less operations to compose rotations and more operations to apply a rotation to a vector. What ends up being more efficient depends on the application.
 * Besides, efficiency is not only the number of mul/adds. Quaternions take less than half the memory and, accordingly, bandwidth. Which is, again, important in some applications (e.g. tangent space calculations on a GPU).
 * Applying and composing rotations aren't the only operations to consider either. Quaternions are easier to interpolate (again, useful for tangent space calculations on a GPU for example, but also for animation, modeling, etc...).
 * "more numerically stable" -- this is un-doubtfuly true. When repeatedly composing rotations (eg in rigid body simulations) rotation matrices will inevitably become non-orthogonal. There are different ways to re-orthogonalize them, trading off precision and performance. In contrast to those, quaternions don't suffer from that issue at all. bungalo (talk) 20:09, 19 May 2020 (UTC)

Labelling the formulas in the Alternative Convention section
The paragraph argued that usage of the Shuster convention is discouraged, as did the cited article "Why and How to Avoid the Flipped Quaternion Multiplication" by Sommer et. al. But the formulas in the paragraph are not clearly distinguished (except by red minus signs). These formulae are beginning to show up on Google Images out of context, creating a lot of confusion to students. I tried to add labelling "\qquad \text{alternative Convention, usage discouraged} to the right of the formulas but the edit got reverted by a anti-vandalism bot. If anyone (especially registered users) agree, please help with the edit.184.147.40.19 (talk) 04:04, 25 January 2022 (UTC)


 * I already reversed the bot edit a few minutes ago. I'll just nod and pretend I knew for sure it wasn't vandalism. Cheers.   signed, Willondon (talk)  04:14, 25 January 2022 (UTC)

Recover Axis Angle
Since quaternions are rotations about arbitrary axis, it makes sense as a matter of convention that the angle is always a non-negative number. Moreover, the angle must always be in the 1st and 2nd quadrant as all other quadrants have equivalent negative angles. If for example we want to represent a rotation of $$-\frac{\pi}{6}$$ about the $$\bigl( \begin{smallmatrix} 1 \\ 0 \\ 0 \end{smallmatrix} \bigr)$$ axis, this is entirely equivalent to a rotation of $$\frac{\pi}{6}$$ about the $$\bigl( \begin{smallmatrix} -1 \\ 0 \\ 0 \end{smallmatrix} \bigr)$$ axis.

So indeed the formula to recover the rotation angle presented $$\theta = 2\, {\rm arctan2} \left(\sqrt{x^2+y^2+z^2},\,w\right)$$ will indeed produce the correct answer, in the 1st and 2nd quadrants because thee first argument is always going to be positive, but it is un-necessarily complicated. I propose to recover the angle we simply use

$$\theta =2\, \arccos \left(w \right)$$

which also produces results in the 1st and 2nd quadrants, Once the angle is recovered, then the axis is simply the vector part divided by the sine of the half angle

$$\vec{\rm z} = \tfrac{1}{\sin \left( \frac{\theta}{2} \right) }\,\vec{v}$$

— Preceding unsigned comment added by Jalexiou (talk • contribs) 16:26, 11 June 2022 (UTC)

rotations and matrices

 * A geometric fact independent of quaternions is the existence of a two-to-one mapping from physical rotations to rotational transformation matrices.

Shouldn't that be the other way around? That is, one rotation has two representations – not that one matrix can represent two rotations. —Tamfang (talk) 05:41, 2 August 2023 (UTC)