Initial Coordinate (0, 0) Question


#1

Hey guys, as a naturally curious person I just wanted to quickly ask if there is a reason for coordinates being based with (0, 0) at the top left corner? I assumed for awhile (0, 0) was at the bottom left since in a typical x/y graph that would mean all integers are positive. This isn’t a serious topic, rather just a curiosity, thanks!


#2

This seems to have to do with CRTs where the electron beam starts at the top left:


OS X’s Cocoa on the other hand uses the bottom left as origin to confuse cross platform developers.


#3

So true :joy: :weary:


#4

Seems rather convoluted to blame crts for this. Before the crts there were the mechanical printers such as tty. You printed a line and when it was full you did (or the machine did) a carriage return (and then I mean a real physical carriage return) and advanced the paper for the next line. Hence line 1 was at the top of the paper and subseq numbers underneath. It became natural to put y=0 at the top/start of paper and draw subsequent y-values futher down the paper until the graph was done (or the printer ran out of paper)


#5

The second link mentions that CRTs run from top left to bottom right due to the western writing direction. This might be wrong or not but doesn’t sound too far fetched.

If early computers had used different coordinates they had needed to feed them in another order to the CRT (last line, second last line …); while this is certainly possible, setting the origin to top left still makes this process easiser. I don’t know for certain why the origin lies where it is but I do see some logic in the CRT explanation.


#6

So you honestly think it’s harder to display arabic text on a crt than any westen language?! Due to the electrons?


#7

No. I think that it is quite possible that someone once decided (probably not even consciously) to let the beam run from upper left to bottom right because that’s how that person used to write.


#8

And, to reconnect to the initial question, because of this the ancient graph drawers thought it was important to check which way the electron beam moved when drawing their graphs?


#9

Damn tube tvs. I suppose in the midst of the computer revolution people created the coordinate system based on data other than graphs (binary, general reading, etc.) since it does make sense when it comes to how we interpret the data of everything with the exception of the xy graph. I guess we should at least be happy the x axis isn’t reversed as well which I suppose could have happened if someone from the East had developed it first.


#10

I tried to explain that in one of my previous posts: The monitor data needs to be output sequentially and must follow the beam position. For an origin different to top left, one would either need to output the lines inversely or calculate the graphic buffer address differently (numPixPerLine*(numPixPerLine - y - 1) + x instead of numPixPerLine*y + x).

If you see anything that’s illogical here please point to it instead of asking suggestive questions.