# Homogeneous Coordinates One of the many purposes of using homogeneous coordinates is to capture the concept of infinity. In the Euclidean coordinate system, infinity is something that does not exist. Mathematicians have discovered that many geometric concepts and computations can be greatly simplified if the concept of infinity is used. This will become very clear when we move to curves and surfaces design. Without the use of homogeneous coordinates system, it would be difficult to design certain classes of very useful curves and surfaces in computer graphics and computer-aided design.

Let us consider two real numbers, a and w, and compute the value of a/w. Let us hold the value of a fixed and vary the value of w. As w getting smaller, the value of a/w is getting larger. If w approaches zero, a/w approaches to infinity! Thus, to capture the concept of infinity, we use two numbers a and w to represent a value v, v=a/w. If w is not zero, the value is exactly a/w. Otherwise, we identify the infinite value with (a,0). Therefore, the concept of infinity can be represented with a number pair like (a, w) or as a quotient a/w.

Let us apply this to the xy-coordinate plane. If we replace x and y with x/w and y/w, a function f(x,y)=0 becomes f(x/w,y/w)=0. If function f(x,y) = 0 is a polynomial, multiplying it with wn will clear all denominators, where n is the degree of the polynomial.

For example, suppose we have a line Ax + By + C = 0. Replacing x and y with x/w and y/w yields A(x/w) + B(y/w) + C = 0. Multiplying by w changes it to

Ax + By + Cw = 0.

Let the given equation be a second degree polynomial Ax2 + 2Bxy + Cy2 + 2Dx + 2Ey + F = 0. After replacing x and y with x/w and y/w and multiplying the result with w2, we have

Ax2 + 2Bxy + Cy2 + 2Dxw + 2Eyw + Fw2 = 0
If you look at these two polynomials carefully, you will see that the degrees of all terms are equal. In the case of a line, terms x, y and w are of degree one, while in the second degree polynomial, all terms (i.e., x2, xy, y2, xw, yw and w2) are of degree two.

Given a polynomial of degree n, after introducing w, all terms are of degree n. Consequently, these polynomials are called homogeneous polynomials and the coordinates (x,y,w) the homogeneous coordinates.

Given a degree n polynomial in a homogeneous coordinate system, dividing the polynomial with wn and replacing x/w, y/w with x and y, respectively, will convert the polynomial back to a conventional one. For example, if the given degree 3 homogeneous polynomial is the following:

x3 + 3xy2 - 5y2w + 10w3 = 0
the result is
x3 + 3xy2 - 5y2 + 10 = 0

This works for three-dimension as well. One can replace a point (x, y, z) with (x/w, y/w, z/w) and multiply the result by w raised to certain power. The resulting polynomial is a homogeneous one. Converting a degree n homogeneous polynomial in x, y, z and w back to the conventional form is exactly identical to the two-variable case. ### An Important Notes

Given a point (x,y,w) in homogeneous coordinates, what is its corresponding point in the xy-plane? From what we discussed for converting a homogeneous polynomial back to its conventional form, you might easily guess that the answer must be (x/w,y/w). This is correct. Thus, a point (3,4,5) in homogeneous coordinates converts to point (3/5,4/5)=(0.6,0.8) in the xy-plane. Similarly, a point (x,y,z,w) in homogeneous coordinates converts to a point (x/w,y/w,z/w) in space.

Conversely, what is the homogeneous coordinates of a point (x,y) in the xy-plane? It is simply (x,y,1)! That is, let the w component be 1. In fact, this is only part of the story, because the answer is not unique. The homogeneous coordinates of a point (x,y) in the xy-plane is (xw, yw, w) for any non-zero w. Why is this true? Because (xw, yw, w) is converted back to (x,y). As a result, the following is important for you to memorize:

Converting from a homogeneous coordinates to a conventional one is unique; but, converting a conventional coordinates to a homogeneous one is not.
For example, a point (4,2,3) in space is convert to (4w, 2w, 3w, w) for any non-zero w. ### The Dimensionality of Homogeneous Coordinates

You perhaps have discovered that homogeneous coordinates need 3 and 4 components to represent a point in the xy-plane and a point in space, respectively. Therefore, a point in space (resp., the xy-plane) in homogeneous coordinates actually has four (resp., third) components. Adding a fourth (resp., third) component whose value is 1 to the coordinates of a point in space (resp., the xy-plane) converts it to its corresponding homogeneous coordinates. ### Ideal Points or Points at Infinity

As mentioned at the very beginning of this page, homogeneous coordinates can easily capture the concept of infinity. Let a point (x,y) be fixed and converted to a homogeneous coordinate by multiplying with 1/w, (x/w,y/w,1/w). Let the value of w approach to zero, then (x/w,y/w) moves farther and farther away in the direction of (x,y). When w becomes zero, (x/w,y/w) moves to infinity. Therefore, we would say, the homogeneous coordinate (x,y,0) is the ideal point or point at infinity in the direction of (x,y).

Let us take a look at an example. Let (3,5) be a point in the xy-plane. Consider (3/w,5/w). If w is not zero, this point lies on the line y = (5/3) x. Or, if you like the vector form, (3/w,5/w) is a point on the line O + (1/w)d, where the base point O is the coordinate origin and d is the direction vector <3,5>. Therefore, as w approaches zero, the point moves to infinity on the line. This is why we say (x,y,0) is the ideal point or the point at infinity in the direction of (x,y).

The story is the same for points in space, where (x,y,z,0) is the ideal point or point at infinity in the direction of (x,y,z).

The concept of homogeneous coordinates and points at infinity in certain direction will become very important when we discuss representations of curves and surface. ### A Simple Geometric Interpretation

Given a homogeneous coordinate (x,y,w) of a point in the xy-plane, let us consider (x,y,w) to be a point in space whose coordinate values are x, y and w for the x-, y- and w- axes, respectively. The line joining this point and the coordinate origin intersects the plane w = 1 at a point (x/w, y/w, 1). Please verify this fact yourself. The following figure illustrates this concept. This transformation treats a two-dimensional homogeneous point as a point in three-dimensional space and projects (from the coordinate origin) this three-dimensional point to the plane w=1. Therefore, as a homogeneous point moves on a curve defined by homogeneous polynomial f(x,y,w)=0, its corresponding point moves in three-dimensional space, which, in turn, is projected to the plane w=1. Of course, (x/w,y/w) moves on a curve in plane w=1.

The above figure also shows clearly that while the conversion from the conventional Euclidean coordinates to homogeneous coordinates is unique, the opposite direction is not because all points on the line joining the origin and (x,y,w) will be projected to (x/w,y/w,1). This is also an important concept to be used in later lectures.