1. Linear Maps and Matrix Representation
A function $T: V \to W$ between two vector spaces over the same field is a Linear Transformation (or linear map) if and only if it preserves vector addition and scalar multiplication for all $u, v \in V$ and $c \in \mathbb{F}$:
$$T(u + v) = T(u) + T(v)$$
$$T(c \cdot u) = c \cdot T(u)$$
The Fundamental Theorem of Linear Maps
Every linear transformation between finite-dimensional spaces $T: \mathbb{R}^n \to \mathbb{R}^m$ can be represented uniquely as matrix multiplication:
$$T(x) = A x$$
where the $j$-th column of matrix $A \in \mathbb{R}^{m \times n}$ is the image of the $j$-th standard basis vector $e_j$:
$$A = \begin{bmatrix} | & | & & | \ T(e_1) & T(e_2) & \dots & T(e_n) \ | & | & & | \end{bmatrix}$$
2. Kernel, Image, and the Rank-Nullity Theorem
Let $A \in \mathbb{R}^{m \times n}$ represent a linear transformation $T: \mathbb{R}^n \to \mathbb{R}^m$.
The Kernel (Null Space)
The Kernel (or Null Space $\text{Null}(A)$) is the set of all input vectors that map to the zero vector:
$$\ker(T) = \text{Null}(A) = { x \in \mathbb{R}^n \mid Ax = \mathbf{0} }$$
The dimension of $\text{Null}(A)$ is called the Nullity.
The Image (Column Space)
The Image (or Column Space $\text{Col}(A)$) is the set of all reachable outputs in the target space:
$$\text{im}(T) = \text{Col}(A) = { y \in \mathbb{R}^m \mid y = Ax \text{ for some } x \in \mathbb{R}^n }$$
The dimension of $\text{Col}(A)$ is called the Rank of the matrix.
The Rank-Nullity Theorem
For any linear map $T: \mathbb{R}^n \to \mathbb{R}^m$:
$$\text{Rank}(A) + \text{Nullity}(A) = n$$
$$\dim(\text{im}(T)) + \dim(\ker(T)) = \dim(\text{Domain})$$
text
In data compression and neural networks, any dimension in the null space represents irrecoverable information loss.
3. 3D Graphics: Affine Transformations & Homogeneous Coordinates
In computer graphics (OpenGL, DirectX, Metal, WebGPU), pure linear transformations can rotate, scale, and shear, but cannot translate (shift) a point because linear maps must satisfy $T(\mathbf{0}) = \mathbf{0}$.
To overcome this, computer scientists use Homogeneous Coordinates, embedding 3D space into a 4D projective space:
$$\begin{bmatrix} x \ y \ z \end{bmatrix} \implies \begin{bmatrix} x \ y \ z \ 1 \end{bmatrix}$$
The 4x4 Affine Transformation Matrix
$$\begin{bmatrix} x' \ y' \ z' \ 1 \end{bmatrix} = \begin{bmatrix}
R_{11} & R_{12} & R_{13} & T_x \
R_{21} & R_{22} & R_{23} & T_y \
R_{31} & R_{32} & R_{33} & T_z \
0 & 0 & 0 & 1
\end{bmatrix} \begin{bmatrix} x \ y \ z \ 1 \end{bmatrix}$$
The Model-View-Projection (MVP) Pipeline
Every 3D vertex $v$ undergoes three sequential matrix multiplications on the GPU vertex shader:
$$v_{\text{clip}} = P \cdot V \cdot M \cdot v_{\text{local}}$$
- Model Matrix ($M$): Transforms vertices from local object space to global world space.
- View Matrix ($V$): Transforms world coordinates into camera-centric coordinates.
- Projection Matrix ($P$): Applies perspective foreshortening (objects further away appear smaller) mapping view frustum into Normalized Device Coordinates (NDC $[-1, 1]^3$).
4. Python Implementation: 3D Camera Projection
python