Search

Search papers and lessons

Special Orthogonal Group SO(3)

Level 3 · 12 min read

SO(3) is the set of all 3×3 rotation matrices, the matrices that turn space without stretching it or flipping it, and matrix multiplication makes them a group.

On this page

  • Colour = topic mix
  • Linear algebra
  • Discrete math
  • Abstract algebra
  • Kinematics and dynamics
  • Sign in to see your progress

TL;DR

SO(3) is the set of all rotations of three-dimensional space, written as 3×3 matrices. A matrix belongs to it when it keeps every length and angle the same and does not flip anything into a mirror image. Doing one rotation after another is matrix multiplication, so the rotations form a group, and because they vary smoothly they form a Lie group.

Where you'll see it: in a robot's estimate of how its body is oriented, in the gyroscope integration inside a phone or drone's inertial sensor, and in the rigid-body transforms that place each link of a robot arm.

Intuition

Turning things without stretching them

Hold a book in front of you. You can spin it, tip it, or turn it over, and the book does not grow, shrink or bend. A rotation changes which way things point, but not how far apart they are. SO(3) is the collection of every way you can do that to the whole of 3D space while the origin stays put.

Why write it down as a set? Robots and phones have to store an orientation as numbers and then combine orientations. We need a rule that separates genuine rotations from the other 3×3 arrays of numbers. A random 3×3 array is usually a stretch or a shear, which would distort a robot's picture of the world. SO(3) is exactly the set of arrays that survive the test.

Why it is a group

Rotations can be chained. Turn the book a quarter turn about one axis, then a quarter turn about another, and the result is still a rotation. Every rotation can be undone by turning back. Doing nothing is itself a rotation. Chaining is associative, meaning that grouping the steps in different brackets gives the same result. Those four facts are the definition of a group, and they are what let a robot compose the orientations of its joints one after another.

Order matters, though. Turning the book forward and then sideways is not the same as sideways and then forward. We check this numerically in the worked examples. The group is non-commutative.

Why "special" and "orthogonal"

Orthogonal matrices are the 3×3 matrices that preserve lengths and angles. That family contains two kinds of motion: rotations, and reflections (mirror images). The determinant tells them apart. Rotations have determinant +1 and reflections have determinant −1. "Special" means we keep only the determinant +1 half, the proper rotations. The full orthogonal family is called O(3), and SO(3) is its rotation part.

flowchart LR
  A[3x3 matrices] --> B[Orthogonal: keeps lengths and angles]
  B --> C[Determinant +1: no mirror images]
  C --> D["SO(3): rotations of 3D space"]
  D --> E[Group under matrix multiplication]
  E --> F[Smooth manifold: a Lie group]

The math

Definition

Definition: Special orthogonal group SO(3)

The set of real 3×33 \times 3 matrices with orthogonal columns of unit length and determinant +1+1:

SO(3)={ R∈R3×3  :  R⊤R=I,    det⁡R=1 },\mathrm{SO}(3) = \{\, R \in \mathbb{R}^{3 \times 3} \;:\; R^\top R = I, \;\; \det R = 1 \,\},

with the group operation given by matrix multiplication.

Here RR is a matrix, R⊤R^\top is its transpose (rows and columns swapped), II is the identity matrix with ones on the diagonal and zeros elsewhere, and det⁡R\det R is the Determinant of RR. The condition R⊤R=IR^\top R = I says the columns of RR are orthonormal: each has length 1 and any two are perpendicular. It also means R−1=R⊤R^{-1} = R^\top, so inverting a rotation costs nothing more than a transpose.

Why does this capture rotations? For any vector x\mathbf{x}, the squared length of RxR\mathbf{x} is (Rx)⊤(Rx)=x⊤R⊤R x=x⊤x(R\mathbf{x})^\top (R\mathbf{x}) = \mathbf{x}^\top R^\top R\, \mathbf{x} = \mathbf{x}^\top \mathbf{x}, so lengths are preserved. The determinant condition excludes the reflections, which also satisfy R⊤R=IR^\top R = I but have determinant −1-1.

Why it is a group

Check the four group axioms, using two facts: det⁡(AB)=det⁡Adet⁡B\det(AB) = \det A \det B and (AB)⊤=B⊤A⊤(AB)^\top = B^\top A^\top.

  • Closure. If A,B∈SO(3)A, B \in \mathrm{SO}(3), then (AB)⊤(AB)=B⊤A⊤AB=B⊤B=I(AB)^\top(AB) = B^\top A^\top A B = B^\top B = I, and det⁡(AB)=1⋅1=1\det(AB) = 1 \cdot 1 = 1.
  • Identity. I⊤I=II^\top I = I and det⁡I=1\det I = 1.
  • Inverses. R⊤R^\top is also orthogonal, because RR⊤=IR R^\top = I follows from R⊤R=IR^\top R = I for square matrices, and det⁡R⊤=det⁡R=1\det R^\top = \det R = 1.
  • Associativity. Matrix multiplication is associative.

Multiplication is not commutative in general. That is the whole reason rotations are harder to handle than numbers.

Dimension three

A 3×3 matrix has 9 entries. The condition R⊤R=IR^\top R = I is a symmetric matrix equation with 6 independent entries (the diagonal and the upper triangle), so it removes 6 degrees of freedom. The remaining 9−6=39 - 6 = 3 count the free parameters. Geometrically, an axis takes two numbers (a point on the unit sphere) and an angle takes one. So SO(3) is a 3-dimensional object.

The Lie algebra so(3) and the exponential map

Given a vector ω=(ω1,ω2,ω3)\boldsymbol{\omega} = (\omega_1, \omega_2, \omega_3), define the skew-symmetric matrix

[ω]×=(0−ω3ω2ω30−ω1−ω2ω10).[\boldsymbol{\omega}]_\times = \begin{pmatrix} 0 & -\omega_3 & \omega_2 \\ \omega_3 & 0 & -\omega_1 \\ -\omega_2 & \omega_1 & 0 \end{pmatrix}.

The set of all such matrices is called so(3)\mathfrak{so}(3), the Lie algebra of SO(3). It is the "tangent space" at the identity: the directions in which you can nudge a rotation away from doing nothing. Each element of so(3)\mathfrak{so}(3) is sent to a rotation by the matrix exponential, exp⁡([ω]×)∈SO(3)\exp([\boldsymbol{\omega}]_\times) \in \mathrm{SO}(3). Read ω\boldsymbol{\omega} as an axis of rotation whose length is the angle.

Write θ=∥ω∥\theta = \|\boldsymbol{\omega}\| for the angle and k=ω/θ\mathbf{k} = \boldsymbol{\omega}/\theta for the unit axis, and K=[k]×K = [\mathbf{k}]_\times. Then the exponential has a closed form, Rodrigues' formula:

exp⁡([ω]×)=I+sin⁡θ K+(1−cos⁡θ) K2.\exp([\boldsymbol{\omega}]_\times) = I + \sin\theta \, K + (1 - \cos\theta)\, K^2.

This is a rotation by angle θ\theta about the axis k\mathbf{k}. The two coefficients in front of KK and K2K^2 are the functions plotted below.

00.511.522.5300.511.52θ (rotation angle, radians)coefficient
  • sin θ
  • 1 - cos θ
The two Rodrigues coefficients. Both equal 1 at θ = π/2 (the marker), which is why a quarter turn has such a clean matrix.

The reverse map, the logarithm, recovers the axis and angle from a rotation matrix RR. The angle comes from the trace (the sum of the diagonal entries):

cos⁡θ=tr⁡R−12,θ∈[0,π].\cos\theta = \frac{\operatorname{tr} R - 1}{2}, \qquad \theta \in [0, \pi].

When θ\theta is not 00 or π\pi, the axis comes from the antisymmetric part of RR:

k=12sin⁡θ(R32−R23R13−R31R21−R12).\mathbf{k} = \frac{1}{2\sin\theta}\begin{pmatrix} R_{32} - R_{23} \\ R_{13} - R_{31} \\ R_{21} - R_{12} \end{pmatrix}.

Rotations change smoothly

The entries of RR are smooth functions of the parameters, and so are products and inverses of rotations. A group with this smooth structure is a Lie group. For SO(3), the practical meaning is that small changes in orientation can be treated as small vectors in so(3)\mathfrak{so}(3), and integrated over time. If a body spins with angular velocity ω(t)\boldsymbol{\omega}(t) expressed in its own frame, its orientation R(t)R(t) obeys

dRdt=R [ω(t)]×.\frac{dR}{dt} = R\,[\boldsymbol{\omega}(t)]_\times.

Over a short time step Δt\Delta t the discrete update is Rk+1=Rkexp⁡([ωkΔt]×)R_{k+1} = R_k \exp([\boldsymbol{\omega}_k \Delta t]_\times), and for small angles exp⁡([ω]×)≈I+[ω]×\exp([\boldsymbol{\omega}]_\times) \approx I + [\boldsymbol{\omega}]_\times. This update is how an IMU turns gyroscope readings into an orientation.

Worked examples

Example
A quarter turn about the z-axis

Let RzR_z be the rotation by θ=90∘\theta = 90^\circ about the z-axis:

Rz=(0−10100001).R_z = \begin{pmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix}.
  1. Columns: (0,1,0)(0,1,0), (−1,0,0)(-1,0,0), (0,0,1)(0,0,1). Each has length 1 and they are mutually perpendicular, so Rz⊤Rz=IR_z^\top R_z = I.
  2. Determinant: expand along the top row, det⁡Rz=0⋅(0)−(−1)⋅(1⋅1−0⋅0)+0=1\det R_z = 0 \cdot (0) - (-1)\cdot(1 \cdot 1 - 0 \cdot 0) + 0 = 1. So Rz∈SO(3)R_z \in \mathrm{SO}(3).
  3. Trace: tr⁡Rz=0+0+1=1\operatorname{tr} R_z = 0 + 0 + 1 = 1, so cos⁡θ=(1−1)/2=0\cos\theta = (1 - 1)/2 = 0 and θ=90∘\theta = 90^\circ, as intended.
  4. Apply it to the x-axis vector (1,0,0)(1, 0, 0): Rz(1,0,0)⊤=(0,1,0)⊤R_z (1,0,0)^\top = (0, 1, 0)^\top. The x-direction has turned into the y-direction, which matches the picture of a quarter turn.

Interpretation: a robot joint that is commanded to turn a quarter revolution about its vertical axis produces exactly this matrix.

Example
Order matters: two quarter turns in different orders

Let RxR_x be a quarter turn about the x-axis:

Rx=(10000−1010).R_x = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & -1 \\ 0 & 1 & 0 \end{pmatrix}.
  1. Compute the product RzRxR_z R_x by taking dot products of rows of RzR_z with columns of RxR_x:
RzRx=(001100010).R_z R_x = \begin{pmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix}.
  1. Compute RxRzR_x R_z the same way:
RxRz=(0−1000−1100).R_x R_z = \begin{pmatrix} 0 & -1 & 0 \\ 0 & 0 & -1 \\ 1 & 0 & 0 \end{pmatrix}.
  1. The two products are different matrices, so SO(3) is not commutative.
  2. Apply both to (1,0,0)⊤(1, 0, 0)^\top. The first column of RzRxR_z R_x is (0,1,0)⊤(0,1,0)^\top, but the first column of RxRzR_x R_z is (0,0,1)⊤(0,0,1)^\top. The same two turns, in opposite order, send the x-axis to different places.

Interpretation: when a robot composes joint rotations, the order of multiplication is physical, not a notational choice.

Example
One gyroscope step

A gyroscope reports a constant angular velocity ω=(0,0,0.1)\boldsymbol{\omega} = (0, 0, 0.1) rad/s for a time step Δt=0.5\Delta t = 0.5 s. The rotation angle for this step is θ=0.1×0.5=0.05\theta = 0.1 \times 0.5 = 0.05 rad.

  1. Rodrigues' formula with axis k=(0,0,1)\mathbf{k} = (0,0,1) gives the rotation about z.
  2. cos⁡(0.05)≈0.998750\cos(0.05) \approx 0.998750 and sin⁡(0.05)≈0.049979\sin(0.05) \approx 0.049979.
  3. The update is
exp⁡([ωΔt]×)≈(0.998750−0.04997900.0499790.9987500001).\exp([\boldsymbol{\omega}\Delta t]_\times) \approx \begin{pmatrix} 0.998750 & -0.049979 & 0 \\ 0.049979 & 0.998750 & 0 \\ 0 & 0 & 1 \end{pmatrix}.
  1. Its columns are still unit length and perpendicular, and its determinant is 0.9987502+0.0499792=1.00000.998750^2 + 0.049979^2 = 1.0000, so the step stays in SO(3).
  2. Converted to degrees, the step is 0.05×57.3≈2.9∘0.05 \times 57.3 \approx 2.9^\circ about the z-axis.

Interpretation: a naive update Rk+1=Rk+Δt [ω]×RkR_{k+1} = R_k + \Delta t\,[\boldsymbol{\omega}]_\times R_k would be close but not exactly a rotation, and errors would accumulate. The exponential update keeps the result on the group at every step.

Tradeoffs and failure modes

SituationWhat goes wrongBetter choice
Storing orientation as Euler angles (roll, pitch, yaw)Gimbal lock at pitch of ±90°: two angles collapse into one and the representation loses a degree of freedomRotation matrix or unit quaternion
Long-running filter updating a matrix in placeRound-off makes R⊤RR^\top R drift away from II over timeRe-orthonormalise periodically (SVD or Gram-Schmidt), or use a quaternion and renormalise
Interpolating between two orientations by averaging their matricesThe average is not a rotation (it is generally not orthogonal)Spherical linear interpolation (slerp) on quaternions, or the exponential and logarithm on so(3)\mathfrak{so}(3)
Using quaternions for compactnessTwo unit quaternions qq and −q-q give the same rotation, so the cover from SU(2)\mathrm{SU}(2) to SO(3) is two to oneFix a sign convention (for example, keep the scalar part non-negative)
A sensor frame with a flipped axisThe matrix has determinant −1-1, so it is a mirror image rather than a rotationCheck the determinant on every update and correct the axis convention

Use the rotation matrix when you need to apply a rotation to many vectors and read off directions. Use the Lie algebra form when you need to integrate or optimise over orientations, as in visual SLAM and pose estimation. The group is three-dimensional, so the minimal representation is three numbers, but the minimal form is not always the most convenient one: a 3×3 matrix is redundant, and that redundancy is the price of having a simple composition rule.

History

Leonhard Euler showed in the 1770s that any change in the orientation of a rigid body about a fixed point can be produced by a single rotation about some axis. This result is now called Euler's rotation theorem, and it is the reason SO(3) has three parameters rather than more. Olinde Rodrigues gave the closed-form formula for a rotation about an axis in the 1840s. William Rowan Hamilton introduced quaternions in 1843, a four-number way to describe the same rotations that avoids gimbal lock.

The group-theoretic view came later. Sophus Lie developed the theory of continuous transformation groups and their associated algebras in the 1870s and 1880s, and his work gave the name Lie group to objects like SO(3). In the twentieth century, the same language became the standard tool for describing rotations in quantum mechanics and in aerospace attitude control. In robotics, the Lie group view took hold in state estimation, where it lets filters and optimisers treat orientation as a smooth manifold rather than as a set of awkward angles.

Check yourself

QuestionWhich two conditions define an element of SO(3)?Show answer

A 3×33 \times 3 real matrix RR is in SO(3) when R⊤R=IR^\top R = I (orthogonal: it preserves lengths and angles) and det⁡R=1\det R = 1 (proper: it excludes reflections, which have determinant −1-1). Both are needed. The first alone admits mirror images, and the second alone admits stretches and shears (for example diag(2,0.5,1)\mathrm{diag}(2, 0.5, 1) has determinant 1 but distorts lengths).

QuestionA rotation matrix RR has trace 0. What is the rotation angle θ\theta?Show answer

Use cos⁡θ=(tr⁡R−1)/2=(0−1)/2=−12\cos\theta = (\operatorname{tr} R - 1)/2 = (0 - 1)/2 = -\tfrac{1}{2}. So θ=arccos⁡(−12)=120∘\theta = \arccos(-\tfrac{1}{2}) = 120^\circ, taking the value in [0,π][0, \pi]. The axis is found from the antisymmetric part of RR, and the angle is the only thing the trace reveals.

QuestionWhy is the determinant condition needed, when orthogonality already keeps lengths and angles?Show answer

Orthogonality allows reflections. The matrix diag(−1,1,1)\mathrm{diag}(-1, 1, 1) is orthogonal and flips the x-axis, turning a right-handed coordinate frame into a left-handed one. A robot that used such a matrix would believe its body was a mirror image of its true pose. Requiring det⁡R=1\det R = 1 keeps only the orientation-preserving transformations, which are the physical rotations.

QuestionAn IMU gyroscope reports ω=(0.2,0,0)\boldsymbol{\omega} = (0.2, 0, 0) rad/s for 0.1 s. How far and about which axis does the orientation change?Show answer

The angle is θ=0.2×0.1=0.02\theta = 0.2 \times 0.1 = 0.02 rad, which is about 0.02×57.3≈1.15∘0.02 \times 57.3 \approx 1.15^\circ. The axis is the x-axis, because ω\boldsymbol{\omega} points along it. The update is Rk+1=Rkexp⁡([ωΔt]×)R_{k+1} = R_k \exp([\boldsymbol{\omega}\Delta t]_\times), and for an angle this small the exponential is very close to I+[ωΔt]×I + [\boldsymbol{\omega}\Delta t]_\times.

Sources