Skip to content

Instantly share code, notes, and snippets.

@BattleAngelAlita
Created December 4, 2018 11:07
Show Gist options
  • Save BattleAngelAlita/df268b7ecab35aaa1418af3510754800 to your computer and use it in GitHub Desktop.
Save BattleAngelAlita/df268b7ecab35aaa1418af3510754800 to your computer and use it in GitHub Desktop.
//from http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/
//1d
g = 1.6180339887498948482 //golden ratio
a1 = 1.0/g
x[n] = (0.5+a1*n) %1
//2d
g = 1.32471795724474602596 //plastic constant
a1 = 1.0/g
a2 = 1.0/(g*g)
x[n] = (0.5+a1*n) %1
y[n] = (0.5+a2*n) %1
//3d
g = 1.22074408460575947536
a1 = 1.0/g
a2 = 1.0/(g*g)
a3 = 1.0/(g*g*g)
x[n] = (0.5+a1*n) %1
y[n] = (0.5+a2*n) %1
z[n] = (0.5+a3*n) %1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment