Class CosmicNumbering

java.lang.Object
squidpony.squidmath.CosmicNumbering
All Implemented Interfaces:
Serializable, Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise6D

public class CosmicNumbering
extends Object
implements Serializable, Noise.Noise2D, Noise.Noise3D, Noise.Noise4D, Noise.Noise6D
Like a kind of RNG, but fully deterministic in a way that depends on a "connected" double array. Intended as a way to produce similar values when small changes occur in the connections, while potentially producing larger changes when the changes are more significant (unlike an RNG or hashing function, which can and should produce very different output given even slightly different seeds/input). This might be useful to produce procedural story data that is similar when most of the connected inputs are similar, or for terrain generation/population. This can produce ints and doubles, and does not produce a different output unless its input is changed (usually by altering a shared reference to connections). Also implements the various Noise interfaces, which this doesn't do perfectly but is at least different (it may yield large spans of high or low results, which Simplex and Perlin noise cannot actually do). Here's a short clip of this in motion.
If you're using this as an arbitrary-dimensional noise algorithm, you may want to also consider PhantomNoise, which has output that looks more like Perlin or Simplex noise but scales to arbitrary dimensions. Here's a short clip of PhantomNoise in motion.
Created by Tommy Ettinger on 5/18/2017.
See Also:
Serialized Form