Z-order curve, Maxwells Demon as javascript or java
in the title is described for what we are looking for
the Z-order curve seems a variant of Hilbert-curve(?)
Maxwells Demon is an indicator for describing the ways of liquids etc.
or other physical phenomenas
thx
Like this:
var numberOfPoints=64;
var scale=0.2;
draw();
function morton (x)
{
x = x & 0x55555555;
x = (x | (x >> 1)) & 0x33333333;
x = (x | (x >> 2)) & 0x0F0F0F0F;
x = (x | (x >> 4)) & 0x00FF00FF;
x = (x | (x >> 8)) & 0x0000FFFF;
return x;
}
function draw(){
with (sketch) {
moveto(-.9,-.9);
glclearcolor(1., 1., 1., 1.);
glclear();
for ( var z = 0; z < numberOfPoints; ++z ) {
var x = (morton(z)*scale)-.9;
var y = (morton(z >> 1)*scale) -.9;
var q = 10;
post("x", x, " y", y, "\n");
lineto(x,y,0);
}
}
}
thank you Mzed for this example
cheers