The everyday blog of Richard Bartle.
RSS feeds: v0.91; v1.0 (RDF); v2.0; Atom.
Previous entry. Next entry.
8:18pm on Tuesday, 13th November, 2007:
What are the co-ordinates of the red circle on this grid?
OK, so without any numbers it's hard to tell whether the origin is in the top-left or bottom-right corner. Here, I'll make it easier for you:
Now what are the co-ordinates?
Well, they're (6, 5), right? You always give co-ordinates in the form (x, y). No-one would say it was (5, 6), it's always (6, 5). You'd be really annoyed if you were, say, learning to program in Java from a book and its programs, libraries, examples and exercises gave the co-ordinates as (y, x) every single time.
My elder daughter is indeed learning to program in Java from a book, which does indeed use that inversion of co-ordinates, and it's driving her nuts.
The root of the system seems to be that the book uses the conceit of controlling robots walking down roads. It's an American book, so all roads are at right-angles to each other just like in American cities. The ones running north/south are avenues and the ones running east/west are streets, as in Manhattan (except in Manhattan the origin is at the bottom, not the top). The location of an intersection is given as (street, avenue). I don't know if it's standard practice in the USA to put streets first; if it is, this may all make perfect sense to American readers of the book.
It bugs the heck out of my daughter, though...
About this blog.
Copyright © 2007 Richard Bartle (firstname.lastname@example.org).