Slope computation on a grid is focal operation on a cell and generally its eight adjacent neighbors (in fact for many algorithms, the actual point's elevation is not used).
The slope is taken as a dZ value divided by a horizontal distance. The horizontal distance is the data spacing (east-west, north-south, or diagonal).
For an Eight Neighbors Unweighted algorithm, you compute x and y derivatives
dzdx := (zne + ze + zse - zsw - zw - znw) / 6 / UseXSpace; (this will be the average of three differences in the x direction, each twice the data spacing)
dzdy := (znw + zn + zne - zsw - zs - zse) / 6 / AverageYSpace; (this will be the average of three differences in the y direction, each twice the data spacing)
Slope := sqrt(sqr(dzdx) + sqr(dzdy)); (magnitude of the vector from the Pythagorean theorem)
Aspect, the downhill direction, can be computed as a byproduct of the slope computation, as the arc tangent of the x and y derivatives.
Computed slope is generally done either in degrees, or in percent (the tangent of the angle * 100).
Computed slope will be a function of the data spacing; as the spacing goes up, computed slope decreases.
Sample slope maps
Detailed discussion of alternate slope algorithms.
MICRODEM can do:
Last revised 7/1/2014