CSE276A - Mathematics behind Coordinate Transformations

Introduction

  • How to describe the relationship between two coordinate frames?
  • If I know a point in frame A, how to compute the point in frame B?

Homogeneous Transformation Matrix

If we have constructed two coordinates (e.g., robot base link frame and camera frame), how to describe the transformation between the two coordinates? Suppose we want to find a matrix that can map coordinates in camera frame to robot frame, denoted by rx=rTccx{}^r\mathbf{x} = {}^r\mathbf{T}_c {}^c\mathbf{x}

Translation

The child frame’s origin (camera) in the parent frame (robot).

Rotation

A useful online rotation representation converter: rotation converter.

Euler Angles

Any 3D orientation can be achieved by performing three sequential rotations around a set of defined axes. The order matters for Euler angles. As a result, a 3-dimensional euler vector cannot describe an orientation unless we specify the rotation order.

Rotation Matrix

A 3x3 matrix where the columns are the child frame’s (camera’s) X, Y, and Z axes, as described in the parent frame’s (robot’s) coordinates.

R=[XCYCZC]R = \begin{bmatrix} | & | & | \\ \vec{X}_C & \vec{Y}_C & \vec{Z}_C \\ | & | & | \end{bmatrix}

Quaternion

Instead of 3 separate rotations, a quaternion represents orientation as a single rotation around one specific axis in 3D space. The quaternion representation is 4 dimensional.

Transformation

After obtaining transformation and rotation, this 4x4 transformation matrix HH is constructed by plugging in the 3x3 rotation matrix RR and the 3x1 translation vector T\vec{T}.

rTc=[RT(3×3)(3×1)0001]{}^r\mathbf{T}_c = \begin{bmatrix} & & & \\ & R & & \vec{T} \\ & (3 \times 3) & & (3 \times 1) \\ & & & \\ 0 & 0 & 0 & 1 \end{bmatrix}

This matrix HH can transform any point PCP_C defined in the camera_frame coordinates directly into its corresponding point PBP_B in the base_link frame coordinates with a single matrix multiplication:

[PB,xPB,yPB,z1]=rTc[PC,xPC,yPC,z1]\begin{bmatrix} P_{B,x} \\ P_{B,y} \\ P_{B,z} \\ 1 \end{bmatrix} = {}^r\mathbf{T}_c \cdot \begin{bmatrix} P_{C,x} \\ P_{C,y} \\ P_{C,z} \\ 1 \end{bmatrix}

Application

  • Chaining Transforms

ATC=ATBBTC{}^A T_C = {}^A T_B \cdot {}^B T_C

  • Transform a Point Between Frames

PA=ATBPBP_A = {}^A T_B \cdot P_B

  • Inverse of Transformation

T=ATB=[Rt01]T = {}^A T_B = \begin{bmatrix} \mathbf{R} & \mathbf{t} \\ 0 & 1 \end{bmatrix}

T1=BTA=[RTRTt01]T^{-1} = {}^B T_A = \begin{bmatrix} \mathbf{R}^T & -\mathbf{R}^T \mathbf{t} \\ 0 & 1 \end{bmatrix}


CSE276A - Mathematics behind Coordinate Transformations
http://example.com/2025/11/08/CSE276A/CSE276A-pose/
Author
Songlin Zhao
Posted on
November 8, 2025
Licensed under