Re: [R] Drawing a circle

From: Josef Eschgfaeller <esg_at_felix.unife.it>
Date: Thu 19 May 2005 - 22:10:45 EST

Mario Morales wrote:

> I need to draw a circle

I would do it with complex numbers
and polar coordinates:

Circle = function (t,a)
{a*cos(t)+1i*a*sin(t)}

interval=c(-8,8)
plot(interval,interval,type="n",xlab="",ylab="",

   asp=1,axes=F)
t=seq(0,2*pi,by=0.01)
center=2+3i; radius=5
lines(center+Circle(t,radius))
locator(1)
dev.off()

Josef Eschgfäller

-- 
Josef Eschgfäller
Dipartimento Matematico
Universita' di Ferrara
http://felix.unife.it


______________________________________________ R-help@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

Received on Thu May 19 22:18:55 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:51 EST