# NOT RUN {
c1<-.4; c2<-.6
A<-c(0,0); B<-c(1,0); C<-c(c1,c2);
Tb<-rbind(A,B,C);
M<-as.numeric(runif.bastri(1,c1,c2)$g) #try also M<-c(.6,.2)
r<-2
P1<-as.numeric(runif.bastri(1,c1,c2)$g) #try also P1<-c(.4,.2)
NPEbastri(P1,r,c1,c2,M)
#or try
Rv<-rv.bastri.cent(P1,c1,c2,M)$rv
NPEbastri(P1,r,c1,c2,M,Rv)
P2<-c(1.8,.5)
NPEbastri(P2,r,c1,c2,M)
P3<-c(1.7,.6)
NPEbastri(P3,r,c1,c2,M)
r<-2
P1<-c(1.4,1.2)
P2<-c(1.5,1.26)
NPEbastri(P1,r,c1,c2,M) #gives an error if M=c(1.3,1.3)
#since center is not the circumcenter or not in the interior of the triangle
NPEbastri(P2,r,c1,c2,M) #gives an error due to same reason as above
# }
Run the code above in your browser using DataLab