4
$\begingroup$

From my understanding, in spatial applications (3D rendering, games and similar applications) quaternions can only be used to describe rotations/orientations and not translations (like a transformation matrix does).

This seems to be backed up by the fact that most 3D frameworks that use quaternions (OGRE3D for example), use quaternions together with vectors to describe an orientation and translation (which in other frameworks would only need a single transformation matrix).

  • Did I understand it correctly?
  • Why can't they describe translations together with rotations?

An argument that I am having trouble countering is: you can describe a translation as a series of rotations around multiple axes and combine those rotations in a single quaternion.

Further research showed me that double quaternions can be used to describe rotation and translation, but I am interested in "single" quaternions.

$\endgroup$
3
  • 1
    $\begingroup$ How would you change rotation axis in practice when implementing it? By translating. $\endgroup$ Apr 4, 2012 at 10:40
  • $\begingroup$ @Raskolnikov I guess I forgot to account for the fact that If I don't do translations the vector around which I rotate around works as if it was placed in the origin? Right? $\endgroup$ Apr 4, 2012 at 10:55
  • 1
    $\begingroup$ Yes, that's what I meant. $\endgroup$ Apr 4, 2012 at 11:02

4 Answers 4

7
$\begingroup$

In a sense, there "aren't enough" unit quaternions to describe translations. Let me try to make this more precise, if not completely rigorous.

Conventionally, we can describe rotations using the set of unit quaternions $H = \{a+bi+cj+dk: a,b,c,d\in\mathbb{R}, a^2+b^2+c^2+d^2=1\}$; each such quaternion can be written in the form $\cos(\frac\alpha 2) + \sin(\frac\alpha 2)(xi + yj + zk)$, representing a rotation by angle $\alpha$ around the axis given by $(x,y,z)$.

Just as the unit circle in $\mathbb{R}^2$ is described by the equation $a^2+b^2=1$, and the unit sphere in $\mathbb{R}^3$ is described by the equation $a^2+b^2+c^2=1$, the above description of $H$ identifies it as the unit hypersphere in $\mathbb{R}^4$. It is thus a compact space, which means that it is "small" in a certain precise sense. As a consequence of this, if you choose any sequence of unit quaternions, then it will have a convergent subsequence - that is, you can throw out enough points from that original sequence and thereby obtain a sequence which converges to a unit quaternion.

Now suppose we choose a way to describe rotations and/or translations by means of unit quaternions. This means that to each quaternion $q$ we associate a rotation or translation $f(q)$. In order to be useful for computation, this association should be a homomorphism: it should satisfy the rule $f(q_1q_2) = f(q_1)\circ f(q_2)$. This ensures that $f$ relates the multiplication of quaternions to the composition of transformations, which is what we usually mean by the quaternions "describing" a set of transformations.

This map $f$ should also be continuous: if $q_1,q_2,\ldots$ is a sequence of unit quaternions which converges to some unit quaternion $q$, then the sequence $f(q_1),f(q_2),\ldots$ should converge to $f(q)$. We impose this continuity condition to avoid strange behaviour, and because in practice just about any reasonable $f$ you can come up with will be continuous.

I claim that no matter how you choose such an $f$, it cannot produce any translation. On the contrary, suppose that we had some $q$ such that $f(q)$ is a translation. Precisely, suppose that $f(q)$ is the translation "add $v$" where $v$ is some nonzero vector in $\mathbb{R}^3$. Since $f$ is a homomorphism, it follows that $f(q^2)$ is the translation "add $v$, then add $v$ again", i.e. "add $2v$". Likewise, for any $n>0$ we have that $f(q^n)$ is the translation "add $nv$".

Consider the sequence $q,q^2,q^3,\ldots$ of unit quaternions. Since $H$ is compact, there are positive integers $n_1< n_2< n_3\cdots$ such that the sequence $q^{n_1}, q^{n_2}, q^{n_3}, \ldots$ converges to a unit quaternion $\bar q$.

Now since $f$ is continuous, it follows that the sequence "add $n_1v$", "add $n_2v$", "add $n_3v$", $\ldots$ converges to $f(\bar q)$, which is some transformation of $\mathbb{R}^3$. But this sequence can't possibly converge to anything, because the sequence of vectors $n_1v,n_2v,\ldots$ shoots off to infinity and so the corresponding sequence of translations does, too. By this contradiction, we conclude that $f(q)$ could not have been a translation.

$\endgroup$
3
  • $\begingroup$ Alternatively, they are "small" in the sense of dimension. The unit quaternions (the only ones that give rise to isometries or $\mathbb{R}^3$) form a 3 dimensional subset of all quaternions. The dimension of all isometries of $\mathbb{R}^3$ is 5. Two of the dimensions come from translating in the $x$ and $y$ direction, and 3 for rotating (2 to pick an axis, 1 to determine how much to spin). $\endgroup$ Apr 4, 2012 at 12:57
  • $\begingroup$ True, but the dimension of a group doesn't constrain whether it can act by translations (of course it will constrain whether it can produce all translations). For example, the additive group $\mathbb{R}^n$ can act by translations on $\mathbb{R}^3$ for any $n>0$, by projecting onto the first coordinate to get a number $a$ and translating by $(a,0,0)$. $\endgroup$
    – bradhd
    Apr 4, 2012 at 13:51
  • $\begingroup$ Sure, dimension can go down easily, but it cannot go up easily (and cannot go up by smooth maps). $\endgroup$ Apr 4, 2012 at 14:22
1
$\begingroup$

Basically you don't want to mix rotations with translations, because rotations are composed by multiplying quaternions while translations are composed by adding vectors.

$\endgroup$
3
  • 1
    $\begingroup$ The alternative is the dual quaternion, which Gerard mentioned (albeit not by name) - they are composed the same way, the "sandwich" (a)(bcb*)(a*) = (ab)c(ba) = (ab)c(ab)*, which means a long sequence on the LHS only needs to be conjugated after the fact to find the RHS. So, you don't need to break a long sequence of quaternions just to translate by addition, and you don't need to resort to an equally long sequence of full 4x4 matrices. euclideanspace.com/maths/algebra/realNormedAlgebra/other/… is a decent place to start. $\endgroup$
    – John P
    Dec 2, 2017 at 0:08
  • 1
    $\begingroup$ Ran out of room, but here's a cool application of dual quaternions. cs.utah.edu/~ladislav/kavan06dual/kavan06dual.pdf $\endgroup$
    – John P
    Dec 2, 2017 at 0:12
  • $\begingroup$ This seems to make sense, but I have a scenario where p1 = (translation_1, rot_quat_1) and p2 = (translation_2, rot_quat_2). Is this approach correct: p1 * p2 = (translation_1 * rot_quat_2 + translation_2, rot_quat_1 * rot_quat_2) where translation_1 * rot_quat_2 can be computed using the approach described gamedev.stackexchange.com/questions/28395/… $\endgroup$
    – Olshansky
    Sep 29, 2018 at 23:07
1
$\begingroup$

It is true that you get a translation by combining two rotations around different axes, but these axes need to be parallel.

On the other hand the group of rotations of $\Bbb R^3$ (after its identification with the $3$-dimensional space $\Bbb H_0$ of traceless quaternions) defined by $\Bbb H^\times$, the multiplicative group of quaternions, is that described by the transformations $$ x\mapsto hxh^{-1} $$ where $x\in\Bbb H$ and $h\in\Bbb H^\times$. The axes of two rotations of this kind are never parallel since they always meet in $0\in\Bbb H_0$ which is fixed by any of them.

This explains why translations do not occur in this group of transformations.

$\endgroup$
1
$\begingroup$

Translations are rotations around axes in the plane at infinity. They can be described by means of unit quaternions once you define such a rotation as $[1, \epsilon \vec{t} ]$ where $\epsilon$ has the property $\epsilon^2=0$.

$\epsilon$ is an infinitesimal quantity that in combination with an axis at infinity gives a finite translation along a straight line.

You can also translate through infinity by means of the unit quaternion $[\epsilon t, \hat{t} ]$, where $t$ is the length of $\vec{t}$ and $\hat{t} = \vec{t} / t$.

$\endgroup$
3
  • $\begingroup$ That's a dual quaternion, not a unit quaternion - units i, j, and e each double the base dimension, so you have 8 dimensions to work with. That is, C x C x D (or D x C x C, or D x H, etc.) $\endgroup$
    – John P
    Dec 1, 2017 at 23:56
  • $\begingroup$ Well I meant units of dual quaternions obviously ... $\endgroup$
    – Gerard
    Dec 3, 2017 at 11:38
  • $\begingroup$ I knew you did, but no one calls them unit quaternions because that's the name used for versors! First sentence, en.wikipedia.org/wiki/Quaternions_and_spatial_rotation. It would have been a good time to bring up geometric/Clifford algebras, the hypercomplex numbers by name, something like that. It's obvious what you meant, but maybe not to someone asking the question. $\endgroup$
    – John P
    Dec 3, 2017 at 17:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .