3

I can't calm down when I can't realize of principles of working on something. Quaternion is that place where I spend а few days! Unfortunately, not one lecture or book that I saw or read doesn't explain principe of working of quaternion in 4d, as it was understood by Sir Hamilton. Yes, we work in 4d and it's so hard to explain, but if quaternions are an expansion of complex numbers, they must work similarly. For example, why do we use in Euler formula for quaternions sin for any three coordinates of vector, if they are perpendicular to each other in imagined space? At the same time, we use cos only for real parts. $$ ql = \left[\cos \left(\frac{1}{2} \theta\right) , \sin \left(\frac{1}{2} \theta\right) (i+j+k)\right] $$

I explain it for myself as three Cartesian planes with the one common real component that defines a vector position in 4d. This is my attempt to somehow imagine a quaternion. Is it far from reality?

Why do we disregard of real part of coordinate in first part of Euler formula?

$$ ql = \left[cos \left(\frac{1}{2} \theta \right) (w), \sin \left(\frac{1}{2} \theta\right) (i+j+k)\right]. $$

Why do we need to multiply quaternions by involving sandwich if we don't need that in complex number multiplication?

$$ p^. = qpq^{-1} $$

Maybe I'm on wrong way to understanding quaternion by equating it to 2d complex number, let me know.

M. A.
  • 1,774
  • It is often misleading to compare a non-commutative ring to a commutative one. Although quaternions can seem at first sight only an "enhanced version" of complex numbers, the non-commutativity of the product give to them some properties that have just no counterpart in $\mathbb{C}$ (non-trivial conjugation, for instance, that you call for some strange reason "sandwich"). – Francesco Polizzi Jun 20 '17 at 13:13
  • Sorri, I met this slang in couple books. :) But it's theory of algebras and this only makes it difficult to understand the essence of quaternions. – hardCode Jun 20 '17 at 13:38

4 Answers4

4

Well it is always tricky trying to answer the question "why do things work they way they do" because the answer is usually a moving target.

Unfortunately, not one lectures or books what I saw or read don't explain principe of working of quaternion in 4d,

Well, Hamilton was not really 'thinking in $4$ dimensions' AFAIK... he was very interested in doing three dimensional geometry with quaternions. If you still think this is a sticking point you will have to explain what exactly you want to understand. As with most mathematics, you can get a get a long way by simply "getting used" to how things work, and then forming your own pictures as you go. Expecting a clear picture from the outset is often too ambitious.

I explain it for myself as three Cartesian plane with the one common real component which defines a vector position in 4d.

I do not think it is useful to think of quaternions as a vector position in $4$-D (that is going no further than thinking of $\mathbb R^4$.) Complex numbers are certainly a lot more than vector positions in $2$-D. You could think of $3$-space as two orthogonal Cartesian planes meeting on a real line, and you can think of $4$-space as three mutually orthogonal planes meeting on a real line. But this has more to do with $\mathbb R^3$ and $\mathbb R^4$ and not really anything to do with the quaternions.

This is my attempt to somehow imagine a quaternion.

Why is imagining quaternions any more challenging than imagining integers, rational numbers, or real numbers? It's just another, albeit different, number system that you can add, multiply and divide in. IMO more strenuous attempts to "imagine" ("imagine as an object in reality"?) do not yield anything useful compared to the amount of thinking that goes into it.

Is it far from reality?

I think we see this question sometimes, but it doesn't have an answer. I don't know what reality you're talking about. The usefulness of whatever picture a person has is relative to their own understanding of the subject, and stands on the merits of its own appeal. There is no standard of reality to measure a description against.

Why we disregard of real part of coordinate in first part of Euler formula?

I don't know what you're talking about. As I understand it, we do not disregard that part. I will give you my heuristic for rationalizing quaternion rotation below. I'm excerpting a couple slides from a talk I gave on quaternions:

Helpful identities

  1. If the coefficients of $q$ have Euclidean length $1$, then $q^{-1}=\bar q$.

  2. If $v$ and $w$ have real part zero, then

    1. The real part of $vw$ is $-1(v\bullet w)$.
    2. The pure quaternion part of $vw$ is $v\times w$.
  3. If $u^2=-1$, $(\cos(\theta)+u\sin(\theta))(\cos(\theta)-u\sin(\theta))=\cos(\theta)^2+\sin(\theta)^2=1$ (basic trigonometry)

  4. If $u^2=-1$, $(\cos(\theta)+u\sin(\theta))(\cos(\theta)+u\sin(\theta))=\cos(2\theta)+u\sin(2\theta)$ (De Moivre's formula)

Rationalizing quaternions' multiplication action on the model of $3$-space

The model of $3$-space I'm referring to, of course, is the space of quaternions with real part zero. As usual, we take $q = \cos(\theta/2)+u\sin(\theta/2)$ as the rotation quaternion, where $u$ is a unit vector pointing along the axis of rotation and $\theta$ is the angle of rotation around the axis measured using the right-hand rule. We aim to make the 'sandwich' action look more like what happens in complex arithmetic

  1. $u$ is unmoved by $q$: $$quq^{-1}= (\cos(\theta/2)+u\sin(\theta/2))u(\cos(\theta/2)-u\sin(\theta/2))=\\ (\cos(\theta/2)+u\sin(\theta/2))(\cos(\theta/2)-u\sin(\theta/2))u=\\ (\cos(\theta/2)^2-(u\sin(\theta/2)^2))u=\\ (\cos(\theta/2)^2+\sin(\theta/2)^2)u=u$$

  2. if $v$ is a unit length pure quaternion orthogonal to $u$: $$qvq^{-1}= (\cos(\theta/2)+u\sin(\theta/2))v(\cos(\theta/2)-u\sin(\theta/2))=\\ (\cos(\theta/2)+u\sin(\theta/2))(\cos(\theta/2)+u\sin(\theta/2))v=\\ (\cos(\theta/2)+u\sin(\theta/2))^2v=\\ (\cos(\theta)+u\sin(\theta))v\leftarrow\text{looks like a rotation in the complex plane}$$

  3. $q$ leaves $u$ unchanged and rotates its normal plane by $\theta$. Everything else follows rigidly, so we have the rotation explained in terms that look like complex arithmetic.

There is one critical thing to notice here, though: in the last expression, $u$ and $v$ would both be $i$ in complex arithmetic. Let me try to explain that. The circle of quaternions that cause rotations around $u$ live in the plane $P$ spanned by $1$ and $u$. They are acting on the set $P^\perp$, the orthogonal complement of the first plane. You can see we need at least $4$ dimensions to fit these together in the same space.

I don't know the right way to explain how this can be aligned with complex multiplication, but I believe there is a concrete rationalization. In simple terms, I think it has to do with shifting perspective that the things you are operating on live in $P^\perp$ to operating on things in $P$. In harder terms, I believe it has to do with a duality between $P$ and $P^\perp$, which I've seen explained in some texts on Clifford/geometric algebra, but I do not properly know.

Final word

I believe also there is another good explanation of how the 'sandwich' action arises, an explanation that relies on exponential maps and Lie algebra, which again I have not fully absorbed. I leave it to someone who is more familiar with that field to provide a complementary answer along those lines.

rschwieb
  • 160,592
0

I found this helpful article for basic understanding of quaternions.

0

For this answer I will identify $\mathbb{R}^3$ with the purely imaginary quaternions and although the quaternions are themselves a vector space, to avoid confusion I'll reserve the term 'vector' for members of $\mathbb{R}^3$.

There are 2 key identities which we will need, the first is the quaternion product of two vectors $a, b$

$$ab = -a \cdot b + a \times b$$

Which is a quaternion whose scalar part is the negative dot product of $a,b$ and whose vector part is the their cross product. This is derived by distributing terms, evaluating the products of imaginary units according to the quaternion multiplication table, and regrouping terms.

The second is a consequence of the first, for any unit vector $\hat n$ we have,

$$\hat n^2 = -\hat n \cdot \hat n + \hat n \times \hat n = -1 + 0 = -1$$

If you were to take a proof of Euler's formula for the complex numbers using Taylor series, replace every occurrence of $i$ with $\hat n$, and afterwards evaluate whether each step in that proof is still mathematically valid, you would find that they are, giving us Euler's formula for the quaternions,

$$e^{\theta \hat n} = cos(\theta) + sin(\theta) \hat n$$

One thing we can note is that any quaternion which lies in the $\{1,\hat n\}$-plane, the plane spanned by $1$ and $\hat n$, may be written in the form,

$$Ae^{\psi \hat n}$$

Where $A$ is a scalar magnitude and $\psi$ is a scalar angle, analogously to the polar form of complex numbers.

If we left-multiply such a quaternion by $e^{\theta \hat n}$,

$$e^{\theta \hat n} Ae^{\psi \hat n} = Ae^{(\psi + \theta) \hat n}$$

$A$ is a scalar and so commutes with $e^{\theta \hat n}$, and $\theta \hat n$ commutes with $\psi \hat n$ so we may combine the exponentials. We interpret the result as a rotation by an angle $\theta$ within the $\{1,\hat n\}$-plane.

If we right-multiply the same quaternion by $e^{\theta \hat n}$,

$$Ae^{\psi \hat n} e^{\theta \hat n} = Ae^{(\psi + \theta) \hat n}$$

We get the same result, a rotation by an angle $\theta$ within the $\{1,\hat n\}$-plane. $e^{\theta \hat n}$ commutes with quaternions in the $\{1,\hat n\}$-plane.

We can now try left-multiplying a unit vector $\hat p$ which is orthogonal to $\hat n$ by $e^{\theta \hat n}$,

$$e^{\theta \hat n} \hat p = \big( cos(\theta) + sin(\theta) \hat n \big) \hat p$$

$$= cos(\theta) \hat p + sin(\theta) \hat n \hat p$$

$$= cos(\theta) \hat p + sin(\theta) (-\hat n \cdot \hat p + \hat n \times \hat p)$$

$$= cos(\theta) \hat p + sin(\theta) \hat n \times \hat p$$

$\hat n \times \hat p$ is unit vector orthogonal to both $\hat n$ and $\hat p$, I'll define $\hat h = \hat n \times \hat p$. In search of a geometric interpretation we try a couple angles of $\theta$, when $\theta = 0$ the result is $\hat p$, when $\theta = \pi / 2$, the result is $\hat h$, it's then not too difficult to see that this is a rotation of $\hat p$ by an angle $\theta$ within the $\{\hat p,\hat h\}$-plane, which is also the plane orthogonal to $\hat n$ within 3D space. You can use the right hand rule to verify that this is a right-handed rotation around $\hat n$. We can note that any quaternion which lies within the $\{\hat p,\hat h\}$-plane may be expressed in the form,

$$Be^{\varphi \hat n} \hat p$$

Where $B$ is a scalar magnitude and $\varphi$ is a scalar angle, again analogously to the polar form of complex numbers.

If we instead right-multiply $\hat p$ by $e^{\theta \hat n}$,

$$\hat p e^{\theta \hat n} = \hat p \big( cos(\theta) + sin(\theta) \hat n \big)$$

$$= cos(\theta) \hat p + sin(\theta) \hat p \hat n$$

$$= cos(\theta) \hat p + sin(\theta) (-\hat p \cdot \hat n + \hat p \times \hat n)$$

$$= cos(\theta) \hat p - sin(\theta) \hat n \times \hat p$$

$$e^{-\theta \hat n} \hat p$$

We see that we instead get a rotation by $-\theta$ or a left-handed rotation around $\hat n$, $e^{\theta \hat n}$ does not commute with quaternions in the $\{\hat p,\hat h\}$-plane, it must be conjugated in order to reverse the order of multiplication with $\hat p$. We arrive at the following results for left and right multiplication of quaternions in the $\{\hat p,\hat h\}$-plane by $e^{\theta \hat n}$,

$$e^{\theta \hat n} Be^{\varphi \hat n} \hat p = Be^{(\varphi + \theta) \hat n} \hat p$$

$$Be^{\varphi \hat n} \hat p e^{\theta \hat n} = Be^{(\varphi - \theta) \hat n} \hat p$$

As $\{\hat n, \hat p, \hat h\}$ are mutually orthogonal unit vectors which span 3D space, it follows that $\{1, \hat n, \hat p, \hat h\}$ is an orthonormal basis for all quaternions. Any quaternion can be expressed as a linear combination of $\{1, \hat n\}$ summed with a linear combination of $\{\hat p, \hat h\}$, which we can write in the polar forms we found above,

$$q = Ae^{\psi \hat n} + Be^{\varphi \hat n} \hat p$$

For fixed $\hat n$ and $\hat p$, the 4 degrees of freedom in a general quaternion are contained in $A, \psi, B, \varphi$, a set of polar coordinates for each plane. Expressed in this form it is easy to see the effects of left and right multiplication of a general quaternion by $e^{\theta \hat n}$,

$$e^{\theta \hat n} q = Ae^{(\psi + \theta) \hat n} + Be^{(\varphi + \theta) \hat n} \hat p$$

$$q e^{\theta \hat n} = Ae^{(\psi + \theta) \hat n} + Be^{(\varphi - \theta) \hat n} \hat p$$

Left-multiplication rotates both components of $q$ by an angle $\theta$ within their respective planes, while right-multiplication rotates the component of $q$ within the $\{1, \hat n\}$-plane by an angle $\theta$ within that plane and the component of $q$ in the $\{\hat p, \hat h\}$-plane by an angle $-\theta$ within that plane.

If we wanted to rotate only one component of $q$ instead of both of them, we can use the two sided multiplications with half-angles, these result in the rotations within one plane adding up to a total of $\theta$ and the rotations within the other plane cancelling out to $0$,

$$e^{\theta \hat n / 2} q e^{\theta \hat n / 2} = e^{\theta \hat n / 2} \big( Ae^{\psi \hat n} + Be^{\varphi \hat n} \hat p \big) e^{\theta \hat n / 2}$$

$$= Ae^{\theta \hat n / 2} e^{\psi \hat n} e^{\theta \hat n / 2} + Be^{\theta \hat n / 2} e^{\varphi \hat n} \hat p e^{\theta \hat n / 2}$$

$$= Ae^{\theta \hat n / 2} e^{\psi \hat n} e^{\theta \hat n / 2} + Be^{\theta \hat n / 2} e^{\varphi \hat n} \hat e^{-\theta \hat n / 2} \hat p$$

$$= Ae^{(\psi + \theta) \hat n} + Be^{\varphi \hat n} \hat p$$

$$e^{\theta \hat n / 2} q e^{-\theta \hat n / 2} = e^{\theta \hat n / 2} \big( Ae^{\psi \hat n} + Be^{\varphi \hat n} \hat p \big) e^{-\theta \hat n / 2}$$

$$= Ae^{\theta \hat n / 2} e^{\psi \hat n} e^{-\theta \hat n / 2} + Be^{\theta \hat n / 2} e^{\varphi \hat n} \hat p e^{-\theta \hat n / 2}$$

$$= Ae^{\theta \hat n / 2} e^{\psi \hat n} e^{-\theta \hat n / 2} + Be^{\theta \hat n / 2} e^{\varphi \hat n} \hat e^{\theta \hat n / 2} \hat p$$

$$= Ae^{\psi \hat n} + Be^{(\varphi + \theta) \hat n} \hat p$$

We can see that by using the two-sided multiplications with half-angles we can successfully isolate the rotation in the $\{1, \hat n\}$-plane if we don't conjugate second factor of $e^{\theta \hat n}$, and the rotation in the $\{\hat p, \hat h\}$-plane if we do conjugate it.

Now if our goal is to rotate a vector $v$ within 3D space by an angle $\theta$ around axis $\hat n$, then we would like the component of $v$ in the $\{\hat p, \hat h\}$-plane to rotate by an angle $\theta$, and the component parallel to $\hat n$ i.e. the component in the $\{1, \hat n\}$-plane to remain fixed, we certainly don't want it to rotate into some non-physical 4th dimension, so we cannot use either of the one-sided multiplications as they do in general rotate the component within the $\{1, \hat n\}$-plane. We must use the conjugated two-sided multiplication to achieve this as we found above, giving us our final vector rotation formula,

$$v' = e^{\theta \hat n / 2} v e^{-\theta \hat n / 2}$$

Expanding out the exponentials gives us the familiar format of the rotation formula,

$$v' = \big(cos(\theta / 2) + sin(\theta / 2) \hat n \big) v \big(cos(\theta / 2) - sin(\theta / 2) \hat n \big)$$

So to answer your questions, you don't need to use the cos-sin representation of the rotation quaternions, they have exponential representations as well. You were on the right track by looking for the connection to 2D rotation using complex exponentials, we can view quaternion multiplication as two rotations in two orthogonal planes which are individually not too dissimilar from the 2D case. If you want to rotate a vector around an axis, then you want don't want the component of that vector which is parallel to the rotation axis to change, but the one-sided transformations will rotate this component into the real axis in general, so we need to strategically use two of them in order to get this unwanted rotation to cancel out, and that's why we need the two-sided transformation.

Theta n
  • 158
  • This seven year old question has an accepted answer with four upvotes. Besides: how quaternions are used to rotate vectors is well known. What is the added value of your lengthy answer? – Kurt G. Nov 24 '24 at 09:19
0

From a modern algebraist's point of view, quaternions are a generalization of the ring of matrices.

Concretely, start with any field $K$ (e.g, $K=\mathbb{Q}$, $\mathbb{R}$ or $\mathbb{C}$) and let $$ \mathrm{M}(K)= \left\{ \left(\left.\begin{array}{}a & b\\ c & d\end{array}\right) \,\right|\,a,b,c,d\in K\right\}. $$ It is a ring under matrix multiplication and the following facts hold.

  • $\mathrm{M}(K)$ has dimension $4$ over $K$;
  • up to identify $K$ with the scalar matrices, $K$ is exactly the subset of matrices that commute with all others (the centre of $\mathrm{M}(K)$);
  • $\mathrm{M}(K)$ is simple, i.e. it does not contain non-trivial ideals, namely additive subgroups $I$ such that $\mathrm{M}(K)\cdot I\subset I$ and $I\cdot\mathrm{M}(K)\subset I$ under matrix multiplication.

Then one says that a quaternion algebra over $K$ is a ring that contains $K$ and satisfies the very same list of properties.

Note that if we let $$ i=\left(\begin{array}{c}1 & 0\\ 0 & -1\end{array}\right),\qquad i=\left(\begin{array}{c}1 & 0\\ 0 & -1\end{array}\right), $$ we have that every $m\in\mathrm{M}(K)$ can be written as $$ m=\alpha+\beta i+\gamma j+\delta ij\qquad (\ast1) $$ for some $\alpha,\beta,\gamma,\delta\in K$ and $$ i^2=1,\quad j^2=1,\quad ij+ji=0. \qquad(\ast2) $$ It turns out that any quaternion algebra $Q$ can be described as the set of expressions $(\ast1)$ where the relations $(\ast2)$ are replaced by $$ i^2=r,\quad j^2=s,\quad ij+ji=0. \qquad(\ast3) $$ for suitable non-zero $r,s\in K$.

When $K=\mathbb{R}$ we get the Hamilton quaternions $\mathbb{H}$ by taking $r=s=-1$.

One of the main points of this general view of quaternions is that if $Q$ is a quaternion algebra over the field $K$ described by $(\ast1)$, $(\ast3)$, then there always exists a field extension $$ K\subset L $$ (in fact a quadratic extension) such that the algebra satisfying $(\ast3)$ and described by $(\ast1)$ where the coefficients are taken in $L$ is actually (isomorphic to) $\mathrm{M}(L)$.

In concrete terms, $Q$ is always a subalgebra of an algebra of matrices.

In particular for the Hamilton quaternions we have $\mathbb{H}\subset\mathrm{M}(\mathbb{C})$.

Andrea Mori
  • 28,458