Amortized Noise Terrain Generator
A Program to Generate Terrain from Amortized Noise with Exponentially Distributed Gradient Magnitude
Functions
ExponentialHash.h File Reference

Header for generating an exponentially distributed hash function. More...

Go to the source code of this file.

Functions

float UniformHash (unsigned int x, unsigned int max)
 Uniformly distributed hash function. More...
 
float ExpHash (unsigned int x, unsigned int max)
 Exponentially distributed hash function. More...
 
float ExpHash (unsigned int x, unsigned int y, unsigned int m, float omega)
 Exponentially distributed hash function. More...
 

Function Documentation

◆ ExpHash() [1/2]

float ExpHash ( unsigned int  x,
unsigned int  max 
)

Exponentially distributed hash function.

Hash an unsigned integer into the range (0, 1) with an exponential distribution.

Parameters
xValue to be hashed.
maxLargest possible value of x.
Returns
An exponentially distributed hash value > 0 and < 1.

◆ ExpHash() [2/2]

float ExpHash ( unsigned int  x,
unsigned int  y,
unsigned int  m,
float  omega 
)

Exponentially distributed hash function.

Hash an unsigned integer into the range (0, 1) with an exponential distribution giving some control over the base of the exponent and the height of the tail of the distribution.

Parameters
xValue to be hashed.
ySecond value to be hashed to select distribution.
mLargest possible value of x.
omegaThe tail multiplier, which controls how low the tails of the distribution can be.
Returns
An exponentially distributed random number > 0 and < 1.

◆ UniformHash()

float UniformHash ( unsigned int  x,
unsigned int  max 
)

Uniformly distributed hash function.

Hash an unsigned integer uniformly into the range (0, 1).

Parameters
xValue to be hashed.
maxLargest possible value of x.
Returns
A uniformly distributed hash value > 0 and < 1.