I've come upon this situation in physics where I want to 'generalize' (or find some analog) of lines in a the plane R^2, to lines on an NxN grid of points, which would consist of a finite number of points on the grid. The line should have the property that, if it goes off the boundary on one side, it will continue with the same slope on the opposite side. (Thus the space is like a 'discrete torus'). I`m think lots of mathematics has been done on this already, but I don't know what it's called. My first guess was modular geometry, but that didn't look like it. I don't want to waste time reinventing any wheels. Any mathematician who can help me?