' '

Homogenous coordinates blur the distinction between points and vectors and provide a unified mathematical framework. The basic idea is to see vectors as being points at infinity. However, if we were to simply use \((\infty, \infty, \infty)\) as the coordinates for a vector, we would not know in what direction the vector points, nor what its length is.

The solution to this problem consists of adding an extra coordinate, often called \(w\). This means that when working in 2D space, we need three coordinates, while working in 3D space requires 4 coordinates. During this explanation, we will work in 2D.

A 2D point whose "regular" Cartesian coordinates are \((x, y)\) has homogeneous coordinates \((x, y, 1)\), whereas a 2D vector with Cartesian coordinates \((x, y)\) has homogeneous coordinates \((x, y, 0)\). In other words, we can differentiate between points and vectors based on their \(w\)-value.

So what about other values of \(w\)? The general rule is that if \(w \neq 0\), homogeneous coordinates \((x, y, w)\) correspond to the Cartesian coordinates \((x / w, y / w)\). In case \(w = 0\), we would get \((x / 0, y / 0)\), which leads to infinities, hence the interpretation that vectors are "points on infinity".

From the fact that \((x, y, w) = (x / w, y / w)\) follows that a point has infinitely many homogeneous coordinates. The following examples all correspond to the same point \((2, 1)\):

\[ (2, 1, 1) \qquad (4, 2, 2) \qquad (-2, -1, -1) \qquad (20, 10, 10)\]

Generally, we will want to keep \(w = 0\) for vectors and \(w = 1\) for points and not venture further in the crazy abstract worlds that homogeneous coordinates produce.

Vector

\((x, y, z, 0)\)

Point

\((x, y, z, 1)\)

1. Operations

As explained on points and vectors, addition and subtraction is only allowed on certain combinations of operands: we can add two vectors together, but not two points, etc.

Homogeneous coordinates provide a simple way to remember these rules: any combination is allowed, as long as the result’s \(w\)-coordinate is either \(0\) or \(1\).

Operation Math Result

Point + Point

\((x_i, 1) + (x'_i, 1) = (x_i + x'_i, 2)\)

Invalid (\(w = 2\))

Point + Vector

\((x_i, 1) + (x'_i, 0) = (x_i + x'_i, 1)\)

Point

Vector + Point

\((x_i, 0) + (x'_i, 1) = (x_i + x'_i, 1)\)

Point

Vector + Vector

\((x_i, 0) + (x'_i, 0) = (x_i + x'_i, 0)\)

Vector

Vector - Vector

\((x_i, 0) - (x'_i, 0) = (x_i - x'_i, 0)\)

Vector

Point - Point

\((x_i, 1) - (x'_i, 1) = (x_i - x'_i, 0)\)

Vector

Point - Vector

\((x_i, 1) - (x'_i, 0) = (x_i - x'_i, 1)\)

Point

Vector - Point

\((x_i, 0) - (x'_i, 1) = (x_i - x'_i, -1)\)

Invalid (\(w = -1\))