Skip to content

Instantly share code, notes, and snippets.

@Ram-N
Created February 23, 2013 09:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ram-N/5019048 to your computer and use it in GitHub Desktop.
Save Ram-N/5019048 to your computer and use it in GitHub Desktop.
# RING of R-Rows C-cols in the center of width w cells
seedCenterRing <- function(r, c, wide){
for(x in as.integer((areaW-c)/2): as.integer((areaW + c)/2)){
for(y in as.integer((areaH-r)/2): as.integer((areaH + r)/2)){
area_df[x,y] <<- 1
}
}
#scoop out the inner ring
for(x in as.integer((areaW-c)/2 + wide): as.integer((areaW + c)/2 - wide)){
for(y in as.integer((areaH-r)/2+wide): as.integer((areaH + r)/2- wide )){
area_df[x,y] <<- 0
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment