randomX1 = (int) (Math.random() * size); randomZ1 = (int) (Math.random() * size);
randomX1 = (int) (random() * size); randomZ1 = (int) (random() * size);
	public boolean load() {		//amount to raise a slice of terrain.		float heightVarience;		//random points for the fault line		int randomX1, randomZ1;		int randomX2, randomZ2;		//line directions		int directionX1, directionZ1;		int directionX2, directionZ2;		//clean up data if needed.		if (null != heightData) {			unloadHeightMap();		}		//allocate new arrays		heightData = new int[size*size];		float[][] tempBuffer = new float[size][size];		//generate faults for the number of iterations given.		for (int i = 0; i < iterations; i++) {			heightVarience =				maxDelta - ((maxDelta - minDelta) * i) / iterations;			//find two different random points.			randomX1 = (int) (Math.random() * size);			randomZ1 = (int) (Math.random() * size);			do {				randomX2 = (int) (Math.random() * size);				randomZ2 = (int) (Math.random() * size);			} while (randomX1 == randomX2 && randomZ1 == randomZ2);			//calculate the direction of the line the two points create.			directionX1 = randomX2 - randomX1;			directionZ1 = randomZ2 - randomZ1;			for (int x = 0; x < size; x++) {				for (int z = 0; z < size; z++) {					//calculate the direction of the line from the first					//point to where we currently are.					directionX2 = x - randomX1;					directionZ2 = z - randomZ1;					//If the direction between the two directions is positive,					//the current point is above the line and should be					//increased by the height varient.					if ((directionX2 * directionZ1 - directionX1 * directionZ2)						> 0) {						tempBuffer[x][z] += heightVarience;					}				}			}		}		erodeTerrain(tempBuffer);		normalizeTerrain(tempBuffer);		//transfer the new terrain into the height map.		for (int i = 0; i < size; i++) {			for (int j = 0; j < size; j++) {				setHeightAtPoint((int) tempBuffer[i][j], j, i);			}		}		LoggingSystem.getLogger().log(			Level.INFO,			"Created Heightmap using Fault Fractal");		return true;	}