Nice one, Barry! It shows up even nicer (IMO) when you add plot(elly(10,5,3,5),type='l', asp=1)
Barry Rowlingson wrote: > 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 -- Edzer Pebesma Institute for Geoinformatics (ifgi), University of Münster Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de http://www.52north.org/geostatistics e.pebe...@wwu.de _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo