Imagine a 2 dimensional grid, with a variable size of $ x*y $. For this example of figure 1, let $ x=14; y=5 $.
Now one may position "pixels" in this gird. They can only be placed on the grid's points and not in between, meaning that $x$ and $y$ are integers ($ x=ℤ; y=ℤ $).
Let there be two points $ a(0|0) $ and $ b(x-1|y-1) $, which mark the end points of a diagonal crossing the grid.
Constructing a function which gives the diagonal would be pretty trivial, if we would allow $ x=ℚ; y=ℚ $. But how can I create a function (or algorithm) that returns a diagonal as shown in figure 2, that has rotational symmetry?
It may also look like figure 3, distributing the pixels as evenly as possible, but without regarding any symmetry.
Figure 1
o o o o o o o o o o o o o b
o o o o o o o o o o o o o o
o o o o o o o o o o o o o o
o o o o o o o o o o o o o o
a o o o o o o o o o o o o o
Figure 2 Figure 3
o o o o o o o o o o o + + b | o o o o o o o o o o o o + b
o o o o o o o o + + + o o o | o o o o o o o o o + + + o o
o o o o o o + + o o o o o o | o o o o o o + + + o o o o o
o o o + + + o o o o o o o o | o o o + + + o o o o o o o o
a + + o o o o o o o o o o o | a + + o o o o o o o o o o o
How about the function, vertical coordinate is nearest integer to ($5/14$ times horizontal coordinate)?