R/pointsGenerator.R

Defines functions pointsGenerator

Documented in pointsGenerator

pointsGenerator <-
function(startx, starty, ucoords, radius=radius, backstep){
  
  start.points<-cbind(rep(startx,radius+1),rep(starty,radius+1),rep(0,radius+1))
  if(backstep==0){
  ucoords<-ucoords[-which(ucoords[,3]==0),]}
  line.point.list<-vector(length = nrow(ucoords),mode="list")
  
  n<-nrow(ucoords)
  
  for(i in 1:n){
    
    x<-round(seq(0,ucoords[i,1],length.out=(radius+1)),0)
    y<-round(seq(0,ucoords[i,2],length.out=(radius+1)),0)
    z<-round(seq(0,ucoords[i,3],length.out=(radius+1)),0)
    line.points<-cbind(x,y,z)
    line.point.list[[i]]<-line.points+start.points
  }
  
  return(line.point.list) 
}

Try the GoodFibes package in your browser

Any scripts or data that you put into this service are public.

GoodFibes documentation built on Aug. 19, 2023, 1:06 a.m.