mars-0.2.1.0: Generates mountainous terrain using a random walk algorithm.

Maintainerch.howard@zoho.com
Safe HaskellNone

Graphics.Mars.Graph

Description

Use the graph function here to generate the raw graph array data based on various parameters.

Synopsis

Documentation

graphSource

Arguments

:: Int

height (array rows)

-> Int

width (array columns)

-> Float

stamped circle radius

-> Float

jitter factor of walk, usually nearly the same as radius

-> Int

a seed value for the random number generator

-> Int

numbers of steps to take in random walk

-> Float

magnification factor

-> (Float, Float)

starting point

-> IO (UArray (Int, Int) Float) 

Beginning in the center, follows a random walk path, and stamps a circle shape onto the array at each step. Internally uses a mutable unboxed array for efficiency, but returns the results in a frozen array.

zRandomizeSource

Arguments

:: Float

delta

-> Int

seed value for random number generator

-> UArray (Int, Int) Float

input UArray

-> UArray (Int, Int) Float 

Adjust each float value in a UArray by some random value between negative delta and delta.

meldGraphs :: UArray (Int, Int) Float -> UArray (Int, Int) Float -> UArray (Int, Int) FloatSource

From each pair of corresponding points on the two input UArrays, select the the higher point, to create a new UArray. The two arrays must have the same bounds, or an error is thrown.