public double Function1D(double x) {
        double frequency = initFrequency;
        double amplitude = initAmplitude;
        double sum = 0;

        // octaves
        for (int i = 0; i < octaves; i++) {
            sum += SmoothedNoise(x * frequency) * amplitude;

            frequency *= 2;
            amplitude *= persistence;
        }
        return sum;
    }
public double Function1D ( double x ) { double frequency = initFrequency ; double amplitude = initAmplitude ; double sum = 0 ; for ( int i = 0 ; i < octaves ; i ++ ) { sum += SmoothedNoise ( x * frequency ) * amplitude ; frequency *= 2 ; amplitude *= persistence ; } return sum ; }
1-D Perlin noise function.

@param x X Value.
@return Returns function's value at point x.