[R] Slope of surface

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Wed Oct 20 11:24:11 CEST 2004

(Ted Harding) wrote:
> On 19-Oct-04 Laura Quinn wrote:
>>Is there a neat way of working out the slope of a flat surface in R?

>>Given (x,y,z) co-ordinates of the four corners of a square, is there a
>>function which will allow me to calculate the "mean" slope of the
>>surface in a given direction?

  I had a quick look at the help for r.slope.aspect for the GRASS GIS 
[1]. To compute the slope of a raster grid it uses 'Horn's Formula' [2] 
which it says works by taking the 3x3 neighbourhood of the cell in 
question. If you really want a slope map over a big grid, this might be 
a better way to do it.



[2] Horn, B. K. P. (1981). Hill Shading and the Reflectance Map, 
Proceedings of the IEEE, 69(1):14-47.

More information about the R-help mailing list