Hemavathi Ramulu wrote:
Hi everyone,
I want you all help me to give an idea, how to draw pentagon with points?
Maybe can use function, but I'm stuck.
Yhank you.
Hi Hemavathi,
Try these to draw, successively, points at the vertices of a pentagon,
the outline of a pentagon and a filled pentagon. To rotate the pentagon,
add the rotation in radians to the two sequences.
xpos<-cos(seq(0,2*pi,by=2*pi/5))
ypos<-sin(seq(0,2*pi,by=2*pi/5))
plot(xpos,ypos,pty="s")
lines(xpos,ypos)
polygon(xpos,ypos,col="red")
Jim
______________________________________________
R-help@r-project.org 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.