za.co.luma.math.function
Class SmoothNoise2D

java.lang.Object
  extended by za.co.luma.math.function.SmoothNoise2D

public class SmoothNoise2D
extends java.lang.Object

Represents smooth noise, that is noise sampled from uniform noise, and linearly interpolated.

Author:
Herman Tulleken (herman@luma.co.za)

Constructor Summary
SmoothNoise2D(int maxWidth, int maxHeight)
          Constructs a new SmoothNoise object.
 
Method Summary
 double getNoise(int x, int y, int samplingPeriod)
          Gets the noise at the indicated coordinate, sampled at the given samplePeriod.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmoothNoise2D

public SmoothNoise2D(int maxWidth,
                     int maxHeight)
Constructs a new SmoothNoise object.

Parameters:
maxWidth - The width of the noise plus the maximum sampling period.
maxHeight - The height of the noise plus the maximum sampling period.
Method Detail

getNoise

public double getNoise(int x,
                       int y,
                       int samplingPeriod)
Gets the noise at the indicated coordinate, sampled at the given samplePeriod.

Returns:
a value between 0 and 1.