Fractal Landscape spreadsheet
Here is a Microsoft Exceltm spreadsheet that generates
surfaces that look like fractal landscapes. They are generated
along the same general lines, although the process is not rigorously
fractal (the structure has a very limited scale of self-similarity)
nor very efficient (as it is meant to be easy to understand, and
because frankly this is a doodle I did during a long train ride)
Here is the approach.
I take an initial grid, and fill it with random 'peaks'>
Then I take each of the 'squares' in the grid and split it into four like this:
Then I smooth the edges by making each cell in a new graph the average of 9 cells in the old one, like this
And then I add another random factor to each cell. The random numbers are K times as big as the original ones, as otherwise the 'noise' would swamp the underlying pattern you are building up. K<1
Then you start feed the 4x4 array back into step 2, and do it
again, then a 16x16 array and so on. In practice, you 'loose'
a bit of edge each time, as you cannot average properly otherwise
in step 3. In the spreadsheet, steps 3 and 4 are carried out at
the same time.
At the end, you make any 'height' below a certain level = 0, and
that is sea level. So there are two basic variables:
'erosion' - in fact, 1/K. if =1 you just get a lot
of spikes. 1.7 - 2 gives rocky Cornish coasts, 4-5 gives smooth
Scottish hills.
'sea level' - which is obvious.
The 60x60 spreadsheet does exactly that, generating a 60x60 grid
(3600 height points). As it uses the Exceltm inbuilt
random number generator, every time you alter anything in the
sheet it recalculates a completely different landscape.
The 30x120 landscape looks more realistic for three reasons. I
have biassed the height of the row of initial points nearest the
viewer to be low, so that the view does not often end up inside
a mountain. I have made the array longer than it is deep, so it
looks more like a view through a window. I have altered the colours
on the plot so they sort-of match landscape colours. And I have
added an additional fudge factor 'steepness', which is the power
to which the final heights are raised before plotting. This means
that sea-level slopes are more gradual than mountain ones.
Here are the files, suitably compressed for windows and Mac.
Both spreadsheets are
big - about 500kbytes.
Here are four sample landscapes generated with 30x120.
Have fun.