Package squidpony.squidmath
Class Noise.Basic1D
java.lang.Object
squidpony.squidmath.Noise.Basic1D
- All Implemented Interfaces:
Noise.Noise1D
- Enclosing class:
- Noise
public static class Noise.Basic1D extends Object implements Noise.Noise1D
A very simple 1D noise implementation, because a full-blown Perlin or Simplex noise implementation is probably
overkill for 1D noise. This does produce smoothly sloping lines, like Simplex noise does for higher dimensions.
The shape of the line varies over time, but can look like this.
If you give this a seed with
getNoiseWithSeed(double, long)
instead of using getNoise(double)
,
it will use a small extra step to adjust the spacing of peaks and valleys based on the seed, so getNoiseWithSeed
is slower than getNoise. If you use any Noise classes like Noise.Layered1D
, they should use a seed anyway
because different octaves won't have different enough shapes otherwise.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description static double
cubicSway(double value)
double
getNoise(double x)
double
getNoiseWithSeed(double x, long seed)
static double
noise(double x, long seed)
-
Field Details
-
Constructor Details
-
Method Details
-
getNoise
- Specified by:
getNoise
in interfaceNoise.Noise1D
-
getNoiseWithSeed
- Specified by:
getNoiseWithSeed
in interfaceNoise.Noise1D
-
cubicSway
-
noise
-