Reading and display settings

Appearance

System follows your operating system and keeps following it, even if you change it later. The header's sun, moon and monitor cycle the same three options.

Text size (%) 100%

Default. Scales every text size on the site, equations and tables included.

Reading width 70ch

How much text runs across one line of prose. Narrower is easier to track; wider fits more on screen.

Line spacing 1.6

The leading on body text. Taller leading helps a tired eye stay on the line.

Density

Padding and gaps around controls, cards, and tables — how much breathing room the layout leaves itself.

Motion

System follows your operating system. Reduced removes every transition on this site. Full keeps them on unless your system asks for less.

1

Three faces of one group

Angle, unit complex number, rotation matrix

🎯 Goal: see that an angle, a unit complex number and a $2\times2$ rotation matrix are three encodings of one group, and that composition looks different in each.

A planar rotation by $\theta$ can be stored three ways, and each has its own composition rule:

$$ \underbrace{\theta_1 + \theta_2 \pmod{2\pi}}_{\text{angles}} \quad\longleftrightarrow\quad \underbrace{z_1 z_2,\ \ z = \cos\theta + i\sin\theta}_{\text{unit complex numbers}} \quad\longleftrightarrow\quad \underbrace{R(\theta_1)R(\theta_2),\ \ R(\theta)=\begin{bmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{bmatrix}}_{\text{matrices}} $$

They agree because multiplying complex numbers multiplies their lengths and adds their angles. The matrix $R(\theta)$ is just "multiply by $z$" written as a linear map of $(x, y)$. The angle representation is the only one with a catch: the "mod $2\pi$" is a seam you have to remember to handle. The complex and matrix forms have no seam, because they are the circle, not a line wrapped onto it. That is a pattern the rest of the series keeps: parameters have seams, the group itself does not.

The complex plane. $z_1$ and $z_2$ are on the unit circle; their product $z_1z_2$ lands at angle $\theta_1+\theta_2$. Drag either tip.

2

The tangent space at the identity: so(2)

Differentiate a path through I

🎯 Goal: find the Lie algebra by differentiating a curve of rotations at the identity, and see that its elements are skew-symmetric matrices.

Take a curve of rotations starting at the identity, $R(t) = R(\omega t)$, turning at rate $\omega$. Its velocity at $t=0$ is

$$ \dot R(0) = \omega\begin{bmatrix} -\sin 0 & -\cos 0\\ \cos 0 & -\sin 0\end{bmatrix} = \begin{bmatrix} 0 & -\omega \\ \omega & 0\end{bmatrix} = \omega\,E, \qquad E = \begin{bmatrix}0 & -1\\ 1 & 0\end{bmatrix}. $$

Every velocity through $I$ is a multiple of the one matrix $E$, the generator. The set of all of them, $\{\omega E : \omega\in\mathbb{R}\}$, is the Lie algebra $\mathfrak{so}(2)$: a 1-dimensional vector space of skew-symmetric matrices ($E^\top = -E$). Two small operators move between the number $\omega$ and the matrix $\omega E$. They look pedantic here and are indispensable in 3D:

$$ \omega^\wedge = \omega E \quad(\text{"hat"}: \mathbb{R}\to\mathfrak{so}(2)), \qquad (\omega E)^\vee = \omega \quad(\text{"vee"}: \mathfrak{so}(2)\to\mathbb{R}). $$

The demo approximates $\dot R(0)$ by a finite difference $\bigl(R(\omega h) - I\bigr)/h$. As $h$ shrinks, the matrix converges to $\omega E$: the diagonal (the $\cos$ part) fades, and the skew off-diagonal (the $\sin$ part) survives. The error shrinks in proportion to $h$.

Left: the chord from $I$ to $R(\omega h)$ versus the tangent direction. Right: $\log_{10}$ of the error $\lVert (R(\omega h)-I)/h - \omega E\rVert$ against $\log_{10} h$, a line of slope 1.

3

Exp: wrapping the line onto the circle

A power series that becomes cos and sin

🎯 Goal: compute $\exp(\theta E)$ from its power series, and see Euler's formula $e^{i\theta} = \cos\theta + i\sin\theta$ appear as the partial sums spiral onto the circle.

Given a velocity in the algebra, where does the rotation end up after unit time at that constant rate? The answer is the exponential map. For matrices it is defined by the same power series as for numbers:

$$ \exp(\theta E) = I + \theta E + \frac{(\theta E)^2}{2!} + \frac{(\theta E)^3}{3!} + \cdots $$

The key fact is $E^2 = -I$: the generator behaves exactly like $i$. The even powers are $\pm I$ and the odd powers are $\pm E$, so the series splits into the two familiar ones:

$$ \exp(\theta E) = \Bigl(1 - \tfrac{\theta^2}{2!} + \tfrac{\theta^4}{4!} - \cdots\Bigr) I + \Bigl(\theta - \tfrac{\theta^3}{3!} + \cdots\Bigr) E = \cos\theta\, I + \sin\theta\, E = R(\theta). $$

We write $\operatorname{Exp}(\theta) = \exp(\theta^\wedge)$ (capital E) for the version that takes the plain number. Each term of the series is a small arrow turned $90^\circ$ from the last, so the partial sums trace a spiral that closes in on the point at angle $\theta$. Push $\theta$ past $\pi$ and it still converges, only more slowly. Exp is defined on the whole line, which is why it can wrap the line around the circle again and again.

Each arrow is one term $\theta^n i^n/n!$. The blue dot is the exact $e^{i\theta}$. Add terms and watch the chain close in on it.

4

Log: unwrapping, and the principal branch

Many preimages, one chosen answer

🎯 Goal: see that Exp is many-to-one, that Log must pick one answer, and where its seam lies.

Exp wraps the whole real line around the circle infinitely many times: $\operatorname{Exp}(\theta) = \operatorname{Exp}(\theta + 2\pi k)$ for every integer $k$. So its inverse, the logarithm, has to choose. The standard choice is the principal branch: the unique preimage in $(-\pi, \pi]$.

$$ \operatorname{Log}(R) = \operatorname{atan2}(R_{21},\,R_{11}) \in (-\pi, \pi]. $$

Near the identity Log is perfectly smooth. At the point exactly opposite, $\theta = \pm\pi$, it jumps by $2\pi$: two rotations a hair apart on either side of $180^\circ$ get logs of about $+\pi$ and $-\pi$. That is the cut locus. It cannot be avoided, only kept away from. It will reappear in 3D as the sphere of radius $\pi$ (Part 5). The practical rule it gives is to always take Log of something close to the identity, which is exactly what $Y\ominus X = \operatorname{Log}(X^{-1}Y)$ does when $X$ and $Y$ are close.

Top: the circle, with the point $R$ (drag it). Bottom: the real line, with every preimage $\theta + 2\pi k$ of $R$ marked and the principal one in blue. The shaded band is $(-\pi, \pi]$.

5

Plus and minus: moving around the group

The two operators every algorithm uses

🎯 Goal: use $\oplus$ to step from a point and $\ominus$ to measure the step between two points. These are the only two operations an optimizer, a filter or an interpolator needs.

Exp and Log act at the identity. To act at any point $X$, compose with it:

$$ X \oplus \tau = X\cdot\operatorname{Exp}(\tau), \qquad Y \ominus X = \operatorname{Log}(X^{-1}Y), \qquad X \oplus (Y\ominus X) = Y. $$

In $SO(2)$ this is angle arithmetic with wrap-around: $\oplus$ adds and wraps, and $\ominus$ subtracts and wraps into $(-\pi, \pi]$. Because $SO(2)$ is commutative, it makes no difference whether you compose on the right, $X\operatorname{Exp}(\tau)$, or on the left, $\operatorname{Exp}(\tau)X$. In 3D it will, and Part 8 is devoted to that difference. The demo interpolates from $X$ to $Y$ by $X \oplus t\,(Y\ominus X)$, which always takes the short way round, and compares it with naive interpolation of the angle numbers, which sometimes takes the long way.

X ⊕ t(Y ⊖ X) angle-number interpolation
6

A first estimator on a Lie group

Gauss–Newton on the circle

🎯 Goal: estimate a heading from noisy compass readings with Gauss–Newton on $SO(2)$: residuals by $\ominus$, a linear solve in the tangent space, and an update by $\oplus$.

A robot takes $N$ noisy compass readings $z_i$ of a true heading. The least-squares estimate minimizes the sum of squared geodesic residuals:

$$ X^\star = \arg\min_X \sum_{i} r_i(X)^2, \qquad r_i(X) = z_i \ominus X. $$

Linearize by perturbing $X$ in its tangent space, $X \oplus \delta$. Then $r_i(X\oplus\delta) \approx r_i(X) - \delta$, so the Jacobian is $J_i = -1$. The Gauss–Newton step solves the normal equations $(J^\top J)\,\delta = -J^\top r$, which here gives $\delta = \tfrac1N\sum_i r_i$, and the update is $X \leftarrow X\oplus\delta$. Put the truth near north so the readings straddle the seam. The Lie-group solver converges in one or two steps. The naive solver, which does least squares on the raw angle numbers, lands on the wrong side of the circle.

Gray ticks are the readings. Blue is the Gauss–Newton estimate after each step (its path is drawn). Magenta dashed is least squares on raw angle numbers. The dark tick is the truth.

7

The dictionary you now own

Every object, and what it becomes in 3D

Everything above has a counterpart for 3D rotations and poses. In $SO(2)$ two of the objects, the adjoint and the Jacobians, are trivially $1$, because the group is commutative. They exist to correct for non-commutativity, so they only come alive in $SO(3)$ and $SE(3)$. That is the precise sense in which the circle "has nothing that can go wrong".

ObjectIn $SO(2)$In $SO(3)$Part
Element$R(\theta)$, or $z=e^{i\theta}$$R$ with $R^\top R=I$, $\det R=1$4
Lie algebra$\omega E$, skew $2\times2$$[\omega]_\times$, skew $3\times3$4
Hat / vee$\omega \leftrightarrow \omega E$$\omega\in\mathbb{R}^3 \leftrightarrow [\omega]_\times$4
Exp$\cos\theta\,I + \sin\theta\,E$Rodrigues' formula5
Log$\operatorname{atan2}$, cut at $\pm\pi$axis-angle, cut on $\lVert\omega\rVert = \pi$5
$\oplus$, $\ominus$add and subtract, wrapped$R\operatorname{Exp}(\delta)$, $\operatorname{Log}(R_1^\top R_2)$5
Bracket $[a,b]$$0$ (commutative)$a\times b$4
Adjoint $\mathrm{Ad}_X$$1$$R$8
Jacobians $J_r, J_l$$1$$I - \tfrac{1-\cos\theta}{\theta^2}[\omega]_\times + \cdots$9
8

Check your understanding

0/5 answered