So assuming we have a $X \times Y$ lattice, Say for example a $3 \times 5$ like so
* * *
* * *
* * *
* * *
* * *
I need to find the number of points that each diagonal passes through. In this example, each diagonal passes through 3 points. Any help is much appreciated!