3.5.8 · D1Guidance, Navigation & Control (GNC)

Foundations — Quaternion rotation formula — rotating vector v by quaternion q

2,766 words13 min readBack to topic

Before you can trust the formula , every piece of it must mean something concrete. This page builds each symbol from nothing — plain words, then a picture, then the reason the topic can't live without it. Read top to bottom; each block leans on the one above.


0 · An arrow in space — the vector

Picture: an arrow leaving the origin (the corner ) and ending at the tip . The shadow it casts on each axis gives you , , back.

Why the topic needs it: the entire job is turning such an arrow. If you can't picture the arrow, "rotate " is just noise. Look at the figure — the amber arrow is our .

Figure — Quaternion rotation formula — rotating vector v by quaternion q

The length (or norm) of the arrow is written and, by Pythagoras in 3D, This is just "how long is the diagonal of the box with sides ". A rotation must never change this length — turning an arrow does not stretch it.


1 · Two ways arrows talk — dot product and cross product

The Hamilton product (the engine of the whole topic) is built out of two smaller operations on arrows. We meet them first, alone, so they aren't scary later.

Picture: the shadow of arrow cast onto arrow . Long shadow means they agree; no shadow (perpendicular) means the dot product is .

Picture: two arrows lie flat on a table; their cross product stands straight up out of the table. If the two arrows are parallel, there's no parallelogram → the cross product is the zero arrow.

Figure — Quaternion rotation formula — rotating vector v by quaternion q

2 · Angle and axis — how we describe a turn

Picture: a globe on a stick. The stick is ; every point on the surface swings around it by . Points on the stick don't move at all.

Why the hat? The little hat always means "this arrow has length exactly ", so . We only care about the direction of the axis, not its length, so we normalise it — divide by its own length until it's unit long.

Figure — Quaternion rotation formula — rotating vector v by quaternion q

Why the topic needs it: the quaternion is literally built from and . No axis-angle picture, no quaternion.


3 · Trig you'll actually use — , , and the half-angle

The quaternion stores and , so we must be clear on what these mean and why the angle gets halved.

Picture: a clock hand of length . Its horizontal shadow is ; its vertical shadow is . At : . At : .


4 · The imaginary units — three ways to say "turn"

Picture: think of as three perpendicular directions (like ). Multiplying two of them in the cyclic order gives the next one (right-hand rule); multiplying them backwards gives the third one pointing the other way (the minus sign). This "order matters" is exactly why rotations don't commute.

Why the topic needs it: these multiplication rules ARE the machine. When you expand a quaternion product using them, the dot product falls out of the style terms and the cross product falls out of the / style terms — that's the whole shape of the Hamilton product below.


5 · The Hamilton product — multiplying two quaternions

Before the quaternion can act on anything, we need to know how to multiply quaternions. This one rule is the engine of .

Why the topic needs it: the whole formula is two Hamilton products in a row. Without this rule the sandwich is just symbols; with it, it's a concrete calculation.


6 · The quaternion itself — scalar + vector

Picture: a labelled tag with two pockets — one pocket holds the single number , the other holds the arrow . For a rotation, (how much not to turn) and (the axis, scaled by how much to turn).

Picture: if is "turn about ", then is "turn about " — spin forward, then spin back, you're home.


7 · Putting the symbols into the sandwich

Now the parent formula reads in plain English:

\;=\;\underbrace{q}_{\text{wrap}}\;\underbrace{(0,\mathbf v)}_{\text{arrow}}\;\underbrace{q^{-1}}_{\text{unwrap}}.$$ - $q$ carries axis $\hat n$ and **half** the angle ($\cos\frac\theta2,\ \sin\frac\theta2\hat n$). - $v=(0,\mathbf v)$ is the arrow disguised as a pure quaternion. - $q^{-1}=q^*$ is the undo-wrapper on the right, needed so the output stays a pure quaternion (a real arrow again). - Both multiplications are **Hamilton products** (§5) — and $q,-q$ give the same answer. Every symbol above is now earned. The parent note's derivation is just these blocks in motion. --- ## Prerequisite map ```mermaid graph TD V["Vector v = arrow in 3D"] --> DOT["Dot product = agreement"] V --> CROSS["Cross product = twist arrow"] DOT --> HAM["Hamilton product"] CROSS --> HAM AX["Axis n-hat and angle theta"] --> TRIG["cos and sin plus half-angle"] TRIG --> Q["Quaternion q = w plus vector part"] IJK["Units i j k with ij = k and ji = minus k"] --> HAM IJK --> Q HAM --> Q Q --> INV["Conjugate and inverse"] Q --> DC["Double cover q and minus q"] V --> PURE["Pure quaternion 0 comma v"] Q --> SAND["Sandwich v prime = q v q inverse"] INV --> SAND DC --> SAND PURE --> SAND SAND --> TOPIC["Quaternion rotation formula 3.5.8"] ``` This feeds directly into [[Quaternion rotation formula — rotating vector v by quaternion q (index 3.5.8)|the parent formula]], and the same foundations power [[Quaternion algebra & Hamilton product]], [[Rodrigues' rotation formula]], and [[Rotation matrices & orthogonality]]. Once solid, you're ready for [[SLERP — quaternion interpolation]] and [[Angular velocity & quaternion kinematics $\dot q=\tfrac12 q\omega$]] in [[Spacecraft attitude determination (GNC)]] — and you'll understand why [[Euler angles & gimbal lock]] pushed engineers toward quaternions in the first place. --- ## Equipment checklist Test yourself — cover the right side and answer before revealing. What three numbers describe a vector, and what do they mean? ::: $(x,y,z)$ — how far to walk east, north, up; the arrow's tip. How do you find a vector's length? ::: $|\mathbf v|=\sqrt{x^2+y^2+z^2}$ (Pythagoras in 3D). When is a dot product zero? ::: When the two arrows are perpendicular ($\cos 90^\circ=0$). What does a cross product produce, and when is it the zero arrow? ::: A new arrow perpendicular to both; zero when the two arrows are parallel. What does the hat in $\hat n$ mean? ::: The axis arrow has length exactly $1$ (it's normalised). What are $\cos\theta$ and $\sin\theta$ on the unit circle? ::: Horizontal and vertical position of the point at angle $\theta$. State the two double-angle identities. ::: $\cos\theta=\cos^2\tfrac\theta2-\sin^2\tfrac\theta2$ and $\sin\theta=2\cos\tfrac\theta2\sin\tfrac\theta2$. How do you pick the sign of $\sin\tfrac\theta2$ when $\theta>180^\circ$? ::: Replace $\theta$ by the equivalent angle in $[-180^\circ,180^\circ]$ first, then halve; keep $\cos\tfrac\theta2,\sin\tfrac\theta2\ge 0$. What is $ij$? What is $ji$? ::: $ij=k$; $ji=-k$ (order flips the sign — non-commutative). Give all six unit products. ::: Cyclic: $ij=k,\ jk=i,\ ki=j$; reverse: $ji=-k,\ kj=-i,\ ik=-j$. Write the Hamilton product of $(w_1,\mathbf v_1)$ and $(w_2,\mathbf v_2)$. ::: $(w_1w_2-\mathbf v_1\!\cdot\!\mathbf v_2,\ \ w_1\mathbf v_2+w_2\mathbf v_1+\mathbf v_1\times\mathbf v_2)$. Does quaternion multiplication commute? ::: No — $q_1q_2\ne q_2q_1$ in general (the cross-product term flips sign). Write a quaternion in scalar-plus-vector form. ::: $q=(w,\ \mathbf v)$ with scalar $w$ and vector part $\mathbf v$. What makes a quaternion a "unit" quaternion? ::: $\|q\|=\sqrt{w^2+x^2+y^2+z^2}=1$. What is a pure quaternion? ::: One with zero scalar part: $(0,\ \mathbf v)$ — a disguised 3D arrow. For a unit quaternion, what is $q^{-1}$? ::: Its conjugate $q^*=(w,\ -\mathbf v)$ (flip the vector part's sign). Do $q$ and $-q$ give the same rotation? ::: Yes — the signs cancel in $qvq^{-1}$; unit quaternions double-cover rotations. Why does the rotation angle get halved inside $q$? ::: $q$ appears twice in $qvq^{-1}$; each copy supplies $\theta/2$, recombined by double-angle identities.