t<-2
c<-.4
a<-0; b<-10;
#nx is number of X points (target) and ny is number of Y points (nontarget)
nx<-20; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10;
set.seed(1)
xr<-range(a,b)
xf<-(xr[2]-xr[1])*.1
Xp<-runif(nx,a-xf,b+xf)
Yp<-runif(ny,a,b)
Arcs<-arcsCS1D(Xp,Yp,t,c)
Arcs
summary(Arcs)
plot(Arcs)
S<-Arcs$S
E<-Arcs$E
arcsCS1D(Xp,Yp,t,c)
arcsCS1D(Xp,Yp+10,t,c)
jit<-.1
yjit<-runif(nx,-jit,jit)
Xlim<-range(a,b,Xp,Yp)
xd<-Xlim[2]-Xlim[1]
plot(cbind(a,0),
main="arcs of CS-PCD for points (jittered along y-axis)\n in middle intervals ",
xlab=" ", ylab=" ", xlim=Xlim+xd*c(-.05,.05),ylim=3*c(-jit,jit),pch=".")
abline(h=0,lty=1)
points(Xp, yjit,pch=".",cex=3)
abline(v=Yp,lty=2)
arrows(S, yjit, E, yjit, length = .05, col= 4)
t<-2
c<-.4
a<-0; b<-10;
nx<-20; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10;
Xp<-runif(nx,a,b)
Yp<-runif(ny,a,b)
arcsCS1D(Xp,Yp,t,c)
Run the code above in your browser using DataLab