Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r <- raster(nrows = 480 ,ncols = 736 ,ext = extent(0,600,0,450))
- Tx <- (xmax(r)-xmin(r))/3 # Define periods
- Ty <- (ymax(r)-ymin(r))/3
- x <- rasterToPoints(r)[,1] # get x coordinates
- y <- rasterToPoints(r)[,2] # get y coordinates
- z <- cos(2*pi*x/Tx)+cos(2*pi*y/Ty) # compute z
- r[] <- z
- plot(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement