No jobs
Foundation 9 min 1 of 4

Why homogeneous coordinates

One extra number turns projection, translation and points at infinity into linear algebra.

What this repairs

The belief that homogeneous coordinates are a notational trick for "adding a 1", rather than a change of space with real consequences.

Start with the problem, not the solution. Two operations you need constantly are not linear maps on R2\mathbb{R}^2 or R3\mathbb{R}^3 :

  • Translation. No 2×22 \times 2 matrix moves the origin, because every linear map fixes it.
  • Perspective projection. (X,Y,Z)(X/Z,Y/Z)(X, Y, Z) \mapsto (X/Z, Y/Z) divides by a coordinate, and division is not linear in anything.

You could handle both with special cases — an affine "matrix plus offset" here, a manual division there. Every graphics and vision library did that once, and the result was code where the order of operations was a matter of local convention. Homogeneous coordinates make both operations ordinary matrix multiplications, and that is the entire justification.

The move is this. Represent a 2D point (x,y)(x, y) by any 3-vector (λx,λy,λ)(\lambda x, \lambda y, \lambda) with λ0\lambda \neq 0 . So (2,3)(2, 3) is represented by (2,3,1)(2, 3, 1) , and equally by (4,6,2)(4, 6, 2) and by (1,1.5,0.5)(-1, -1.5, -0.5) . A homogeneous vector names a direction in R3\mathbb{R}^3 — i.e. a line through the origin — and the set of such lines is the projective plane P2\mathbb{P}^2 .

To read a Euclidean point back out, divide by the last coordinate:

(x,y,w)    (xw, yw),w0.(x, y, w) \;\simeq\; \left(\tfrac{x}{w},\ \tfrac{y}{w}\right), \qquad w \neq 0.

The \simeq is doing real work: it means "equal up to scale", and it is the equality that holds in P2\mathbb{P}^2 . Two homogeneous vectors are the same point if one is a nonzero multiple of the other.

What happens when w=0w = 0 ? Then (x,y,0)(x, y, 0) has no Euclidean equivalent — you cannot divide. These are the points at infinity, and each one encodes a direction rather than a location. The point (1,0,0)(1, 0, 0) is "infinitely far along the xx axis"; so is (2,0,0)(2, 0, 0) , which is the same point, because scale does not matter.

This is not a patch to handle a degenerate case. Parallel lines genuinely do meet, at the point at infinity corresponding to their shared direction, and a camera genuinely does image that point at a finite pixel — a vanishing point. The railway-tracks photograph is not an illusion; it is P2\mathbb{P}^2 being correct.

Join and meet are the same operation

  1. =p1×p2\ell = \mathbf{p}_1 \times \mathbf{p}_2

    The line through two points is their cross product.

  2. p1=p1(p1×p2)=0\mathbf{p}_1 \cdot \ell = \mathbf{p}_1 \cdot (\mathbf{p}_1 \times \mathbf{p}_2) = 0

    A cross product is orthogonal to both its arguments — so both points satisfy the line equation. That is what "the line through them" means.

  3. x=1×2\mathbf{x} = \ell_1 \times \ell_2

    The intersection of two lines is the cross product of the lines. Same operation, arguments swapped in role.

  4. =(a,b,c)    ax+by+cw=0\ell = (a, b, c)^\top \;\Leftrightarrow\; ax + by + cw = 0

    A line in P² is also a 3-vector, defined up to scale. Points and lines are interchangeable — this is duality, and it is why one function computes both.

Check yourself

Two lines in an image both pass through the vanishing point of the ground plane. What does that tell you about the world lines they are images of?

Show answer

That they are parallel in the world. A vanishing point is the image of a point at infinity, and a point at infinity is a direction; two world lines whose images share a vanishing point share a direction. This is the basis of every single-image calibration trick: find three mutually orthogonal vanishing points and you have constrained KK without a calibration target.

Euler View - ML Experiment Monitor