Sunday 16 October 2011

Homogeneous Coordinates

Before we begin our discussion on Homogeneous coordinates, let us first see what is meant by the term Coordinate.

Coordinate(s): Number(s) that identifies a position relative to an axis.

Thus, a Coordinate system is a system which uses one or more numbers, or coordinates, to uniquely determine the position of a point or other geometric element.(From Wikipedia).

There are a number of coordinate systems. Here, we shall discuss about:
  1. Cartesian Coordinate system.
  2. Homogeneous Coordinate System.
Now, let us look into the Cartesian Coordinate system. Hmm, what exactly is the Cartesian Coordinate system? Well, it is the system that we learned in school. There are 2 lines perpendicular to each other(referred to as X and Y axes). This is the 2 dimensional Cartesian Coordinate system. This was proposed by the French Mathematician Rene Descartes.
2D Cartesian plane

The picture illustrates the 2D Cartesian plane. Points or Coordinates are represented bu its distance from the respective axes.


Cartesian Coordinates help describe Euclidean geometry.
Euclidean Geometry.












There are several types of geometry. But since we are interested in Homogeneous Coordinates, let us concentrate only on:
  1. Euclidean Geometry.
  2. Projective Geometry. 
Wait a minute, what is this new Geometry all about?! Well, turns out that what we learned in school(Euclidean geometry) is actually a special case of Projective geometry
Ah! isn't that new? At least when I read about this for the first time, I was quite surprised. Projective geometry is quite different from Euclidean geometry. Also, the general way in which both geometries are explained(by means of a coordinate system) vary.

Now, let us analyze the Cartesian coordinate system that is generally used to explain Euclidean Geometry.
Now, let us take a two dimensional plane. Points on this plane are represented by two numbers. Now consider an arbitrary point 
P(a, b). Now, this point is "a" units from the X axis and "b" units from Y axis. Now, the same point in homogeneous coordinates would be represented as P(a, b, 1). 
WHAT?!

That was my reaction when I was first reading about homogeneous coordinates. Where on earth did we get another coordinate? As mentioned earlier, Projective geometry is the superset of Euclidean geometry. So, what we describe using Cartesian Coordinates is actually a special case of the Homogeneous coordinates. 
Now, let us get into more of Homogeneous Coordinates. Homogeneous Coordinates are used to explain Projective geometry. They have an extra coordinate as compared to Cartesian Coordinates. i.e (x, y, z) in Cartesian coordinate system is represented as (x, y, z, d) in Homogeneous Coordinate system.
All lines are directed towards a particular point(represented by O). So, these lines are "Projected" towards the point O.

Now, the diagram on the left clearly illustrates the difference between Homogeneous coordinates and Cartesian coordinates. The diagram is a side view of two planes.
The ones represented by W = 1 and W = d are actually planes.(I hope I'm able to convey the message).
 
Thus, these are two planes seen from the side. Now, the points represented by the 2D Cartesian coordinates are nothing but 3D coordinates on the plane W = 1. i.e consider a point P(x, y) in the Cartesian coordinate system. This is actually (x, y, 1). The same point on the W = d plane would be (dx, dy, d). Thus, Homogeneous coordinates have one coordinate more than the Cartesian coordinates. Here is a better image:

Thus, in Homogeneous coordinate system, a point (a, b, c) is the same as (a/c, b/c, 1) and (a/c, b/c, 1) is the Cartesian coordinate of (a, b, c).

Thus, to obtain the Cartesian coordinate of a point from Homogeneous coordinate, we just divide by the last term.
So, (4, 20, 10, 2) in homogeneous coordinate is actually 
(2, 10, 5) in Cartesian coordinates.Thus, in homogeneous coordinates, [2, 2, 2, 2] is the same as [1, 1, 1, 1] and the same as [100, 100, 100, 100].So, a point in Cartesian Coordinate system is actually associated with a line in Homogeneous coordinates :)

The division by w means that the conversion of a homogeneous point to its Euclidean equivalent is inherently a projection of the homogenous point onto the w = 1 plane.

Now, we have an interesting situation. What happens if the last term is 0? i.e what is (a, b, 0).

Well, it represents a vector(or a direction or a point at infinity).Thus, in Homogeneous Coordinates, if the last term d = 0, then it is a vector.if the last term d not equal 0, then it represents a position.

So, that's some information about Homogeneous Coordinates. Hope it was helpful.  

Here are some useful links:




Note: Please let me know if I have made mistakes.I hope this was of help.

Thanks!
Mukund.