R/generate.paths.R

generate.paths <-
function(index,rx,ry,N){
	
	x = rx - rx[index]
	y = ry - ry[index]
	x = pmin(abs(rx - rx[index]),N -abs(rx - rx[index]))
	y = pmin(abs(ry - ry[index]),N -abs(ry - ry[index]))
	#remove pt at origin
	x = x[-index]
	y = y[-index]
	
	dists = pmax(x,y)
	dsorted = sort(dists)
	return(dsorted)
}

Try the knnIndep package in your browser

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

knnIndep documentation built on May 2, 2019, 3:23 a.m.