Imagine an autonomous car approaching a busy intersection at night. Its roof-mounted LiDAR catches a cluster of reflections and identifies a pedestrian: 12 meters forward, 1 meter to the left. A moment later, the motion planner must decide whether that person is entering the car’s path. But there is a hidden problem. The LiDAR described the pedestrian relative to the sensor, while the planner reasons relative to the vehicle, and the navigation system tracks both of them on a world map.

The pedestrian has not moved, only the viewpoint has changed. To connect what the sensor sees with where the vehicle believes it is, we need to carry the measurement through a chain of coordinate frames. One link comes from calibration, which tells us how the LiDAR is mounted on the car. Another comes from localization, which tells us where the car is in the world. If either link is inverted or composed in the wrong order, a pedestrian on the sidewalk can appear in the road.

An autonomous car using roof-mounted LiDAR to detect a pedestrian at a nighttime intersection, with coordinate frames attached to the sensor, vehicle, and world map The same pedestrian detection must travel from the LiDAR frame, through the vehicle frame, and into the world frame before the motion planner can use it.

This is why poses and transforms sit at the foundation of machine perception. In this note, we will build the geometry behind them from first principles: how a pose relates two frames, how a rigid transform rotates and translates coordinates, how several transforms compose, and why the choice of rotation representation matters in practice.

The one sentence to remember

A pose tells us where one coordinate frame is located and how it is rotated relative to another frame. A transform uses that position and rotation to convert a point’s coordinates from one frame into the other.


1. Coordinate Frames and Poses

A coordinate frame consists of an origin and an ordered set of perpendicular axes. The same physical point has different coordinates in different frames. For example, a pedestrian may be at in a LiDAR frame but at in a world frame. Neither vector is the pedestrian’s absolute identity; each is a description relative to a chosen origin and basis.

A rigid body’s pose combines:

  • position: where the body-frame origin is located; and
  • orientation: how the body-frame axes are aligned.

In three dimensions, a free rigid body has six degrees of freedom: three translations and three rotations. A pose is often represented computationally by a rotation matrix and a translation vector .

For intuition, we can collect the six pose parameters into

where locate the body-frame origin and denote roll, pitch, and yaw under a chosen Euler-angle convention.

A simple sketch separating the three translational and three rotational degrees of freedom Figure 1: Translation locates the body-frame origin; roll, pitch, and yaw describe its orientation relative to the fixed world frame.

1.1 A notation that prevents frame bugs

Before writing an equation, we need a way to say which frame a quantity belongs to. A left superscript names the frame in which coordinates are expressed. Thus,

means “the coordinates of physical point measured in frame .” The point itself is not changing; the superscript only identifies the coordinate system used to describe it.

For a transform, we need both a source and a destination:

The superscript is the destination and the subscript is the source, so means “map coordinates from frame into frame .” We will construct this transform below and introduce its homogeneous matrix form in Section 3.

1.2 Building the transformation step by step

Consider a body frame placed somewhere inside the world frame . We know a point through its body-frame coordinates , and we want its world-frame coordinates .

Step 1: locate the body origin. The translation

is the vector from the world origin to the body origin, expressed using world coordinates. At this stage, we have located frame , but not the point.

The translation vector locating the body origin inside the world frame Step 1: Translation places the body-frame origin relative to the world-frame origin.

Step 2: describe the point relative to the body. The vector runs from the body origin to the point, but its components are measured along the body axes. Because the body axes are rotated relative to the world axes, we cannot add this vector directly to .

A point represented as a displacement measured along the body-frame axes Step 2: Body-frame coordinates describe the displacement from the body origin to the point.

Step 3: rotate the local displacement into the world basis. The rotation converts components measured along the body axes into components measured along the world axes:

Here, is the same geometric displacement from the body origin to the point, now written in world coordinates. Rotation changes its coordinate components but not its length.

The same displacement expressed first in the body basis and then in the world basis Step 3: Rotation changes the basis used to describe the displacement; it does not move or resize the vector.

Step 4: add vectors that now share the same basis. Both and are expressed in frame , so they can be added:

Figure 2 completes the construction by drawing the two world-basis component vectors head to tail. The orange vector reaches the body origin, the red vector continues to the point, and the dashed purple vector is their sum.

A point expressed in a rotated body frame and transformed into the world frame

Figure 2: A body-frame point becomes a world-frame point by rotating its local displacement into the world basis and adding the body origin’s world-frame translation.


2. Rigid Transforms

Suppose is a point expressed in a body frame . If the orientation of relative to world frame is and the body origin is located at , then

The order matters:

  1. rewrites the point using the world-frame basis.
  2. shifts it from the body origin to the world origin.

Translation is added after rotation because both terms must already be expressed in the same frame before they can be added.

2.1 What makes the transform rigid?

A valid 3D rotation satisfies

Orthogonality gives . It also preserves distances. For two points and ,

Translation disappears in the difference, and rotation preserves the remaining norm. Inner products - and therefore angles - are preserved for the same reason. The condition rules out reflections, so handedness is preserved as well.


3. Homogeneous Coordinates

The expression is affine rather than linear because of the addition. Homogeneous coordinates absorb the translation into one matrix multiplication by appending an extra coordinate:

Then a rigid transform becomes

This matrix belongs to the special Euclidean group . Although it stores 12 nontrivial numbers, it has only six degrees of freedom because the nine entries of are constrained.

3.1 Points and directions are different

A point uses a final coordinate of :

A direction uses a final coordinate of :

Consequently,

Translation affects locations, not directions. This distinction matters for surface normals, velocities, rays, and axis vectors.


4. Inverting a Transform

If

then the reverse mapping is

The translation is not merely . The vector must also be expressed in the inverse frame, which is why it becomes .

We can verify the result directly:

A reliable mental model

To undo a transform, first undo the translation and then undo the rotation. Matrix multiplication writes those operations in reverse order, producing .


5. Composing Coordinate Frames

An autonomous vehicle may contain a LiDAR frame , a vehicle-body frame , and a world frame . Perception returns a pedestrian in the sensor frame, calibration provides the fixed sensor-to-body relationship, and localization estimates the changing body-to-world relationship.

Sensor, body, and world frames connected by a chain of transforms Figure 3: A sensor measurement reaches the world by following the available frame chain from right to left.

The desired world coordinate is

The frame labels expose both the correct matrices and their order:

More explicitly, if the component transforms are and , their composition is

Notice that the inner translation must be rotated before the outer translation is added. Transform multiplication is generally noncommutative:

5.1 A numerical 2D example

Suppose a sensor is mounted one meter ahead of a vehicle’s body origin:

The vehicle is at in the world and rotated counterclockwise:

A pedestrian detected two meters along the sensor’s -axis has . First map sensor to body:

Then map body to world:

The local phrase “three meters ahead” becomes the world location because the vehicle’s forward axis points along world .


6. Rotation Matrices and

The set of valid 3D rotation matrices is

The columns of are the rotated coordinate axes expressed in the destination frame. They are orthonormal and right-handed. Rotation matrices are convenient because they act on vectors and compose through ordinary matrix multiplication, but nine stored values represent only three degrees of freedom. Numerical optimization can also push a matrix away from the constraints unless it is re-normalized.

No single rotation representation is best for every job.

6.1 Euler angles

Euler angles describe orientation as three sequential elemental rotations. Under the roll-pitch-yaw convention used here,

where , , and are roll, pitch, and yaw. The rightmost rotation is applied first.

Euler angles are compact and intuitive for human-facing interfaces, but the axis order is part of the definition. Changing the order changes the final orientation. They also have singular configurations. At pitch , roll and yaw become coupled: two nominal degrees of freedom produce the same physical motion. This is gimbal lock.

Three rotational degrees of freedom collapsing to two at gimbal lock Figure 5: At the singular pitch, the roll and yaw axes align. The object can still rotate, but the chosen coordinates can no longer distinguish all three local directions of rotation.

Gimbal lock is a coordinate singularity

The physical orientation is valid; the Euler-angle chart is what becomes singular. Switching to a quaternion does not change the object - it changes the coordinates used to describe its orientation.

6.2 Axis-angle and the rotation vector

Any 3D rotation can be described by a unit axis and an angle . Define the skew-symmetric cross-product matrix

so that . Rodrigues’ formula converts axis-angle to a rotation matrix:

The rotation vector combines the axis and angle into three numbers. It is excellent for small updates in optimization and state estimation. However, the representation wraps at the boundary: and look far apart numerically even though the rotations are only apart.

6.3 Unit quaternions

Using scalar-first convention, a unit quaternion is

An axis-angle rotation maps to

Quaternions are compact, numerically stable, efficient to compose, and well suited to interpolation. Their main ambiguity is a double cover: and encode the same physical rotation. A quaternion must also remain normalized.

For quaternions and , composition uses the Hamilton product

As with matrices, multiplication order matters.

6.4 Choosing a representation

RepresentationStored valuesMain advantageMain caution
Rotation matrix9Direct action and easy compositionRedundant; must remain orthogonal
Euler angles3Human-readableOrder-dependent; gimbal lock
Axis-angle4Geometrically meaningfulSign and boundary ambiguities
Rotation vector3Convenient local optimization updateDiscontinuous at the angle boundary
Unit quaternion4Stable composition and interpolationUnit-norm constraint;

A common engineering pattern is to use quaternions or rotation matrices for stored poses, rotation vectors for optimizer updates, and Euler angles only for display.


7. Implementation Pattern

The following NumPy functions encode the same frame convention used throughout this note:

import numpy as np
 
 
def make_transform(R: np.ndarray, t: np.ndarray) -> np.ndarray:
    """Construct destination_T_source from destination_R_source and destination_t_source."""
    T = np.eye(4)
    T[:3, :3] = R
    T[:3, 3] = t
    return T
 
 
def invert_transform(A_T_B: np.ndarray) -> np.ndarray:
    """Return B_T_A."""
    R = A_T_B[:3, :3]
    t = A_T_B[:3, 3]
 
    B_T_A = np.eye(4)
    B_T_A[:3, :3] = R.T
    B_T_A[:3, 3] = -R.T @ t
    return B_T_A
 
 
def transform_point(A_T_B: np.ndarray, B_p: np.ndarray) -> np.ndarray:
    """Map a 3D point from frame B to frame A."""
    B_p_h = np.append(B_p, 1.0)
    return (A_T_B @ B_p_h)[:3]
 
 
def is_rotation_matrix(R: np.ndarray, atol: float = 1e-7) -> bool:
    return (
        np.allclose(R.T @ R, np.eye(3), atol=atol)
        and np.isclose(np.linalg.det(R), 1.0, atol=atol)
    )

For a sensor-to-world chain, write the code in the same order as the mathematics:

W_T_S = W_T_B @ B_T_S
W_p = transform_point(W_T_S, S_p)

Good tests should verify:

assert np.allclose(A_T_B @ invert_transform(A_T_B), np.eye(4))
assert is_rotation_matrix(A_T_B[:3, :3])
 
# A rigid transform preserves pairwise distances.
assert np.isclose(
    np.linalg.norm(transform_point(A_T_B, B_p1) - transform_point(A_T_B, B_p2)),
    np.linalg.norm(B_p1 - B_p2),
)

Library conventions differ

Before combining libraries, check axis handedness, quaternion component order (wxyz versus xyzw), angle units, Euler order, whether vectors are rows or columns, and whether a matrix maps source-to-destination or destination-to-source. Shape compatibility alone does not prove semantic compatibility.


8. Summary

The geometry of machine perception rests on a small set of reusable ideas:

  1. Coordinates are meaningless without a frame.
  2. A pose relates two frames through orientation and position.
  3. A rigid transform maps source-frame coordinates into a destination frame.
  4. Homogeneous coordinates unify rotation and translation.
  5. Transform labels determine composition order; matching inner frames should cancel.
  6. Inversion uses and , not a simple matrix transpose.
  7. Rotation matrices, Euler angles, axis-angle vectors, and quaternions describe the same geometry with different tradeoffs.

Once the notation is disciplined, a complicated multi-sensor system becomes a graph of frames connected by transforms. Perception supplies measurements, calibration connects sensors to the platform, and localization connects the platform to the world.


References