Notes:Grid iteration

From Maths
Revision as of 18:28, 7 January 2018 by Alec (Talk | contribs)

Jump to: navigation, search

See Modulo operator for a definition of [ilmath]\text{Mod}(a,b)[/ilmath]

2D grid

Notice the 21st point is back at the origin and the sequence repeats. Direct link
  • [math]\text{Mix}_x(k,m,n):\eq \text{Floor}\left(\text{Mod}\big(\text{Mod}(k,mn),m\big)\right)[/math]
  • [math]\text{Mix}_y(k,m,n):\eq \frac{\text{Mod}(k,mn)-\text{Mod}\big(\text{Mod}(k,mn),m\big)}{m} [/math]

Then

  • Points of the form:
    • [math]\big(\text{Mix}_x(k,m,n),\text{Mix}_y(k,m,n)\big)[/math] span an [ilmath]m\times n[/ilmath] grid, for [ilmath]k[/ilmath] from [ilmath]0[/ilmath] to [ilmath]mn-1[/ilmath]

3D grid

Suppose we have an [ilmath]\ell\times m\times n[/ilmath] grid,