Here's a solution for four elliptical quadrants: elly <- function(N,S,W,E,x=0,y=0,n=100){
xo=yo=double(n*4) step=pi/(2*n) xf=c(E,W,W,E) yf=c(N,N,S,S) j=1 for(q in 1:4){ for(i in 1:n){ theta=(q-1)*(pi/2)+(i-1)*step xo[j]=xf[q]*cos(theta) yo[j]=yf[q]*sin(theta) j=j+1 } } return(cbind(xo+x,yo+y)) } then try: plot(elly(10,5,3,5),type='l') Barry _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo