DEV Community

HandsomeTan
HandsomeTan

Posted on

Homogeneous coordinate and

In Computer Graphics, rectangular coordinate is a common coordinate system, but for matrix calculation to be convenient we introduce Homogeneous coordinate. there are reasons below:
For a example of two-dimensional, assume the position of a object is {x, y} and apply a translation operation to this object to obtain a new position: {x + tx, y + ty}, which is manual calculation method. Matrix multiplication is the way computers use for coordinate transform, but whether to use tow-dimensional or three, multiplication doesn't work on translation operation. So we bring in extra one dimension whose value usually is 1 then the coordination of objects under two-dimensional is {x, y, w}. The conversion fomula between homogeneous({x, y, w}) and Rectangular coordinate({X, Y}) is X = x/w, Y = y/w, and now we can make translation operation using martix multiplication:

Doing so, all of transform opertion can be finished by matrix multiplication, which can diminish the cost of calculation.
By the way, homogeneous coordinate also address a issue that two parallelline can be intersected each other. We assume this situation below:

this equation have no solution on Euclid space because they are parallel mutually. On Perspective space, we use homogeneous coordinate(x/w, y/w) instead of x,y:

there is a solution: (x, y, 0) that indicates two parallel lines intersect to this point and the point represents infinity position.


Top comments (0)