DEV Community

HandsomeTan
HandsomeTan

Posted on • Edited on

Homogeneous and Cartesian coordinates

In Computer Graphics, Cartesian coordinate is a common coordinate system, but for matrix calculation to be convenient we introduce Homogeneous coordinate system. The reasons are as below:
For a example of two-dimensional, assuming the position of a object is {x, y} and applying a translation operation to this object to obtain a new position: {x + tx, y + ty}, which is a manual calculation method. Matrix multiplication is a method used by computers for coordinate transformation, but whether to use tow-dimensional or three-dimensional, multiplication doesn't work on translation operation. So we bring in additional one dimension, whose value is usually 1, so the coordinate of object in two-dimensional is {x, y, w}. The conversion formula between homogeneous coordinates({x, y, w}) and Rectangular coordinates({X, Y}) is X = x/w, Y = y/w, Now we can use translation operation for martix multiplication:

Image description

in this way, all of transform opertions can be finished through matrix multiplication, thereby diminishing computational costs.
By the way, homogeneous coordinate also address the problem of two parallel lines intersecting. We assume the following situation:

Image description

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

Image description

there is a solution: (x, y, 0) represents thet intersection of two parallel lines at this point, which represents the position at infinity.


Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay