Advertisement
Guest User

Untitled

a guest
Oct 21st, 2014
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. r <- raster(nrows = 480 ,ncols = 736 ,ext = extent(0,600,0,450))
  2.  
  3. Tx <- (xmax(r)-xmin(r))/3 # Define periods
  4. Ty <- (ymax(r)-ymin(r))/3
  5.  
  6. x <- rasterToPoints(r)[,1] # get x coordinates
  7. y <- rasterToPoints(r)[,2] # get y coordinates
  8. z <- cos(2*pi*x/Tx)+cos(2*pi*y/Ty) # compute z
  9.  
  10. r[] <- z
  11. plot(r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement