protected float calcHeight(float dist, Random random, float faultHeight, float range) {
        switch (faultType) {
            case FAULTTYPE_STEP: {
                return FastMath.sign(dist) * faultHeight;
            }
            case FAULTTYPE_LINEAR: {
                if (FastMath.abs(dist) > range) {
                    return FastMath.sign(dist) * faultHeight;
                }
                float f = FastMath.abs(dist) / range;
                return FastMath.sign(dist) * faultHeight * f;
            }
            case FAULTTYPE_SINE: {
                if (FastMath.abs(dist) > range) {
                    return -faultHeight;
                }
                float f = dist / range;
                // We want -1 at f=-1 and f=1; 1 at f=0
                return FastMath.sin((1 + 2 * f) * FastMath.PI / 2) * faultHeight;
            }
            case FAULTTYPE_COSINE: {
                if (FastMath.abs(dist) > range) {
                    return -FastMath.sign(dist) * faultHeight;
                }
                float f = dist / range;
                float val =  FastMath.cos((1 + f) * FastMath.PI / 2) * faultHeight;
                return val;
            }
        }
        //shouldn't go here
        throw new RuntimeException("Code needs update to switch allcases");
    }
Create a heightmap with linear step faults.
@param size size of heightmap
@param iterations number of iterations
@param minFaultHeight Height modified on each side
@param maxFaultHeight Height modified on each side
jme3-terrain/src/main/java/com/jme3/terrain/heightmap/FaultHeightMap.java