There is no matrix. It's just a convention that makes arguing about the processes that are left, right, above and below easier to understand.
If you want to get the coordinates for the current process you already have the code. Just put in rank, instead of i.