https://docs.google.com/viewer?a=v&p...RiMjQ0NDQyMzlk
* Please answer this in detail *
https://docs.google.com/viewer?a=v&p...RiMjQ0NDQyMzlk
* Please answer this in detail *
$\displaystyle \sum_{i=1}^n [floor(\frac{i*m}{n})-floor(\frac{(i-1)*m}{n})+1$]
Floor(x) means the greatest integer less than or equal to x.
Would this formula work, or are you looking for something simpler? Because this is all I could come up with.
You can see how I got this if you look at how many squares you intersect when you go to the left 1 unit. If we let X equal the slope, then $\displaystyle floor(x)+1$ is the number of squares intersected across the first column. The same basic rule would apply for subsequent columns, but you must subtract the amount intersected in the previous columns.