Rotates the detrended DEM according to the main direction of the Fourier spectrum

rotate_raster(rstr, ang_fourier)

Arguments

rstr

a RasterLayer

ang_fourier

numeric, angle of the main component of the 2D Fourier spectrum; the rotation is clockwise

Value

a matrix corresponding to the DEM rotated in the main direction of the Fourier spectrum

Examples

r <- raster::raster(ncol = 3, nrow = 3) raster::values(r) <- 1:(raster::ncell(r)) raster::as.matrix(r)
#> [,1] [,2] [,3] #> [1,] 1 2 3 #> [2,] 4 5 6 #> [3,] 7 8 9
raster::as.matrix(rotate_raster(r, 45))
#> [,1] [,2] [,3] [,4] #> [1,] NA 1 1 NA #> [2,] 7 4 2 3 #> [3,] 7 8 6 3 #> [4,] NA 9 9 NA