The following PostScript document seems to detail a hashing function that takes a point in multidimensional space and, if I’m reading it right, return a single scalar value whereby points in close proximity will hash to values near each other and points which are far from each other hash to values far from each other.

http://www-math.mit.edu/~vempala/papers/hashing.ps (See here for a PostScript viewer, if you need it.)

Assuming my description to be accurate, I’d really like to be able to use this in a project, but I’m getting lost in the mathematical notation and descriptions. Could anyone who can follow the notation possibly translate this into two functions like:

float hash2D(float x, float y) {

…

}

float hash3D(float x, float y, float z) {

…

}

That is of course assuming that the document actually states the methodology well enough to be able to do so.

Assuming there is, do value ranges need to be defined or are all points assumed to exist between -1 and 1 or something?