Skip to main content
Open In Colab A 2×22 \times 2 matrix has four entries, so you can think of it as a single point in R4\mathbb{R}^4. Most of those points are not rotations. A rotation matrix must satisfy three constraints: each column has unit length (two constraints), and the two columns are orthogonal (one more). Four numbers minus three constraints leaves one degree of freedom, the angle θ\theta. R(θ)=[cos⁡θ−sin⁡θsin⁡θcos⁡θ]R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} As θ\theta changes, R(θ)R(\theta) moves through R4\mathbb{R}^4 and traces a curve. That curve is SO(2)SO(2). It is a one-dimensional manifold living inside a four-dimensional space. In this section you build the curve numerically, find out what shape it is, and see how a velocity along it gives an element of so(2)\mathfrak{so}(2).

Background on Lie groups and their algebras

Rigid-body configurations are encoded by 4×4 homogeneous transformation matrices. Rotation matrices R∈SO(3)R \in SO(3) represent orientation. Six-dimensional twists describe spatial velocities. Six-dimensional wrenches represent spatial forces. The table lists the spaces used in rigid-body motion representations, with the notation of Lynch and Park (Kevin M. Lynch, 2017). SO(n)SO(n) and SE(n)SE(n) are Lie groups, the curved spaces where configurations live. so(n)\mathfrak{so}(n) and se(n)\mathfrak{se}(n) are their Lie algebras, the flat tangent spaces at the identity where velocities live. The matrix exponential maps a velocity to a configuration: exp⁡:so(3)→SO(3)\exp: \mathfrak{so}(3) \to SO(3) and exp⁡:se(3)→SE(3)\exp: \mathfrak{se}(3) \to SE(3). The matrix logarithm goes the other way, from a configuration to a velocity that produces it in unit time: log⁡:SO(3)→so(3)\log: SO(3) \to \mathfrak{so}(3) and log⁡:SE(3)→se(3)\log: SE(3) \to \mathfrak{se}(3). The exponential is many-to-one: in the plane, the angles θ\theta and θ+2π\theta + 2\pi give the same rotation, so a rotation has many logarithms. Choosing a branch makes the logarithm a function, and the usual choice is the principal angle in (−π,π](-\pi, \pi]. On that branch the logarithm inverts the exponential. The [⋅][\cdot] operator turns a vector in R3\mathbb{R}^3 or R6\mathbb{R}^6 into its matrix form in so(3)\mathfrak{so}(3) or se(3)\mathfrak{se}(3). This section studies the first two rows of the table, SO(2)SO(2) and so(2)\mathfrak{so}(2). They are small enough that you can compute and draw everything about them.

Sampling the curve

Each sample of θ\theta gives one rotation matrix. Flattening the matrix row by row gives its point in R4\mathbb{R}^4, with coordinates (r11,r12,r21,r22)(r_{11}, r_{12}, r_{21}, r_{22}).

The shape of the curve

The four coordinates of R(θ)R(\theta) are (cos⁡θ,−sin⁡θ,sin⁡θ,cos⁡θ)(\cos\theta, -\sin\theta, \sin\theta, \cos\theta). Two of them repeat the other two: r22=r11r_{22} = r_{11} and r12=−r21r_{12} = -r_{21}. These two linear relations confine the curve to a two-dimensional plane inside R4\mathbb{R}^4. Within that plane, the remaining constraint r112+r212=1r_{11}^2 + r_{21}^2 = 1 is the equation of a circle. So SO(2)SO(2) is a circle. Its distance from the origin of R4\mathbb{R}^4 is the Frobenius norm of RR, which is 2\sqrt{2} for every rotation. The curve is also closed: θ\theta and θ+2π\theta + 2\pi give the same matrix, so walking once around brings you back to where you started.

Drawing the curve

You cannot draw R4\mathbb{R}^4, but for rotations you do not need to. Because r22r_{22} always equals r11r_{11}, dropping it loses no information. The plot below uses the three coordinates (r11,r21,r12)(r_{11}, r_{21}, r_{12}), and the color shows the angle θ\theta. The curve is a tilted circle centered on the origin. Output from cell 3

The determinant as signed area

The unit square has corners (0,0)(0,0), (1,0)(1,0), (1,1)(1,1) and (0,1)(0,1). Its sides are the basis vectors e1=(1,0)\mathbf{e}_1 = (1, 0) and e2=(0,1)\mathbf{e}_2 = (0, 1), and its area is 1. A matrix sends e1\mathbf{e}_1 to its first column and e2\mathbf{e}_2 to its second column, so it turns the unit square into the parallelogram spanned by its two columns. For A=[abcd]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} that parallelogram has signed area ad−bcad - bc, which is det⁡A\det A. Because the square started with area 1, the determinant is the factor by which the matrix scales area. The same factor applies to every region, since any region can be tiled with small squares. The sign records orientation. Walking around the unit square from e1\mathbf{e}_1 to e2\mathbf{e}_2 is a counterclockwise turn. If the image of e2\mathbf{e}_2 is still counterclockwise from the image of e1\mathbf{e}_1, the determinant is positive. If the matrix flips the square over like a mirror, that turn becomes clockwise and the determinant is negative. A determinant of zero means the square is flattened onto a line and the matrix cannot be undone. The determinant is not a measure of how large a matrix is. [3001/3]\begin{bmatrix} 3 & 0 \\ 0 & 1/3 \end{bmatrix} stretches one direction by a factor of 3, yet its determinant is 1, because the squeeze in the other direction cancels the stretch in area. How far a matrix can stretch a vector is measured by its norm or its singular values instead.
Output from cell 5 In the rotation, the red and blue arrows keep their counterclockwise order and the square keeps its area. In the reflection, the area is unchanged but the blue arrow now sits clockwise from the red one. The uniform scaling multiplies the area by 1.52=2.251.5^2 = 2.25. The stretch and squeeze changes the shape a lot but keeps the area. The singular matrix sends both columns onto the same line, so the square has no area left.

Rotations and reflections

Orthonormal columns alone do not make a rotation. The matrices F(θ)=[cos⁡θsin⁡θsin⁡θ−cos⁡θ]F(\theta) = \begin{bmatrix} \cos\theta & \sin\theta \\ \sin\theta & -\cos\theta \end{bmatrix} also have orthonormal columns, but det⁡F=−1\det F = -1. Each one is a reflection across a line through the origin. As θ\theta changes, they trace a second circle in R4\mathbb{R}^4. Together the two circles make up O(2)O(2), the group of all orthogonal 2×22 \times 2 matrices, and the condition det⁡R=+1\det R = +1 selects the circle that contains the identity. No continuous path of orthogonal matrices can turn a rotation into a reflection, because det⁡\det would have to jump from +1+1 to −1-1. So SO(2)SO(2) is a manifold in its own right, not just half of O(2)O(2). The code below confirms that every rotation is at exactly the same distance, 2, from every reflection.

Seeing both circles

The coordinates (r11,r12,r21,r22)(r_{11}, r_{12}, r_{21}, r_{22}) hide the geometry. A better set of axes for R4\mathbb{R}^4 comes from the relations each family satisfies: a=r11+r222,b=r21−r122,c=r11−r222,d=r21+r122a = \tfrac{r_{11} + r_{22}}{\sqrt{2}}, \quad b = \tfrac{r_{21} - r_{12}}{\sqrt{2}}, \quad c = \tfrac{r_{11} - r_{22}}{\sqrt{2}}, \quad d = \tfrac{r_{21} + r_{12}}{\sqrt{2}} These four axes are orthonormal, so they describe the same space with no distortion. A rotation has c=d=0c = d = 0 and lands at (a,b)=2(cos⁡θ,sin⁡θ)(a, b) = \sqrt{2}(\cos\theta, \sin\theta). A reflection has a=b=0a = b = 0 and lands at (c,d)=2(cos⁡θ,sin⁡θ)(c, d) = \sqrt{2}(\cos\theta, \sin\theta). So R4\mathbb{R}^4 splits into two perpendicular planes. The rotations fill a circle of radius 2\sqrt{2} in the (a,b)(a, b) plane, and the reflections fill a circle of the same radius in the (c,d)(c, d) plane. Each circle collapses to the origin of the other plane. That also explains the constant distance: any rotation is 2\sqrt{2} from the origin in one plane, any reflection is 2\sqrt{2} from the origin in the perpendicular plane, and by Pythagoras they are 2+2=2\sqrt{2 + 2} = 2 apart.
Output from cell 8

One column is enough

The first column of R(θ)R(\theta) is where the rotation sends the unit vector e1\mathbf{e}_1. It is the point (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta) on the unit circle of the plane. Once you know the first column, orthogonality and det⁡R=+1\det R = +1 fix the second: it is the first column turned by 90°90° counterclockwise. So every rotation corresponds to exactly one point on the unit circle, and every point on the unit circle to exactly one rotation. This is the precise sense in which SO(2)SO(2) is a circle. The top panel follows the first column as θ\theta grows. The row below shows the full rotated frame {Re1,Re2}\{R\mathbf{e}_1, R\mathbf{e}_2\} at each of the same angles. Output from cell 9

The tangent at the identity

A one-dimensional manifold looks like a straight line when you zoom in close enough. At the identity (θ=0\theta = 0), that line is the tangent to the curve. Its direction is the derivative of R(θ)R(\theta) at θ=0\theta = 0: dRdθ∣θ=0=[−sin⁡0−cos⁡0cos⁡0−sin⁡0]=[0−110]\left.\frac{dR}{d\theta}\right|_{\theta=0} = \begin{bmatrix} -\sin 0 & -\cos 0 \\ \cos 0 & -\sin 0 \end{bmatrix} = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} This is a skew-symmetric matrix, an element of so(2)\mathfrak{so}(2). Scaling it by an angular rate ω\omega gives every possible velocity at the identity, so so(2)\mathfrak{so}(2) is one-dimensional, just like SO(2)SO(2). The matrix exponential maps back onto the curve: exponentiating θ\theta times this tangent matrix reproduces R(θ)R(\theta).
Key references: (The Matrix Cookbook, n.d.)

References

  • Kevin M. Lynch, F. (2017). Modern Robotics.
  • (n.d.). The Matrix Cookbook.