justin bem
2006-Nov-07 06:31 UTC
[R] Re : Draw a circle with a given radius in an existing map
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible Url : https://stat.ethz.ch/pipermail/r-help/attachments/20061107/01cea378/attachment.pl
Roger Bivand
2006-Nov-07 07:27 UTC
[R] Re : Draw a circle with a given radius in an existing map
On Tue, 7 Nov 2006, justin bem wrote:> Try this : > >it<-seq(0,2*pi, l=100) > >xt<-r*cos(it) > >yt<-r*sin(it) > >points(xt,yt,type="l",col="blue") > > a circle of radium r is define by > xt=r*cos(t) > yt=r*sin(t)Isn't this suggestion on the plane, when the question was about finding the coordinates on the surface of the sphere (globe) in degrees of longitude and latitute that are x miles from the centre? If the area is not large, then projecting the centre point to a suitable planar projection, making the circle on the plane as above, and inverse projecting back to geographical coordinates should work (function project() in package rgdal). If the radius is in thousands of miles, the projection distortion would be considerable, though.> > Justin BEM > El?ve Ing?nieur Statisticien Economiste > BP 294 Yaound?. > T?l (00237)9597295. > > > > ----- Message d'origine ---- > De : Xiaomei Ma <xiaomei.ma at yale.edu> > ? : R-help at stat.math.ethz.ch > Envoy? le : Mardi, 7 Novembre 2006, 6h11mn 27s > Objet : [R] Draw a circle with a given radius in an existing map > > > I have drawn a map in which the X and Y axes are latitude and > longitude. Now I need to draw one circle on the map - the center is a > point with specific latitude and longitude, but the challenge is that > the radius is in miles. Is there a way to do this? I'd very much > appreciate your response. > > XM > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > > > > > ___________________________________________________________________________ > D?couvrez une nouvelle fa?on d'obtenir des r?ponses ? toutes vos questions ! > Profitez des connaissances, des opinions et des exp?riences des internaut > > [[alternative HTML version deleted]] > >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no