Difference between revisions of "Notes:Grid iteration"

From Maths
Jump to: navigation, search
m (typo)
m
Line 1: Line 1:
 
See [[Modulo operator]] for a definition of {{M|\text{Mod}(a,b)}}
 
See [[Modulo operator]] for a definition of {{M|\text{Mod}(a,b)}}
 
==2D grid==
 
==2D grid==
 +
[[File:2dGridReproduction small 4by5.gif|thumbnail|Notice the 21st point is back at the origin and the sequence repeats. [https://wiki.unifiedmathematics.com/index.php?title=File:2dGridReproduction_small_4by5.gif Direct link]]]
 
* {{MM|\text{Mix}_x(k,m,n):\eq \text{Floor}\left(\text{Mod}\big(\text{Mod}(k,mn),m\big)\right)}}
 
* {{MM|\text{Mix}_x(k,m,n):\eq \text{Floor}\left(\text{Mod}\big(\text{Mod}(k,mn),m\big)\right)}}
 
* {{MM|\text{Mix}_y(k,m,n):\eq \frac{\text{Mod}(k,mn)-\text{Mod}\big(\text{Mod}(k,mn),m\big)}{m} }}
 
* {{MM|\text{Mix}_y(k,m,n):\eq \frac{\text{Mod}(k,mn)-\text{Mod}\big(\text{Mod}(k,mn),m\big)}{m} }}

Revision as of 18:28, 7 January 2018

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,