Number of points in the diagonal of an $X \times Y$ square lattice box.

159 Views Asked by At

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!